PageSourceSearch

https://shop.whoi.edu/cdn/shopifycloud/checkout-web/assets/c1/PaymentOptionSelector.LuuQe4at.js

js whoi.edu collected 2026-09-24 08:31:13 UTC 11,768 bytes, 1 lines download raw bytes

1import{l as Z,e as K,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.D7ldIee_.js";import{cU as te,cV as ve,cQ as ne,d as se,cW as fe,k as M,n as ae,P as F,aF as ye,aH as be,aI as _e,l as x,cX as Se,U as Pe,I as Ae,B as ie,bg as Ie,bN as Ce,b as Me}from"./hydrate.ByRIsqvd.js";import{f as Oe,d as Be,e as we,B as G}from"./components-PaymentMethodProgressionHost.BgOpCmhs.js";import{N as y,$ as H,O as Le,da as Ne,V as Te,db as Ee,an as ke,a0 as De,bz as Re,aC as Fe,dc as xe}from"./addresses-is-address-empty.-MuOhIyI.js";import{f as Ve,D as He}from"./useAddressMutationsWithNegotiation.Bu1iJp6d.js";import{b as qe}from"./hooks-useGeneralPaymentErrorMessage.CXe06B2R.js";import{u as We}from"./hooks-useShopPayProgressIntercepts.CnlV9rdf.js";import{B as ze}from"./BillingAddressSelector.CyVrY0kP.js";import{a as Ye,C as N,b as Ue}from"./Choice.Dywz6_Fr.js";import{u as je,P as Ge}from"./components-DeliveryTransition.BjmsXjx9.js";import{S as $}from"./ChangeCompanyLocationLink.Ba8IeUdU.js";import{u as $e}from"./hooks-useUpdateCheckoutAddress.4zyjtqEx.js";import{C as Je}from"./localization-index.DBksi22x.js";import{C as Qe}from"./IncentiveBadge.D66zssvS.js";import{u as Xe,a as Ze}from"./OnePage.JtsOe4gf.js";import{g as Ke}from"./app.A60-IfPs.js";import{g as et}from"./shop-pay-installments-monorail.cv2DVyY3.js";import{S as tt}from"./context-CheckoutSheetProtocolClient.CNLSBD5p.js";import{I as nt}from"./hooks-useStableHostMethodsReferences.C4W1cetV.js";function Wt({selectorShowsTiles:s,afterPaymentSelector:t}){const a=qe(),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=Z(We().creditCardDisabled),v=K(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(()=>Ve({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(He,{blurValidationFieldDenylist:_.value,onSetFieldErrors:a,children:[e(Oe,{vaultHandle:v}),e(M,{gap:"base",children:[e(it,{}),e(Be,{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 we(),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}=Le(),n=be(),o=l.value==="shipping"?D:J,[r,i]=T([o]),{isBilling:d}=je().value,u=d?e(Ge,{}):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(Ye,{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 Q=()=>{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 zt({dynamicPaymentExtensions:s=[],children:t}){Se();const a=te(),l=ne(),{checkout:n}=y(),o=se(),r=Ne({checkout:n}),i=o.value.payment&&o.value.billing&&!r,[d]=$e(),u=L(()=>Object.values(Te).some(c=>d===c),[d]),m=!i&&!l.value&&!u;return e(M,{gap:"base",children:[a.value==="beforePayment"&&m&&e(Q,{}),t,a.value==="afterPayment"&&!u&&e(V,{children:[m&&e(Q,{}),e(Pe,{customizations:s})]})]})}function rt({identity:s}){return s.current.value==="businessCustomer"?ze:lt}function ct(){const{checkout:{identity:s},shopPay:t}=y(),a=Ee(),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=K(null),h=C(!1),p=Z(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:{...et(a,l,n,{embedPlatform:r?.platform,shopAppSurface:o.app.config.surface}),eventType:tt.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}=ke(),[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 X=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 Yt({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}=Xe(),{negotiate:h}=De(),{paymentMethods:p}=H(),v=Ke(i),g=ct(),b=Ze(),{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=Re(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:{...Fe(n,o,r),action:j}})},[p,i.session,m,t,a,n,o,r,c]);return e(V,{children:[S&&e(ie,{children:[e(Ce,{heading:l.translate("payment_ux.payment.payment_option.installments_unavailable"),tone:"info",children:s||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Me,{blockSize:"base"})]}),e(Je.Provider,{value:!0,children:e(Ue,{presentation:"base",children:e(Qe,{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(X,{title:_,subtitle:O})}),e(N,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:i.setDeviceFingerprint}),e(X,{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 xe(t)?{action:"payment_method_interest_bearing_installments",method:a}:{action:"payment_method_installments",method:a}}export{Wt as P,zt as W,Yt 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.