var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}var window = _____WB$wombat$assign$function_____("window");
var self = _____WB$wombat$assign$function_____("self");
var document = _____WB$wombat$assign$function_____("document");
var location = _____WB$wombat$assign$function_____("location");
var top = _____WB$wombat$assign$function_____("top");
var parent = _____WB$wombat$assign$function_____("parent");
var frames = _____WB$wombat$assign$function_____("frames");
var opener = _____WB$wombat$assign$function_____("opener");
import{au as f,av as m,aw as x,ax as T,ay as w,az as E,aA as D,a7 as I,a as e,aB as u,z as H,aC as O,aD as U,aE as L,G as M}from"./app.ZXowmuNl.js";import{u as z,P as y,B as r,a as N,s as P,b as R}from"./FooterLinks.BZ1g4IRt.js";function V(){const n=w();return n.analytics===""&&n.marketing===""&&n.preferences===""}function _(){const n=f(),a=m(n);return x()&&!a&&T()&&V()}function q(){const{emitPrivacyBannerInteractionEvent:n,emitPrivacyBannerRenderEvent:a,emitPrivacyBannerInitializedEvent:p}=z();p();const d=f().searchParams.get("previewPrivacyBanner")==="true",i=_(),{closeOverlay:v}=E(),{data:t,loading:o,error:c}=D(R,{cache:!1,skip:!i&&!d});if(I(()=>{o||!i||c||!t?.privacyBannerSettings||!t?.privacyBannerSettings?.showBannerOnCheckout||a()},[a,o,i,c,t]),o||(!i||!t?.privacyBannerSettings?.showBannerOnCheckout)&&!d)return null;if(c||!t?.privacyBannerSettings)return console.error("Error fetching consent banner data",c),null;const{title:g,text:k,policyLinkUrl:s,policyLinkText:h,buttonAcceptText:b,buttonDeclineText:S,buttonPrefsOpenText:A}=t.privacyBannerSettings,l=t.privacyBannerSettings.consentTrackingApiToken||void 0,B=s.includes("/policies/"),C=s.split("/").pop();return e(L,{defaultOpen:!0,id:y,heading:g||"",onHide:()=>{n(r.CloseCheckoutBanner)},primaryAction:e(M,{children:[e(u,{onClick:()=>{P(!0,l),n(r.Accept),v(y)},children:b}),e(u,{onClick:()=>{P(!1,l),n(r.Decline),v(y)},children:S})]}),secondaryAction:e(u,{variant:"plain",textDecoration:"none",onClick:()=>{n(r.ManagePreferences)},overlay:e(N,{...t.privacyBannerSettings.preferences,consentTrackingApiToken:l}),children:A}),children:e(H,{tone:"info",type:"small",children:[k,e(O,{href:B?void 0:s,target:"_blank",onClick:()=>{n(r.PrivacyPolicyView)},overlay:B?e(U,{handle:C||"privacy-policy",title:h}):void 0,children:h})]})})}export{q as default};