PageSourceSearch

https://us.usm.com/cdn/shopifycloud/checkout-web/assets/c1/DeferredPrivacy.2QpNVaY-.js

js usm.com collected 2026-09-24 17:44:22 UTC 8,378 bytes, 1 lines download raw bytes

1import{T as re,q as m,o as M,j as Y,u as n,e as x,n as z,S as L,f as te,h as ce}from"./esnext-vendor.BBoIVOQW.js";import{X as ie,l as se,L as N,bV as Q,b as le,n as H,k as E,cg as ue,ch as de,P as R,bi as ve,j as A,ci as pe,cj as he,c4 as ye}from"./hydrate.Tsur0pib.js";import{T,a$ as G,ah as V,bE as X,aQ as I,cA as me,bB as fe}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{C as D}from"./Checkbox.dqdh-9I_.js";import{S as ge}from"./Sheet.Dx28vgYD.js";import"./app.CUBUOQtX.js";import"./shared-permissions.DW7FOCqf.js";import"./hooks-useShopPayExternalAppContext.YLtTu3k6.js";const B="privacy-consent-banner",w="privacy_preferences_modal",F="privacy-policy-modal";var h=(e=>(e.Accept="accept",e.Decline="decline",e.AcceptAll="accept_all",e.DeclineAll="decline_all",e.ManagePreferences="manage_preferences",e.Save="save",e.LeavePreferences="leave_preferences",e.PrivacyPolicyView="privacy_policy_view",e.CloseCheckoutBanner="close_checkout_banner",e))(h||{});function U(){const{client:e,consentManager:a,userEvents:o,router:r,shop:s,source:l}=T(),c=r.currentUrl.value,{domain:t,storefrontDomains:v}=s,u=c.searchParams.get("previewPrivacyBanner")==="true",y=l.checkoutSessionIdentifier,d=re(()=>{const i=document.referrer;return v.some(p=>i.includes(p))},[v]),k=m(i=>{u||o.monorailEvent({schemaId:"privacy_banner_interact/1.3",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,visitorRegion:a.getRegion.value,interactionType:i,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,a,t,e.cookies,c.pathname,y,d,o]),f=m(()=>{u||o.monorailEvent({schemaId:"privacy_banner_render/1.2",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,t,e.cookies,c.pathname,y,d,o]),P=m(()=>{u||o.monorailEvent({schemaId:"privacy_banner_initialized/1.1",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,t,e.cookies,c.pathname,y,d,o]);return{emitPrivacyBannerInteractionEvent:k,emitPrivacyBannerRenderEvent:f,emitPrivacyBannerInitializedEvent:P}}const $={id:"76113fc688fe950e2e09d64b5b10df17007abf25436339310e6aeb706bdf5e30",type:"query",name:"PrivacyBannerSettings",source:""},ke=G(({graphql:{coreGraphql:e}},{privacyBannerSettingsSignal:a})=>{const o=e.query($,{cache:!1}),r=M(()=>o.data.value?.privacyBannerSettings);return Y(()=>{r.value&&(a.value=r.value)}),{error:o.error,loading:o.loading,settings:r}});function Pe(){const{i18n:e}=T(),{emitPrivacyBannerInteractionEvent:a}=U(),{privacyBannerSettingsSignal:o}=V().context,{footer:{content:{typography:r}={}}={}}=ie(),s=m(()=>{a(h.ManagePreferences)},[a]),{settings:l,loading:c,error:t}=X(ke,{privacyBannerSettingsSignal:o});if(c.value||!l.value?.enabled)return null;if(t.value)return console.error("Error fetching consent banner data",t.value),null;const v=e.translate("shop_policies.cookie_preferences"),u=n(N,{display:"block",onClick:s,commandFor:w,"aria-haspopup":"dialog",children:v});return r?n(se,{size:r.size,color:r.color,type:r.weight==="bold"?"strong":void 0,children:u}):u}const J=(e,a)=>{a?console.debug(a):e?console.error("Set consent error: ",e):console.error("Set consent error: unknown")},j=async({givenConsent:e,token:a,consentManager:o})=>{await o.setTrackingConsent({analytics:e,marketing:e,preferences:e,storefrontAccessToken:a},J)};function be(e){function a(){c(B),c(w)}const o=x(!1),r=x(!1),s=x(!1),l=x(!0),{hideOverlay:c}=Q(),{emitPrivacyBannerInteractionEvent:t}=U(),{consentManager:v}=T(),u=async({analytics:i,marketing:p,preferences:g})=>{z(()=>{o.value=i,r.value=p,s.value=g}),await v.setTrackingConsent({analytics:i,marketing:p,preferences:g,storefrontAccessToken:e.consentTrackingApiToken},J)},y=m(()=>{t(h.LeavePreferences),l.value=!0},[t,l]),d=m(()=>{if(l.value){const{analytics:i,marketing:p,preferences:g}=v.currentVisitorConsent.value;z(()=>{o.value=i==="yes",r.value=p==="yes",s.value=g==="yes",l.value=!1})}},[o,v,l,r,s]),k=(()=>{const i=[e.bulletPoints?.firstText,e.bulletPoints?.secondText,e.bulletPoints?.thirdText].filter(p=>typeof p=="string");return e.bulletPoints?.enabled&&i.length>0?n(L,{children:[n(le,{blockSize:"base"}),n(H,{level:3,children:e?.bulletPoints?.title}),n(E,{gap:"base",padding:"small-300 none small-300 none",children:n(ue,{children:i.map((p,g)=>n(de,{children:n(R,{children:p})},g))})})]}):null})(),f=n(E,{children:[n(H,{level:3,children:e.introTitle}),n(R,{children:e.introText}),k]}),P=n(E,{gap:"base",children:[n(D,{checked:!0,disabled:!0,label:e.purposes.essentialName,details:e.purposes.essentialDesc}),n(D,{checked:s.value,onChange:i=>{s.value=i},label:e.purposes.preferencesName,details:e.purposes.preferencesDesc}),n(D,{checked:r.value,onChange:i=>{r.value=i},label:e.purposes.marketingName,details:e.purposes.marketingDesc}),n(D,{checked:o.value,onChange:i=>{o.value=i},label:e.purposes.performanceName,details:e.purposes.performanceDesc})]});return n(ve,{id:w,heading:e.title||"",primaryAction:n(A,{variant:"primary",onClick:()=>{u({analytics:o.value,marketing:r.value,preferences:s.value}),t(h.Save),a()},children:e.buttonSaveText}),secondaryActions:n(L,{children:[n(A,{onClick:()=>{u({analytics:!0,marketing:!0,preferences:!0}),t(h.AcceptAll),a()},children:e.buttonAcceptText}),n(A,{onClick:()=>{u({analytics:!1,marketing:!1,preferences:!1}),t(h.DeclineAll),a()},children:e.buttonDeclineText})]}),size:"large",onHide:y,onShow:d,children:n(E,{gap:"base",children:[f,P]})})}function Ce(){const{privacyBannerSettingsSignal:e}
1=V().context,a=e.value;return a?.enabled?n(be,{...a.preferences,consentTrackingApiToken:a.consentTrackingApiToken||void 0}):null}function Ae(e){const a=e.currentVisitorConsent.value;return a.analytics===I.NO_VALUE&&a.marketing===I.NO_VALUE&&a.preferences===I.NO_VALUE}function Te(){const{consentManager:e}=T(),a=pe();return te(()=>a.value?Ae(e):!1)}const _e=G(({graphql:{coreGraphql:e},router:a},{isCheckoutEditor:o,privacyBannerSettingsSignal:r,showPrivacySheet:s})=>{const l=M(()=>a.currentUrl.value.searchParams.get("previewPrivacyBanner")==="true"),c=e.query($,{cache:!1,skip:()=>!s.value&&!l.value||o}),t=M(()=>c.data.value?.privacyBannerSettings);return Y(()=>{t.value&&(r.value=t.value)}),{error:c.error,hidden:M(()=>c.loading.value||o||(!s.value||!t.value?.showBannerOnCheckout)&&!l.value),loading:c.loading,settings:t}});function xe(){const{emitPrivacyBannerInteractionEvent:e,emitPrivacyBannerRenderEvent:a,emitPrivacyBannerInitializedEvent:o}=U();o();const{consentManager:r,embed:s,shop:l}=T(),{localPolicies:c}=me(),t=he(),v=Te(),{hideOverlay:u}=Q(),{privacyBannerSettingsSignal:y}=V().context,{settings:d,loading:k,error:f,hidden:P}=X(_e,{isCheckoutEditor:t,privacyBannerSettingsSignal:y,showPrivacySheet:v}),i=m(()=>{e(h.CloseCheckoutBanner)},[e]),p=m(()=>{e(h.PrivacyPolicyView)},[e]),g=m(()=>{e(h.ManagePreferences)},[e]);if(ce(()=>{k.value||!v.value||f.value||!d.value?.showBannerOnCheckout||a()},[a,k.value,v.value,f.value,d.value]),P.value)return null;if(f.value||!d.value)return console.error("Error fetching consent banner data",f.value),null;const{title:K,text:W,policyLinkUrl:b,policyLinkText:O,buttonAcceptText:Z,buttonDeclineText:ee,buttonPrefsOpenText:ne}=d.value,q=d.value.consentTrackingApiToken||void 0,C=b.includes("/policies/"),_=C&&fe(s?.embedder),S=b.split("/").pop()||"privacy-policy",ae=c.find(oe=>oe.handle===S)??{shopName:l.name,shopId:l.id,handle:S,url:b,squareLogo:l.brandSettings?.squareLogo,name:O};return n(L,{children:[n(ge,{defaultOpen:!0,id:B,heading:K||"",onHide:i,primaryAction:n(L,{children:[n(A,{onClick:()=>{j({givenConsent:!0,token:q,consentManager:r}),e(h.Accept),u(B)},children:Z}),n(A,{onClick:()=>{j({givenConsent:!1,token:q,consentManager:r}),e(h.Decline),u(B)},children:ee})]}),secondaryActions:n(N,{textDecoration:"none",onClick:g,commandFor:w,"aria-haspopup":"dialog",children:ne}),children:n(R,{tone:"info",type:"small",children:[W,n(N,{href:C?void 0:b,target:C?void 0:"_blank",onClick:()=>{p(),_&&s?.client?.windowOpenRequest(b)},..._&&{"aria-haspopup":"dialog"},...C&&!_&&{commandFor:F},children:O})]})}),C&&!_&&n(ye,{heading:O,defaultPolicy:ae,id:F},S)]})}const Re={PrivacyPreferencesFooterLink:Pe,PrivacyPreferences:Ce,PrivacySheet:xe};export{Re as deferredPrivacyComponents};

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.