PageSourceSearch

https://epomaker.jp/cdn/shopifycloud/checkout-web/assets/c1/component-ApplePayButton.DfYxt3Dn.js

js epomaker.jp collected 2026-09-30 18:57:21 UTC 8,628 bytes, 1 lines download raw bytes

1import{u as e,i as A,A as z,q as y,h as j,e as O,g as F,f as N,o as V,G as $,l as Q,S as Z}from"./esnext-vendor.BDPAaZdq.js";import{O as D,aS as ee,cc as te,a5 as ne,cd as ae,aY as oe,N as se,ay as ie}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{c as J,c4 as _,aa as le,c5 as re,c6 as ce,k as ue,b7 as pe,B as q,P as de,L as me,o as ye,l as ve,aw as he,I as be,H as Pe,bB as Se,a9 as fe,c7 as _e,c8 as ge,K as Ae,O as Ce}from"./hydrate.B0xlt2dG.js";import{A as we}from"./app.D1P6yWfp.js";import{T as ke}from"./TransitionHeight.M5zGQYzu.js";import{S as G,b as Le}from"./hooks-useWalletsTimeout.i08rvNYN.js";import{c as Me}from"./localization-index.Bo8bPuxq.js";import{s as U}from"./components-VatNumberValidationField.mzwVZP7U.js";import"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./hooks-usePostPurchase.BPY08f0g.js";import"./helpers-credit-card-disabled.BnSr1GsQ.js";import"./FormLayout.CMVyKzjL.js";import"./amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js";import"./useShopPayButtonClassName.nv37ytUz.js";import"./addresses-is-address-empty.Ch6V3XcM.js";import"./AddressPresenter.B0qw2vWQ.js";import"./hooks-useShouldRevealCustomization.wOAvQfO_.js";import"./hooks-useForceShopPayUrl.F3deeEs7.js";import"./ChangeCompanyLocationLink.Ci5U9F_D.js";import"./BillingAddressForm.aTSlVDrG.js";import"./PhoneField.ykPh8SPx.js";import"./hooks-useSuppressShopPayModalOnLoad.brztd70E.js";
1import"./Popover.BUTwaoOa.js";import"./Choice.BIzIW4rp.js";import"./Checkbox.CiixBh9Z.js";import"./shop-pay-installments-monorail.D0Myc1k_.js";import"./ImpressionEventCapture.iMEQlBKs.js";import"./ShopPayLogo.Cut4IRi6.js";import"./hooks-useWalletsMonorailTrack.CvfUTPBc.js";import"./hooks-useShopPayNewSignupLoginExperiment.CrD2gvGR.js";import"./EmptyState.b83C9ddY.js";import"./cross-border-hooks.DVubeg9N.js";import"./Section-SectionStyleOverride.CP0VFRId.js";import"./utilities-publishMessage.BORnEDuA.js";import"./utilities-stable-ref.Dvd2X3ul.js";import"./AutocompleteField-hooks.D2O1AcIY.js";import"./PendingShipping.2eopPL-C.js";function Ee({body:v}){return e(re,{children:e(le,{dangerouslySetInnerHTML:{__html:v.value??""},scrollableContent:"all"})})}function xe({body:v,loading:C,error:w}){const{i18n:S}=D();return e(A,{when:w,fallback:e(A,{when:C,fallback:e(Ee,{body:v}),children:e(J,{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}=D(),{checkoutProtocolModalEventSignal:c}=ee(),k=h.translate("payment.purchase_options_cancellation_policy_label"),L=i.merchantPolicies.find(({handle:m})=>m===G),a={handle:G,shopId:i.id,shopName:i.name,squareLogo:i.brandSettings?.squareLogo,name:k,url:L?.url??""},o=te(ce,{defaultPolicy:a,policies:[a]}),f=z(!1),s=y(()=>{f.current&&c.value==="applePaySubscriptionConsent"&&(c.value="none"),f.current=!1},[c]);j(()=>s,[s]);const n=O(!1),u=O(!1),I=z(null),b=ue(),p=pe(n.value,"slow"),l=n.value||u.value,Y=!n.value||u.value,M=y(m=>{I.current=m,m&&(m.dataset.inertSupported=String("inert"in m))},[]),E=h.translate("wallets.continue_with",{walletName:h.translate("brand.apple_pay")}),x=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]),T=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(J,{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:x},n.value?"policy":"consent")]}),accessibilityLabel:x,onShow:T,onHide:R,actionLayout:"stacked",primaryAction:e(ve,{variant:"primary",type:"button",inlineSize:"fill",disabled:!C.value,onClick:w,children:E}),children:e(q,{className:g.SubscriptionConsentModal,children:e(ke,{contentRef:I,children:e(q,{ref:M,className:g.Views,padding:"small-200",overflow:"hidden",children:[e(A,{when:()=>b?!n.value:p!=="entered",children:e(q,{className:F(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:E,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(q,{className:F(g.Pane,!n.value&&g["Pane-outgoing"]),"data-side":"forward","data-visible":n.value&&(b||p!=="enter"),position:n.value?"relative":"absolute",inert:Y,children:e(xe,{body:o.policyBody,loading:o.loading,error:o.error})})})]})})})})}const Ne=Ce("ApplePaySubscriptionConsentModal");function _t({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=z({status:"rendered"});V(()=>{const t=i.value!=null,H=r.value;t&&H.status==="not_rendered"?$(()=>{r.value=c.current}):!t&&H===c.current&&$(()=>{r.value={status:"not_rendered"}})}),j(()=>()=>{r.value===c.current&&(r.value={status:"not_rendered"})},[r]);const k=fe(),L=z(null),{observability:a,i18n:o,checkout:f}=D(),{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=O(!1),Y=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]),E=()=>{a.log("apple_pay_button_clicked_while_loading","Apple Pay button clicked while already loading the payment sheet. Ignoring click.")},x=()=>{a.error(new we("Apple Pay button clicked without a ready session handler."))},B=t=>{if(s.activeSession.value?.wallet==="APPLE_PAY"){E();return}const W=i.value;if(!W){x();return}try{W.openApplePayPaymentSheet(W.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 X={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",X),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);V(()=>
1{if(!l.value)return;(!P.value||i.value==null||s.activeSession.value!=null)&&(M("invalidated"),b(p))});const T=()=>{const t=s.activeSession.value;if(t?.wallet==="APPLE_PAY"){E();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){x();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"))},K=i.value!=null;return e(Z,{children:[e("button",{ref:t=>{L.current=t,k("apple_pay")(t)},className:F(U.ApplePayButton,U[C],ie.borderRadius,se({focusRing:"base"})),lang:o.locale,disabled:!K,onClick:T,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:Y,onHide:M,onConfirm:m})})]})}export{_t 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.