PageSourceSearch

https://store.tobykeith.com/cdn/shopifycloud/checkout-web/assets/c1/PaymentOptionSelector.NK2c1p5E.js

js tobykeith.com collected 2026-09-24 21:02:34 UTC 11,706 bytes, 1 lines download raw bytes

1import{l as Q,e as X,f as B,u as e,S as V,i as ee,k as T,h as w,q as f,T as L,A as C,p as me,G as pe,g as he,D as ge}from"./esnext-vendor.BBoIVOQW.js";import{cR as te,cS as ve,cN as ne,d as se,cT as fe,k as M,n as ae,P as F,aC as ye,aE as be,aF as _e,l as x,cU as Se,U as Pe,I as Ae,B as ie,b5 as Ie,f as Ce,bD as Me,b as Oe}from"./hydrate.Tsur0pib.js";import{f as Be,d as we,e as Le,B as G}from"./components-PaymentMethodProgressionHost.CYFvVPub.js";import{T as y,a5 as H,W as Ne,cZ as Te,V as Ee,c_ as ke,c$ as De,aq as Re,d0 as Fe,aF as xe,d1 as Ve}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{f as He,D as qe}from"./useAddressMutationsWithNegotiation.CQZ3NdoZ.js";import{b as We}from"./hooks-useGeneralPaymentErrorMessage.D4EkCdRM.js";import{u as ze}from"./hooks-useShopPayProgressIntercepts.CTuACx9_.js";import{B as Ye}from"./BillingAddressSelector.DUqZsdpg.js";import{a as Ue,C as N,b as je}from"./Choice.18syyoW7.js";import{u as Ge,P as $e}from"./components-DeliveryTransition.Dys1ZJbh.js";import{S as $}from"./ChangeCompanyLocationLink.a6EWibK9.js";import{u as Je}from"./hooks-useUpdateCheckoutAddress.8zTRFnp4.js";import{C as Ze}from"./localization-index.P2wbDjPJ.js";import{C as Ke}from"./IncentiveBadge.DttARc72.js";import{u as Qe,a as Xe}from"./OnePage.CkZ_VFLS.js";import{g as et}from"./app.CUBUOQtX.js";import{g as tt}from"./shop-pay-installments-monorail.wQxzDho3.js";import{I as nt}from"./hooks-useStableHostMethodsReferences.DJyLKxes.js";function qt({selectorShowsTiles:s,afterPaymentSelector:t}){const a=We(),l=te(),{checkout:n,i18n:o,shopPay:r,source:i}=y(),d=ve(),u=ne(),m=se(),{paymentMethods:c}=H(),h=r.user.creditCards,p=Q(ze().creditCardDisabled),v=X(null),g=B(()=>!(d.value||fe({checkout:n,source:i})?.pickupAddress)&&!u.value&&n.isShippingRequired.value),b=B(()=>at({identity:n.identity},{billingPosition:l,vaultedSections:m,showBillingAddressInContext:g})),_=B(()=>He({paymentMethods:c.value})),O=B(()=>st({identity:n.identity,i18n:o},{paymentMethodMustSupportInterestBearingLoans:n.installments.paymentMethodMustSupportInterestBearingLoans.value,supportedCountryOptions:n.installments.supportedCountryOptions.value,creditCards:h.value,creditCardDisabled:p.value})),P=e(qe,{blurValidationFieldDenylist:_.value,onSetFieldErrors:a,children:[e(Be,{vaultHandle:v}),e(M,{gap:"base",children:[e(it,{}),e(we,{billingAddressInContext:b.value,vaultHandle:v,selectorShowsTiles:s,afterPaymentSelector:t})]})]});return e(ee,{when:O,fallback:P,children:E=>e(V,{children:[e(M,{gap:"small-400",children:[e(ae,{level:2,children:o.translate("credit_card_form.add_debit_card")}),e(F,{color:"subdued",children:E})]}),P]})})}function st({identity:s,i18n:t},{paymentMethodMustSupportInterestBearingLoans:a,supportedCountryOptions:l,creditCards:n,creditCardDisabled:o}){if(s.current.value!=="shopPay"||!a||!n.every(i=>o(i)))return null;const r=l.map(i=>i.label).join(", ");return r?t.translate("installments.installments_debit_cards_supported_countries",{countries:r}):t.translate("installments.installments_valid_debit_cards_fallback")}function at({identity:s},{billingPosition:t,vaultedSections:a,showBillingAddressInContext:l}){switch(s.current.value){case"shopPay":return t.value==="inContext"&&!a.value.payment;case"businessCustomer":return!0;default:return l.value}}function it(){return Le(),null}const ot="billing_address_selector",D="shipping_address",J="custom_billing_address";function lt({renderFormOnly:s=!1}={}){const{i18n:t}=y(),a=ye(),{billingAddressOption:l}=Ne(),n=be(),o=l.value==="shipping"?D:J,[r,i]=T([o]),{isBilling:d}=Ge().value,u=d?e($e,{}):null;w(()=>{i([o])},[o]);const m=f(p=>{const v=p[0]===D?"shipping":"custom";l.value=v,i(p),v==="shipping"&&n()},[l,n]);_e();const c=f(({billing:p})=>{p.value=!0},[]),h=f(({billing:p})=>{p.value=!1},[]);return e(ee,{when:()=>!s&&a.value!=="form",fallback:e($,{onValid:c,onInvalid:h,children:e(G,{children:u})}),children:e(Ue,{name:ot,values:r,onChange:m,variant:"block",children:[e(N,{value:D,accessibilityLabel:t.translate("payment.same_billing_address_label"),children:e(x,{type:"strong",children:t.translate("payment.same_billing_address_label")})}),e(N,{value:J,selectedContent:e($,{onValid:c,onInvalid:h,children:e(G,{children:u})}),accessibilityLabel:t.translate("payment.different_billing_address_label"),children:e(x,{type:"strong",children:t.translate("payment.different_billing_address_label")})})]})})}const Z=()=>{const{i18n:s,checkout:{identity:t}}=y(),a=rt({identity:t});return e(M,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",gap:"base",children:[e(ae,{id:"billingAddress",level:2,children:s.translate("payment.billing_address_title")}),e(a,{})]})};function Wt({dynamicPaymentExtensions:s=[],children:t}){Se();const a=te(),l=ne(),{checkout:n}=y(),o=se(),r=Te({checkout:n}),i=o.value.payment&&o.value.billing&&!r,[d]=Je(),u=L(()=>Object.values(Ee).some(c=>d===c),[d]),m=!i&&!l.value&&!u;return e(M,{gap:"base",children:[a.value==="beforePayment"&&m&&e(Z,{}),t,a.value==="afterPayment"&&!u&&e(V,{children:[m&&e(Z,{}),e(Pe,{customizations:s})]})]})}function rt({identity:s}){return s.current.value==="businessCustomer"?Ye:lt}function ct(){const{checkout:{identity:s},shopPay:t}=y(),a=ke(),l=H().paymentMethods;return B(()=>{const n=a.value,o=t.user.installments.prequalifiedAmount.value,r=t.user.installments.credential.value,i=l.value?.find(m=>m.type==="wallet"&&m.name==="SHOPIFY_INSTALLMENTS"),d=s.current.value==="shopPay"&&n!=null&&i!=null&&n.amount>=Math.max(i.minPrice.amount,50)&&n.currencyCode===i.minPrice.currencyCode,u=o!=null&&n!=null&&(r?.requiresAdditionalInformation&&n.amount<=o.amount||!r?.requiresAdditionalInformation);return d&&u})}function dt({selectable:s}){const{userEvents:t,source:a,checkout:l,shop:n,shopPay:o,embed:r}=y(),{ineligibilityReasons:i}=l.installments,{isServiceAvailable:d}=o.installments,{isRejected:u}=o.user.installments,{isLoading:m}=o.session,c=X(null),h=C(!1),p=Q(s);function v(){const g=p.value,b=g?void 0:JSON.stringify(ut({ineligibilityReasons:i.value,serviceAvailable:d.value,userRejected:u.value}));t.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...tt(a,l,n,{embedPlatform:r?.platform,shopAppSurface:o.app.config.surface}),eventType:De.OptionImpression,success:g,errorMessage:b}})}return me(()=>{const g=c.value;if(!g||m.value||h.current)return;const b=()=>{h.current=!0,pe(v)};if(!window.IntersectionObserver){b();return}const _=new IntersectionObserver(O=>{O.some(({isIntersecting:P})=>P)&&(_.disconnect(),b())},{threshold:1});return _.observe(g),()=>_.disconnect()}),f(g=>{c.value=g},[c])}function ut({ineligibilityReasons:s,serviceAvailable:t,userRejected:a}){return s.length>0?s:t?a?["user_rejected"]:["unknown"]:["installments_unavailable"]}const mt=1e4,R={error:"iovation_sandbox_error",init:"iovation_sandbox_initialize",fingerprint:"iovation_sandbox_fingerprint"};function pt({onComplete:s}){const t=C(null),a=C(),[l,n]=T(!1),{environment:{services:{shopServer:o}},observability:r}=y(),i=C(performance.now()),d=f(c=>{s(c),n(!0),a.current=c},[s]),u=f(({data:c,origin:h,source:p})=>{if(h==="null"&&p===t.current?.contentWindow&&typeof c.payload=="string"&&c.payload!=="")switch(c.action){case R.error:r.leaveErrorBreadcrumb("[Iovation] Fingerprint error",{error:c.payload}),d("");break;case R.fingerprint:r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(c.payload);break}},[d,r]),m=f(()=>{t.current?.contentWindow&&t.current.contentWindow.postMessage({action:R.init},"*")},[]);return w(()=>(window.addEventListener("message",u),()=>{window.removeEventListener("message",u)}),[u]),w(()=>{const c=setTimeout(()=>{a.current===void 0&&(r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(""))},mt);return()=>clearTimeout(c)},[d,r]),l?null:e(nt,{ref:t,id:"iovation_sandbox_iframe",sandbox:"allow-scripts",src:new URL("/pay/iovation",o.url).href,style:{display:"none"},onLoad:m})}function ht(s){const t=C(null),a=C(!1);return w(()=>
1{if(a.current)return;if(!window.IntersectionObserver){a.current=!0,s();return}const l=new IntersectionObserver(o=>{const r=o.some(({isIntersecting:i})=>i);n&&r&&(a.current=!0,l.unobserve(n),s())},{threshold:1}),n=t.current;return n&&l.observe(n),()=>{n&&l.unobserve(n)}},[s]),t}const gt="Pdl91",vt="n7rut",ft="_4PVkL",yt="a3kZU",bt="F1g68",_t="Wkh24",I={Wrapper:gt,Active:vt,NoAnimation:ft,Badge:yt,Icon:bt,Label:_t};function St(){const{prequalifiedAnimatedBadgeShowCounter:s}=Re(),[t,a]=T(!1),{i18n:l}=y(),n=l.translate("installments.installments_prequalified_status_badge"),o=ht(f(()=>{a(!0),s.value+=1},[s]));return e("div",{className:he(I.Wrapper,{[I.Active]:t},{[I.NoAnimation]:s.value>1}),ref:o,children:e("span",{className:I.Badge,children:[e("span",{className:I.Icon,children:e(Ae,{type:"check-circle",size:"fill"})}),e("span",{className:I.Label,children:n})]})})}const K=ge(function({title:t,subtitle:a,disabled:l,badge:n},o){const r=e(F,{color:l?"subdued":void 0,children:e(x,{type:"strong",children:t})}),i=e(F,{children:a});return n?e(M,{ref:o,gap:"small-100",children:[e(M,{direction:"inline",gap:"base",children:[r,e(St,{})]}),i]}):e(ie,{ref:o,children:[r,i]})});function zt({ineligibilityReason:s}){const{observability:t,userEvents:a,i18n:l,source:n,checkout:o,shop:r,shopPay:i}=y(),[d,u]=T(!1),m=Ie(),{recordRetailEvent:c}=Qe(),{negotiate:h}=Ce(),{paymentMethods:p}=H(),v=et(i),g=ct(),b=Xe(),{payNowLabel:_,payNowSubtitle:O,installmentsLabel:P,installmentsSubtitle:E}=b.value,q=i.user.installments.prequalifiedAmount.value,W=i.installments.isServiceAvailable.value,k=i.session.paymentMethodOption.value,oe=L(()=>k?[k.name]:[],[k]),z=i.user.installments.isRetryable.value,Y=o.installments.isUnavailable.value,S=L(()=>!W||Y&&!z,[W,Y,z]),le=dt({selectable:!S}),re=L(()=>{if(g.value&&q&&!S)return"prequalified"},[g.value,S,q]),U=f(async()=>{d||(u(!0),await h({force:!1,fieldsToResolve:["taxes","paymentMethods"],include:["paymentLines"],customizeNegotiation:A=>(A.payment?.paymentLines.push({amount:{any:!0},paymentMethod:{walletPaymentMethodConfig:{name:"SHOPIFY_INSTALLMENTS"}}}),A)}))},[h,d]);w(()=>{v==="SHOPIFY_INSTALLMENTS"&&U()},[U,v]);const ce=f(([A="SHOPIFY_INSTALLMENTS"])=>{const de=Fe(p.value)?.availableLoanTypes,{action:j,method:ue}=Pt({paymentMethodName:A,availableLoanTypes:de});i.session.unstable_updatePaymentMethodOption(ue),m.value&&c(j),A==="SHOPIFY_INSTALLMENTS"&&t.log("payment_method_selected","[Installments] Payment method selected",{paymentMethodName:A}),a.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...xe(n,o,r),action:j}})},[p,i.session,m,t,a,n,o,r,c]);return e(V,{children:[S&&e(ie,{children:[e(Me,{heading:l.translate("payment_ux.payment.payment_option.installments_unavailable"),tone:"info",children:s||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Oe,{blockSize:"base"})]}),e(Ze.Provider,{value:!0,children:e(je,{presentation:"base",children:e(Ke,{name:"payment_method_options",title:l.translate("payment.payment_option.accessibility_label"),titleHidden:!0,onChange:ce,values:oe,children:[e(N,{value:"SHOP_PAY",children:e(K,{title:_,subtitle:O})}),e(N,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:i.setDeviceFingerprint}),e(K,{ref:le,title:P,subtitle:E,disabled:S,badge:re})]})]})})})]})}function Pt({paymentMethodName:s,availableLoanTypes:t}){if(s==="SHOP_PAY")return{action:"payment_method_pay_now",method:{type:"wallet",name:"SHOP_PAY"}};const a={type:"wallet",name:"SHOPIFY_INSTALLMENTS"};return Ve(t)?{action:"payment_method_interest_bearing_installments",method:a}:{action:"payment_method_installments",method:a}}export{qt as P,Wt as W,zt as a,rt as g};

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.