PageSourceSearch

https://blendiblender.com/cdn/shopifycloud/checkout-web/assets/c1/cc6ff67d.Cv0tvluH.js

js blendiblender.com collected 2026-10-06 16:16:26 UTC 5,924 bytes, 1 lines download raw bytes

1import{T as e,g as t,h as n,q as a,s,k as r}from"./2c1ab0fe.Bywc2Brn.js";import{aO as o,c as i,bM as d,bN as u,aL as l,K as p,bO as c,aM as y,bP as m,bQ as h,bR as v,bS as f,bT as g,bU as b,bV as P,bW as C,v as M,Q as A,bX as T,a as k,bf as S}from"./9dba8418.BjFsJfKG.js";import{s as _,c8 as w,c9 as I,ca as E}from"./164ad2e3.CwFFCQJV.js";import{h as N}from"./e12db40c.BZEbMADi.js";import{s as O,i as q}from"./08a3b809.CFQqgobO.js";class x extends Error{constructor(){super(...arguments),this.name="UnsupportedShopPayCustomerCardError"}}function L({allowPreselect:s=!0,displayedPaymentMethods:r}={}){const A=o(),{checkout:{identity:T,negotiator:k},observability:S,userEvents:E,shop:O}=i(),{hasNegotiatedAlternativePaymentCurrencySignal:q,newCardSignal:L}=k.context,B=k.current.fields.paymentMethods,{value:R}=d(),{negotiate:J}=_(),V=k.current.fields.paymentLines,D=u(),{currencyCode:G,id:H,paymentMethodAutoSelectionDisabled:Q}=O,K="shopPay"===T.current.value,W=!K,X=r??R,z=e(()=>U(X,K),[X,K]),{value:Y}=k.current.fields.buyerIdentity,Z=k.parts.paymentLines,{value:$}=k.current.fields.deferredTotal,{value:ee}=k.current.fields.paymentFlexibilityPaymentTermsTemplate,te=l(),ne=Y?.presentmentCurrency||G,ae=w(),se=t(!1),re=t(!1),oe=K?Z.value.find(e=>e.method.type===p.CreditCard)?.method.type:void 0;n(()=>{oe&&!re.current&&(re.current=!0,S.counter({name:"shop_pay_unsupported_customer_card_on_payline",value:1,attributes:{payment_method_type:oe}}),S.error(new x("Shop Pay proposed payment line contains an unsupported Customer Account saved card"),{severity:"warning",metadata:{value:{paymentMethodType:oe}}}))},[S,oe]);const ie=e(()=>{const e=z.find(c);if(W&&e&&y(Z.value))return m(e);const t=Z.value.filter(e=>h(e,z,{identity:T})||v(e)),n=f(t),[a]=n;return void 0!==a?a:(S.leaveErrorBreadcrumb("Unexpected: Selected payment method is empty because `paymentLines` array is empty",{displayedPaymentMethods:JSON.stringify(z),displayedProposedPaymentLines:JSON.stringify(t)}),"")},[z,T,S,Z.value,W]),de=a((e,t,{rebuild:n=!1,buyerInitiated:a=!1}={})=>{const s=Z.value,o=U(r??B.value??[],K),i=F(s,o),d=s.some(e=>"direct"===e.method.type),u=g([e],[...s,...!d&&L.value?[{method:L.value}]:[]],o,{negotiatedPaymentLines:V.value?.lines,deferredTotal:$,hasPayableDeposit:Boolean(D.value?.amount),hasFixedSellingPlan:te.value,rebuild:n,paymentTermsTemplateType:ee?.type,preserveShopPayApproval:W});Z.value=t?function(e,t){return e.map(e=>function(e,t){return e.method.type===t.type?{...e,method:{...e.method,...t}}:e}(e,t))}(u,t):u;const l=F(u,o),p=b(i,l,ne);p&&(q.value=!0,E.monorailEvent(function({uniqueToken:e,shopGid:t,shopCurrencyCode:n,presentmentCurrencyCode:a,checkoutSessionIdentifier:s,previousPaymentMethod:r,currentPaymentMethod:o}){return{schemaId:"multi_currency_checkout_payment_method_change/2.0",payload:{shopId:parseInt(M(t),10),userToken:e,checkoutToken:s||"",shopCurrencyCode:n,checkoutPresentmentCurrencyCode:a,priorPaymentMethodHandle:j(r),priorPaymentType:I(r?.type||""),newPaymentMethodHandle:j(o),newPaymentType:I(o?.type||""),isPriorPaymentMethodMc:C(a,r),isNewPaymentMethodMc:C(a,o)}}}({uniqueToken:A.value.defaultAttributes?.uniqToken||"",shopGid:H,shopCurrencyCode:G,presentmentCurrencyCode:ne,previousPaymentMethod:i,currentPaymentMethod:l})));const c=a&&P(i,l);(p||c)&&J({})},[q,B,V.value?.lines,L,$,D.value?.amount,ne,Z,E,A.value.defaultAttributes?.uniqToken,H,G,J,ee,te,r,K,W]);n(()=>{ae&&!ie&&0===Z.value.length&&(se.current=!1)},[ie]);const ue=z.at(0);if(s&&!ie&&!se.current&&ue&&!N(Z.value)&&!(Q&&z.length>1)){const e=m(ue);S.leaveErrorBreadcrumb("rebuilding payment lines on missing selected payment line",{displayedPaymentMethods:JSON.stringify(z),selectedPaymentMethod:e}),de(e,void 0,{rebuild:!0}),se.current=!0}return e(()=>[ie,de],[ie,de])}function U(e,t){return t?e.filter(e=>e.type!==p.CreditCard):e}function j(e){if(void 0===e)return"";const t="name"in e&&e.name||void 0,n="paymentMethodIdentifier"in e&&e.paymentMethodIdentifier||void 0;return E(e.type,t,n)}function F(e,t){return t.find(t=>e.find(e=>"paymentMethodIdentifier"in e.method&&"paymentMethodIdentifier"in t?e.method.paymentMethodIdentifier===t.paymentMethodIdentifier:"wallet"===e.method.type&&"wallet"===t.type?e.method.name===t.name:e.method.type===t.type))}function B({isApplePayAvailable:t}){const{checkout:{identity:n,negotiator:a},shopPay:r}=i(),o=s(t);return e(()=>O({identity:n,shopPay:r,negotiatedFields:a.current.fields},{isApplePayAvailable:o}),[n,o,a.current.fields,r])}function R(){const{shop:e}=i(),t=e.hasFlagEnabled(A),n=T();return r(()=>!t&&n.value)}function J(){const{negotiate:e}=_(),{shopPay:t,checkout:n,observability:s}=i(),r=n.configuration.addressSettings.nonBillingAddressSettings;return{updateCheckoutAddress:a(async({shippingAddress:a,billingAddress:o,fallbackPhoneNumber:i},d=!1)=>
1{if(!a&&!o)return;const u=[];if(a){u.push("shippingAddress");const e=r.value.isRequired("phone",{countryCode:a.countryCode,useMerchantSettings:!0})&&!a.phone?i:a.phone;s.log("wallets_shipping_address_update","useUpdateCheckoutAddress: update with Shop Pay vaulted address",{isPostalCodePadded:k(a.postalCode,a.countryCode),countryCode:a.countryCode}),n.negotiator.parts.shippingAddress.value={...a,phone:e,oneTimeUse:a.oneTimeUse||!1}}if(o){u.push("billingAddress");const e=r.value.isRequired("phone",{countryCode:o.countryCode,useMerchantSettings:!0})&&!o.phone?i:o.phone;n.negotiator.parts.billingAddress.value={...o,phone:e}}const l=q(a??n.negotiator.parts.shippingAddress.value,o??n.negotiator.parts.billingAddress.value);t.user.hasCreditCards.value&&(n.negotiator.parts.billingAddressOption.value=l?"shipping":"custom"),d||await e({legacyFiltering:{include:u,silenceViolations:["non-stock"]},silenceViolations:["non-stock",...S],fieldsToResolve:u})},[e,n.negotiator.parts.shippingAddress,n.negotiator.parts.billingAddress,n.negotiator.parts.billingAddressOption,r,t.user,s])}}export{R as a,J as b,B as c,L as u};

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.