PageSourceSearch

https://legendmemory.ai/cdn/shopifycloud/checkout-web/assets/c1/2b89a178.BdhJmmWU.js

js legendmemory.ai collected 2026-10-05 12:11:57 UTC 4,957 bytes, 1 lines download raw bytes

1import{g as e,k as s,s as a,T as n,q as r}from"./2c1ab0fe.XVnTovwp.js";import{a as i,ba as l,bb as o,bc as t,b3 as d,bd as u,al as p,O as c}from"./f67abd2c.DYpmk7mw.js";import{S as v}from"./f1968089.C2bDJU-A.js";import{bE as h,bF as g}from"./164ad2e3.hrg71Gqs.js";import{u as m}from"./bf513f9c.CtAeu42z.js";const y={eligible:!1,nonEligibleReason:"SHOP_CASH_NOT_AVAILABLE",serverConfirmed:!0},b={eligible:!0,nonEligibleReason:null,serverConfirmed:!1};function A(){const{shopPay:e,checkout:n}=i(),r=m(),d=s(()=>{if(!n.isShippingRequired.value)return{address:null,isShopPayVaultAddress:!1};const s=e.session.selectedShippingAddress.value;return s?.address?{address:s.address,isShopPayVaultAddress:!0}:{address:n.negotiator.parts.shippingAddress.value,isShopPayVaultAddress:!1}}),u=s(()=>{const s=e.session.selectedPaymentMethod.value,a=!n.negotiator.parts.paymentLines.value.some(e=>!l(e))&&null!=s&&o(s);return("APPLE_PAY"===r.value||a)&&null!=d.value.address}),p=s(()=>{const s=e.session.selectedPaymentMethod.value;if(u.value&&d.value.address){const s=d.value.address,a=s.phone||n.negotiator.parts.billingAddress.value.phone||e.user.phoneNumber.value;return{address:a&&a!==s.phone?{...s,phone:a}:s,isShopPayVaultAddress:d.value.isShopPayVaultAddress}}const a=t(s);if(a){const e=a.billingAddress.address;return{address:e.phone?e:{...e,phone:n.negotiator.parts.billingAddress.value.phone},isShopPayVaultAddress:!0}}const r=e.session.selectedBillingAddress.value;return r?.address?{address:r.address,isShopPayVaultAddress:!0}:"shipping"===n.negotiator.parts.billingAddressOption.value&&d.value.address?d.value:{address:n.negotiator.parts.billingAddress.value,isShopPayVaultAddress:!1}}),c=a(h(d.value.address?.countryCode,void 0,n.configuration.addressSettings.nonBillingAddressSettings.value,d.value.isShopPayVaultAddress?null:void 0)),v=a(h(p.value.address.countryCode,void 0,n.configuration.addressSettings.billingAddressSettings.value,p.value.isShopPayVaultAddress?null:void 0));return s(()=>{const e=d.value.address,s=p.value.address,a=e?c.value(e,"shipping"):new Map,n=v.value(s,"billing");return{selectedBillingAddress:s,selectedShippingAddress:e,isUsingApplePayShippingFallback:u.value,billingAddressErrors:n,shippingAddressErrors:a}})}function f({requiresAvailableBalance:a=!0}={}){const n=function({requiresAvailableBalance:a=!0}={}){const{checkout:{negotiator:n}}=i(),r=n.current.fields.shopCashBalance,l=e(null);return s(()=>{const e=r.value;if("filled"===e?.status){const s={eligible:e.eligible,nonEligibleReason:e.eligible?null:e.nonEligibleReason??"SHOP_CASH_NOT_AVAILABLE",serverConfirmed:!0};return l.current=s,s}return"unavailable"===e?.status&&a?(l.current=y,y):l.current?{...l.current,serverConfirmed:!1}:b})}({requiresAvailableBalance:a}),{checkout:{negotiator:r}}=i(),l=r.current.fields.deliveryNext,o=d("deliveryNext"),t=A();return s(()=>{const{nonEligibleReason:e,serverConfirmed:s}=n.value,a=l.value,r=o.value,{selectedShippingAddress:i,shippingAddressErrors:d,billingAddressErrors:u}=t.value,p=u.size>0,c=d.size>0||i&&!r&&"unavailable"===a?.status;let h=null;return e?h=e:c?h=v.ShopCashInvalidShippingAddress:p&&(h=v.ShopCashInvalidBillingAddress),{eligible:null==h,nonEligibleReason:h,serverConfirmed:s}})}const _=e=>(e=>"amount"in e&&"string"==typeof e.amount)(e)?{amount:Number(e.amount),currencyCode:e.currencyCode}:{amount:Number(e.value),currencyCode:e.currency},S=e=>{if(!e)return null;const s=_(e);return(e=>Boolean(e.amount&&!isNaN(e.amount)&&e.amount>0&&e.currencyCode&&Boolean(u[e.currencyCode])))(s)?s:null},E=()=>{const{userEvents:e,source:s,checkout:a,shop:l,shopPay:o}=i(),t=o.user.publicId.value,d=n(()=>({publicId:t}),[t]),u=r(n=>e.monorailEvent({schemaId:"shopify_pay_payment_page_shop_cash_redemption_visibility/1.1",payload:{...p(s,a,l),...d,...n}}),[e,s,a,l,d]),c=r(n=>e.monorailEvent({schemaId:"shopify_pay_payment_page_shop_cash_redemption_eligibility/3.1",payload:{...p(s,a,l),...d,...n}}),[e,s,a,l,d]);return{recordRedemptionActionEvent:r(n=>e.monorailEvent({schemaId:"shopify_pay_payment_page_shop_cash_redemption_actions/1.0",payload:{...p(s,a,l),...d,...n}}),[e,s,a,l,d]),recordRedemptionVisibilityEvent:u,recordRedemptionEligibilityEvent:c,recordRewardEligibilityEvent:r(n=>e.monorailEvent({schemaId:"shopify_pay_payment_page_shop_cash_reward_eligibility/5.1",payload:{...p(s,a,l),...d,...n}}),[e,s,a,l,d]),recordUiInteractionEvent:r(n=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...p(s,a,l),...n}}),[e,s,a,l])}};function P(){const{checkout:e,shopPay:a}=i(),n=g();return s(()=>
1{if(!e.installments.isSupported.value)return{spiPreselected:!1,preselectionReason:void 0};const s=[];n.value&&s.push(c.PointOfSale),a.config.shouldPreSelectInstallments&&s.push(c.SpiBanner);const r=a.user.installments.preselectReason.value;r&&s.push(r);const i=s.length>0;return{spiPreselected:i,preselectionReason:i?s.join(","):void 0}})}export{S as a,f as b,P as c,A as d,_ as t,E 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.