1import{s as e}from"./2c1ab0fe.GMbxnz74.js";import{ar as r,as as o,at as t,au as s,av as n,S as a,aw as i,ax as u}from"./4c290a1e.DMQ9xOwP.js";import{u as l}from"./0a7dffce.BcNpdEJk.js";const d=/\.(shop\.dev|shop\.test|tunnel\.shopifycloud\.tech)$/,c=/-prod\.tunnel\.shopifycloud\.tech$/,p=[75664294112,62390304886,85847245104,86752461117,58033635374,66379940012,70551503014,70463455488,93853155640,80263414008,69293637654];function h(e){const a=function(){const e=n();return e?e&&p.includes(e)?String(e):"other":void 0}();return{flow_version:s()?"iframe":"popup",...a&&{shopId:a},debugMode:!(!/debug=yes/.test(window.location.href)&&!/debug=true/.test(window.location.href)&&!/debug=1/.test(window.location.href)&&(/debug=no/.test(window.location.href)||/debug=false/.test(window.location.href)||/debug=0/.test(window.location.href)||!function(){if("undefined"==typeof window)return!1;const e=window.location.host;return d.test(e)&&!c.test(e)}())),os:t(),browser:o().name,entrypoint:r,...e&&{client_source:e}}}const f={shippingAddressError:"$.cart.deliveryGroups[0].deliveryAddress",discountCodeError:void 0,generalError:"$.cart"};function v({breadcrumbPrefix:r,isApplePay:o=!1}){const{observability:t,source:s,i18n:n,checkout:{identity:i,validation:u},shopPay:l}=a(),d="simulated"===s.type,c="shopPay"===i.current.value&&!l?.user.phoneNumber.value?.trim(),p=e(()=>{const e=u.missingFields.phone.isValid.value;if(!e){const e=u.missingFields.phone.input.value;u.missingFields.phone.error.value=e?n.translate("field_errors.shipping_line_phone_invalid"):n.translate("field_errors.phone_blank")}return e},[u,n]);return e(()=>d?(t.leaveErrorBreadcrumb(`${r} - simulated`),!1):c&&o&&!p()?(t.leaveErrorBreadcrumb(`${r} - requires phone`),!1):(t.leaveErrorBreadcrumb(r),!0),[r,t,d,c,o,p])}function m(){const{userEvents:r,source:o,checkout:t,shop:s}=a(),n=function(){const{observability:r,source:o}=a(),t="shopPayExternal"===o.type,s=i(),n=l();return e(()=>{if(!t)return;let e=!1,o=!1;for(const r of s.validationErrors.value)r.target===f.generalError?e=!0:r.target===f.shippingAddressError&&(o=!0);(e||o)&&r.counter({name:"shop_pay_external_checkout_with_address_errors",value:1,attributes:{hasGeneralError:e,hasDeliveryAddressError:o,...h(n?.clientSource)}})},[t,n?.clientSource,r,s.validationErrors])}();return e(()=>{n(),r.monorailEvent({schemaId:"shopify_pay_payment_page_pay_now/2.1",payload:{...u(o,t,s),clientTimestampMs:Date.now()}})},[r,o,t,s,n])}Object.values(f).filter(Boolean);export{v as a,m 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.