1import{q as e}from"./2c1ab0fe.RaLGJvq2.js";import{ah as r,ai as o,aj as t,ak as n,a as s,al as i}from"./f67abd2c.BTHhdhoM.js";import{a}from"./24773686.DFsBOEme.js";import{g as u}from"./9dba8418.DCzpk36x.js";const l=/\.(shop\.dev|shop\.test|tunnel\.shopifycloud\.tech)$/,d=/-prod\.tunnel\.shopifycloud\.tech$/,c=[75664294112,62390304886,85847245104,86752461117,58033635374,66379940012,70551503014,70463455488,93853155640,80263414008,69293637654];function p(e){const s=function(){const e=u();return e?e&&c.includes(e)?String(e):"other":void 0}();return{flow_version:n()?"iframe":"popup",...s&&{shopId:s},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 l.test(e)&&!d.test(e)}())),os:t(),browser:o().name,entrypoint:r,...e&&{client_source:e}}}const h={shippingAddressError:"$.cart.deliveryGroups[0].deliveryAddress",discountCodeError:void 0,generalError:"$.cart"};function f({breadcrumbPrefix:r,isApplePay:o=!1}){const{observability:t,source:n,i18n:i,checkout:{identity:a,validation:u},shopPay:l}=s(),d="simulated"===n.type,c="shopPay"===a.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?i.translate("field_errors.shipping_line_phone_invalid"):i.translate("field_errors.phone_blank")}return e},[u,i]);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:n}=s(),u=function(){const{observability:r,source:o,checkout:{negotiator:t}}=s(),n="shopPayExternal"===o.type,i=a();return e(()=>{if(!n)return;let e=!1,o=!1;for(const r of t.validationErrors.value)r.target===h.generalError?e=!0:r.target===h.shippingAddressError&&(o=!0);(e||o)&&r.counter({name:"shop_pay_external_checkout_with_address_errors",value:1,attributes:{hasGeneralError:e,hasDeliveryAddressError:o,...p(i?.clientSource)}})},[n,i?.clientSource,r,t.validationErrors])}();return e(()=>{u(),r.monorailEvent({schemaId:"shopify_pay_payment_page_pay_now/2.1",payload:{...i(o,t,n),clientTimestampMs:Date.now()}})},[r,o,t,n,u])}Object.values(h).filter(Boolean);export{f 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.