PageSourceSearch

https://www.primary.com/cdn/shopifycloud/checkout-web/assets/c1/b887ec56.DMmbSuA-.js

js primary.com collected 2026-10-01 10:45:18 UTC 15,633 bytes, 1 lines download raw bytes

1import{A as e,T as t,q as o}from"./2c1ab0fe.D_oO1jU7.js";import{G as r,dU as i,dV as a,dW as n,dX as s,dY as c,dZ as u,d_ as d,O as l,f as m,a7 as h,Q as p,P as f,d$ as y,bZ as k,e0 as v,e1 as b,e2 as C,e3 as g,e4 as S}from"./4c290a1e.D9lE9kmU.js";import{eF as A,u as I,e as E,eG as D,eH as T,cz as P,eI as R,eJ as _}from"./164ad2e3.DgUUtBtV.js";import"./app.bDJ3v-8C.js";import"./65f3d4da.8ZfwXSRH.js";import"./60a453ce.BIyixFcg.js";import"./0a7dffce.BMM606kb.js";import"./bb728e1c.BObJOhlA.js";var w=(e=>(e.StartedOrder="Started Order",e.StartedOrderRemote="Started Order Remote",e.StartedOrderOncePerCheckout="Started Order Once Per Checkout",e.StartedOrderOncePerCheckoutRemote="Started Order Once Per Checkout Remote",e.CompletedOrder="Completed Order",e.AddedPayment="Added Payment",e.AddedPaymentRemote="Added Payment Remote",e.CheckoutContactPageStarted="Checkout Contact Step Started",e.CheckoutContactInfoSubmitted="Checkout Contact Info Submitted",e.CheckoutContactInfoSubmittedRemote="Checkout Contact Info Submitted Remote",e.CheckoutAddressInfoSubmitted="Checkout Address Info Submitted",e.CheckoutAddressInfoSubmittedRemote="Checkout Address Info Submitted Remote",e.CheckoutShippingPageStarted="Checkout Shipping Step Started",e.CheckoutShippingInfoSubmitted="Checkout Shipping Info Submitted",e.CheckoutShippingInfoSubmittedRemote="Checkout Shipping Info Submitted Remote",e.CheckoutPaymentPageStarted="Checkout Payment Step Started",e.CheckoutOnePageView="Checkout One Page View",e))(w||{});const M="checkout",N=[i,a,n,s,c,u,d];class O extends Error{constructor(){super(...arguments),this.name="TrekkieError"}}class L{constructor({shop:e,checkoutToken:t="",locale:o,analyticsConfig:i,sourceUrl:a,themeId:n,themeCityHash:s,userEvents:u,s2s:d,monorailRegion:l,getCookie:m},h){if(this.libraryLoaded=!1,this.trekkieLoadedCallback=h,this.analyticsWindow=window,this.tricorder=this.analyticsWindow.ShopifyAnalytics?.lib||this.analyticsWindow.trekkie||[],this.tricorder?.integrations)return this.libraryLoaded=!0,void this.trekkieLoadedCallback(this.analyticsWindow?.ShopifyAnalytics?.lib?.trekkie);const p=parseInt(r(e.id),10),f=N.filter((t=>e.hasFlagEnabled(t))),y=f.includes(c);this.tricorder.ready((()=>{this.libraryLoaded||(this.libraryLoaded=!0,this.shopifyAnalytics={...this.shopifyAnalytics,lib:this.tricorder},this.trekkieLoadedCallback(this.tricorder?.trekkie))})),this.tricorder.load=t=>{if(this.tricorder.config=t,!y){const{assetPath:t,sriHash:o}=e.trekkieLoadConfiguration,r=t&&o,i=document.getElementsByTagName("script")[0],s=document.createElement("script");s.type="text/javascript",s.onerror=function(){const e=document.createElement("script");e.type="text/javascript",e.onerror=function(){const e={schemaId:"trekkie_checkout_load_errors/1.1",payload:{appName:M,shopId:p,themeId:n,contextUrl:window.location.href,sourceUrl:a}};u.monorailEvent(e)},e.async=!0,e.src=a,r&&(e.setAttribute("integrity",o),e.setAttribute("crossorigin","anonymous")),i?.parentNode?.insertBefore(e,i)},s.async=!0,s.src=a,r&&(s.setAttribute("integrity",o),s.setAttribute("crossorigin","anonymous")),i?.parentNode?.insertBefore(s,i)}};const k={appName:M,development:!1,defaultAttributes:{shopId:p,isMerchantRequest:!!m("_ab")||null,themeId:n,themeCityHash:s,contentLanguage:o,currency:e.currencyCode,checkoutToken:t},isServerSideCookieWritingEnabled:!0,enabledBetaFlags:f};l&&(k.monorailRegion=l),this.tricorder.load({Trekkie:k,...i,"Session Attribution":{},S2S:d})}get tricorder(){return this.analyticsWindow?.trekkie}set tricorder(e){if(!this.analyticsWindow)throw new O("AnalyticsWindow is not set.");this.analyticsWindow.trekkie=e}get shopifyAnalytics(){return this.analyticsWindow.ShopifyAnalytics}set shopifyAnalytics(e){if(!this.analyticsWindow)throw new O("AnalyticsWindow is not set.");this.analyticsWindow.ShopifyAnalytics=e}page(e="",t={},o){this.tricorder?.page(e,t,o)}track(e,t,o,r,i){this.tricorder?.track(e,t,o,r,i)}}function W({remoteTotalDetails:e,remoteMerchandiseLinesByShopId:t,emitRemoteEventForShop:o}){if(e)for(const[r,i]of e.perShopRemoteTotals.entries())o(t?{remoteTotals:i,remoteMerchandiseLines:t?.get(r)??[]}:{remoteTotals:i})}function j(e){switch(e){case"/":case"/information":return{title:"Checkout - Contact Information",page:"/checkout/contact_information"};case"/shipping":return{title:"Checkout - Shipping",page:"/checkout/shipping"};case"/payment":return{title:"Checkout - Payment",page:"/checkout/payment"};case"/review":return{title:"Checkout - Review",page:"/checkout/review"};case"/processing":return{title:"Checkout - Processing",page:"/checkout/processing"};case"/thank-you":return{title:"Checkout - Receipt",page:"/checkout/thank_you"};case"/stock-problems":return{title:"Checkout - Stock problems",page:"/checkout/stock_problems"};case"/error":return{title:"Checkout - Error",page:"/checkout/error"};case"/no-address-location":return{title:"Checkout - No Address Location",page:"/checkout/no_address_location"};case"/shoppay_login":return{title:"ShopPay - Login",page:"/shop.app/pay/login"};case"/shoppay":return{title:"ShopPay - Payment",page:"/shop.app/pay/payment"};default:return{title:null,page:null}}}function F(e){const t=e?.map((e=>{const t=e.lineAllocations.reduce(((e,t)=>(t.allocations.filter((e=>
1"code"===e.discountDetails.discount.type)).forEach((t=>{t.amount.amount>e.amount&&(e.amount=t.amount.amount,e.code=t.discountDetails.title)})),e)),{code:void 0,amount:0});return{variantId:b(e.variantId),productId:b(e.productId),productGid:e.productId,category:e.productType,coupon:t.code,currency:e.itemPrice?.currencyCode,name:e.title,price:e.itemPrice?.amount,quantity:e.quantity,brand:e.vendor,variant:e.subtitle,sku:e.sku}}));return t}function x(){const{client:r,observability:i,userEvents:a,environment:n,i18n:{locale:s},shop:c,source:u,checkout:{identity:d}}=l(),M="shopPay"===d.current.value?"trekkie-checkout-one-shop-app":"trekkie-checkout-one",{data:N}=A(),O=N?.session?.activeCheckoutRolloutTreatments?.flatMap((({rolloutId:e,treatmentId:t})=>{const o=m(e),r=m(t);return void 0!==o&&void 0!==r?[{rolloutId:Number(o),treatmentId:Number(r)}]:[]})),x=e(O);x.current=O;const z=u.checkoutSessionIdentifier||u.sourceId;let B=void 0===c.theme?.id||null===c.theme?.id?void 0:parseInt(c.theme.id,10);B&&B>Number.MAX_SAFE_INTEGER&&(B=void 0);const H=c.theme?.cityhash,U=h(),{email:V,phone:G,shippingAddress:q}=p(),$=I(),{value:X}=f().deliveryNext,Z=r.unstable_getSerialization("apiClientId"),J=r.unstable_getSerialization("apiClientId"),{currentPage:Q}=E().value,Y=Q&&["onePage"].includes(Q.id),K=D(),ee=T(),te=e(new WeakSet).current,{value:oe}=y(),re=oe,ie=P(),ae=t((()=>({})),[]),ne=k(),se=o((e=>{e?ne.value?.defaultAttributes!==e?.defaultAttributes&&ne.setValue({defaultAttributes:e?.defaultAttributes}):i.error(new v("Trekkie is not available"))}),[i,ne]),ce=t((()=>{const e=null===H?void 0:H,t=U.current.fields.buyerIdentity.peek(),o={facebookCapiEnabled:c.facebookCapiEnabled,source:M,customerId:b(t?.customerProfile?.id),cartApiClientId:Z,apiClientId:J},i=`${n.services.trekkie.url}/${c.trekkieLoadConfiguration?.assetPath||"s/trekkie.storefront.min.js"}`;return K?null:new L({shop:c,checkoutToken:z,locale:s,analyticsConfig:ae,sourceUrl:i,themeId:B,themeCityHash:e,userEvents:a,monorailRegion:"shop_domain",s2s:o,getCookie:e=>r.cookies.get(e)??null},se)}),[c,z,s,ae,B,H,a,r.cookies,se,U,Z,J,M,K,n.services.trekkie.url]),ue=o((e=>{const{title:t,page:o}=j(e);t&&o&&ie.value&&ce?.page(t,{path:o})}),[ce,ie]),de=o((e=>{const{title:t,page:o}=j(e);if(!t||!o||!ie.value)return;const r={name:t,path:o};ce?.track(w.CheckoutOnePageView,r,void 0,void 0,{shopifyEmitted:!0})}),[ce,ie]),le=t((()=>{let e={amount:void 0,currencyCode:void 0};return $&&"filled"===X?.status&&X.lines.forEach((t=>{if("available"===t.status){const o=t.selectedDeliveryMethodHandle;if(o){const r=t.methods.filter((e=>e.handle===o&&void 0!==e.costAfterDiscounts));e=r.reduce(((e,t)=>{const o=void 0===e.amount?0:e.amount;return e.amount=o+t.costAfterDiscounts.amount,e.currencyCode=t.costAfterDiscounts.currencyCode,e}),e)}}})),e}),[X,$]),me=o((()=>{const e=U.current.fields.merchandiseLines.value,t=U.current.fields.remoteMerchandiseDetails.value;if(ie.value){const o=U.current.fields.subtotal.value,r=U.current.fields.subtotalAfterMerchandiseDiscounts.value,i={step:1,products:F(C(e?.lines??[],t)),currency:o?.currencyCode,revenue:o?.amount,subtotalAfterMerchandiseDiscounts:r?.amount,...x.current?.length?{rolloutIds:x.current.map((e=>Number(e.rolloutId))),rolloutTreatmentIds:x.current.map((e=>Number(e.treatmentId)))}:{}};ce?.track(w.StartedOrder,i,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:U.current.fields.remoteTotalDetails.value,remoteMerchandiseLinesByShopId:g(e?.lines??[],t),emitRemoteEventForShop:({remoteTotals:e,remoteMerchandiseLines:t})=>{const o={step:1,products:t?F(t):[],currency:e?.subtotal?.currencyCode,revenue:e?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:e?.subtotal?.amount};ce?.track(w.StartedOrderRemote,o,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,U,re,ie]),he=o((()=>{const e=U.current.fields.subtotal.value,t=U.current.fields.subtotalAfterMerchandiseDiscounts.value,o=U.current.fields.remoteTotalDetails.value,r=U.current.fields.merchandiseLines.value,i=U.current.fields.remoteMerchandiseDetails.value,a=C(r?.lines??[],i),n=g(r?.lines??[],i);if(ie.value){const o={step:1,products:F(a),currency:e?.currencyCode,revenue:e?.amount,subtotalAfterMerchandiseDiscounts:t?.amount,...x.current?.length?{rolloutIds:x.current.map((e=>Number(e.rolloutId))),rolloutTreatmentIds:x.current.map((e=>Number(e.treatmentId)))}:{}};ce?.track(w.StartedOrderOncePerCheckout,o,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:o,remoteMerchandiseLinesByShopId:n,emitRemoteEventForShop:({remoteTotals:e,remoteMerchandiseLines:t})=>{const o={step:1,products:t?F(t):[],currency:e?.subtotal?.currencyCode,revenue:e?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:e?.subtotal?.amount};ce?.track(w.StartedOrderOncePerCheckoutRemote,o,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,U,re,ie]),pe=o((()=>
1{if(!$)return;if(ee.shouldPrevent())return;if(!ie.value)return;const e=U.current.fields.merchandiseLines.value,t=e?.lines&&F(e?.lines),o=$.purchaseOrder,r=b($.orderIdentity.id),i=r?.toString(),a=o.billingAddress,n=U.current.fields.buyerIdentity.value,s=n?.customerProfile;let c=s?.firstName,u=s?.lastName;u||(c=a?.firstName,u=a?.lastName);const d=U.current.fields.total.value,l=U.current.fields.subtotal.value,m=U.current.fields.subtotalAfterMerchandiseDiscounts.value,h=R(U),p=U.current.fields.contactInfo.value,f=U.current.fields.discountLines.value,y=f?.lines.filter((e=>"code"===e.discount.type)).map((e=>e.discount.title))||[],k=$.analytics?.checkoutCompletedEventId||void 0,v=$.analytics?.emitConversionEvent||!1;ce?.track(w.CompletedOrder,{customerEventData:{customer:{firstName:c,lastName:u,emailAddress:s?.email??p?.email,phoneNumber:s?.phone??p?.phone},address:{city:a?.city,province:a?.zoneCode,country:a?.countryCode,zip:a?.postalCode}},orderId:r,orderName:i,products:t,total:d?.amount??0,currency:d?.currencyCode,revenue:l?.amount??0,subtotalAfterMerchandiseDiscounts:m?.amount??0,coupon:y[0],tax:h?.amount??0,shipping:le.amount??0},k,v,{shopifyEmitted:!0}),ee.markAsEmitted()}),[$,U,ce,le.amount,ee,ie]),fe=o((()=>{const e=U.current.fields.runningTotal.value,t=U.current.fields.subtotalAfterMerchandiseDiscounts.value,o=U.current.fields.remoteTotalDetails.value;if(ie.value){const o={currency:e?.currencyCode,total:e?.amount,subtotalAfterMerchandiseDiscounts:t?.amount};ce?.track(w.AddedPayment,o,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:o,emitRemoteEventForShop:({remoteTotals:e})=>{const t={currency:e?.runningTotal?.currencyCode,total:e?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:e?.subtotal?.amount};ce?.track(w.AddedPaymentRemote,t,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,U,re,ie]),ye=o((()=>
1{if(ie.value){const{title:e,page:t}=j("/information"),o={name:e,path:t};ce?.track(w.CheckoutContactPageStarted,o,void 0,void 0,{shopifyEmitted:!0})}}),[ce,ie]),ke=o((()=>{const e=V.value,t=G.value,o=U.current.fields.subtotalAfterMerchandiseDiscounts.value,r=U.current.fields.remoteTotalDetails.value;if(ie.value){const r={email:e,phone:t,subtotalAfterMerchandiseDiscounts:o?.amount};ce?.track(w.CheckoutContactInfoSubmitted,r,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:r,emitRemoteEventForShop:({remoteTotals:o})=>{const r={email:e,phone:t,subtotalAfterMerchandiseDiscounts:o?.subtotal?.amount};ce?.track(w.CheckoutContactInfoSubmittedRemote,r,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,V,G,U,re,ie]),ve=o((()=>{const e=q.value,t=U.current.fields.subtotalAfterMerchandiseDiscounts.value,o=U.current.fields.remoteTotalDetails.value;if(ie.value){const o={city:e?.city,country:e?.countryCode,phone:e?.phone,province:e?.zoneCode,postalCode:e?.postalCode,firstName:e?.firstName,lastName:e?.lastName,address1:e?.address1,address2:e?.address2,subtotalAfterMerchandiseDiscounts:t?.amount};ce?.track(w.CheckoutAddressInfoSubmitted,o,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:o,emitRemoteEventForShop:({remoteTotals:t})=>{const o={city:e?.city,country:e?.countryCode,phone:e?.phone,province:e?.zoneCode,postalCode:e?.postalCode,firstName:e?.firstName,lastName:e?.lastName,address1:e?.address1,address2:e?.address2,subtotalAfterMerchandiseDiscounts:t?.subtotal?.amount};ce?.track(w.CheckoutAddressInfoSubmittedRemote,o,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,q,U,re,ie]),be=o((()=>{if(!ie.value)return;const{title:e,page:t}=j("/shipping"),o={name:e,path:t};ce?.track(w.CheckoutShippingPageStarted,o,void 0,void 0,{shopifyEmitted:!0})}),[ce,ie]),Ce=o((()=>{const e=U.current.fields.runningTotal.value,t=U.current.fields.subtotalAfterMerchandiseDiscounts.value,o=U.current.fields.remoteTotalDetails.value;if(ie.value){const o={total:e?.amount,currency:e?.currencyCode,subtotalAfterMerchandiseDiscounts:t?.amount};ce?.track(w.CheckoutShippingInfoSubmitted,o,void 0,void 0,{shopifyEmitted:!0})}re&&W({remoteTotalDetails:o,emitRemoteEventForShop:({remoteTotals:e})=>{const t={total:e?.runningTotal?.amount,currency:e?.runningTotal?.currencyCode,subtotalAfterMerchandiseDiscounts:e?.subtotal?.amount};ce?.track(w.CheckoutShippingInfoSubmittedRemote,t,void 0,void 0,{shopifyEmitted:!0})}})}),[ce,U,re,ie]),ge=o((()=>{if(!ie.value)return;const{title:e,page:t}=j("/payment"),o={name:e,path:t};ce?.track(w.CheckoutPaymentPageStarted,o,void 0,void 0,{shopifyEmitted:!0})}),[ce,ie]);_(o((e=>{ne.value.defaultAttributes&&"page_view"===e.type&&ue(e.url)}),[ne,ue])),_(o((e=>{ne.value.defaultAttributes&&"initiate_checkout"===e.type&&me()}),[ne,me])),_(o((e=>{ne.value.defaultAttributes&&"initiate_checkout_once_per_checkout"===e.type&&he()}),[ne,he])),_(o((e=>{ne.value.defaultAttributes&&"complete_checkout"===e.type&&pe()}),[ne,pe])),_(o((e=>{ne.value.defaultAttributes&&"add_payment_info"===e.type&&fe()}),[ne,fe]));const Se=e(!1),Ae=e(void 0),Ie=S(ke,500),Ee=S(ve,500);return _(o((e=>{ne.value.defaultAttributes&&!te.has(e)&&(te.add(e),"one_page_checkout_page_view"===e.type&&(de(e.url),"/"===e.url&&void 0===Ae.current&&(ye(),Se.current=!0)),"section_interaction"===e.type&&Y&&("contact"===e.section?(Se.current&&void 0===Ae.current||ye(),Se.current=!1):"payment"===e.section&&(Ce(),ge()),Ae.current=e.section),"section_complete"===e.type&&("contact"===e.section?Ie():"deliveryAddress"===e.section&&Ee()),"shipping_methods_filled"===e.type&&Y&&be(),"page_submit"!==e.type||"shipping"!==e.page||Y||Ce())}),[ne.value.defaultAttributes,Y,ye,te,de,Ce,ge,Ie,Ee,be])),null}export{x as default};

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.