{
  "version": 3,
  "sources": ["/cdn/shop/t/69/assets/tnf-appbuz-popup.js"],
  "sourcesContent": ["/* tnf-appbuz-popup.js \u2014 App download popup (\"Download Our App / 15% OFF\")\n *\n * What: Floating popup that prompts mobile shoppers to download the TNF native app.\n * Auto-detects iOS vs Android and links to the matching store.\n * Display rules: shows after first visit; hides 4 hours on close; hides 7 days on CTA click.\n *\n * Origin: Restored 2026-04-30 from previous Shopify CDN file\n * (topnutrition21Mar_pa-floater.js?v=1742530987). Renamed for clarity + self-owned\n * in theme assets (no longer a loose CDN file).\n *\n * Internal class names (PAFloater, PAFloaterContainer) and cookie names\n * (PAFLoaterVisitCount, PAFloaterKeepHidden) are intentionally KEPT THE SAME so\n * shoppers who previously dismissed the popup keep their hide state.\n *\n * To edit settings (title, links, timing): edit the `settings:` block below.\n */\nwindow.PAFloater=function(){return{template:`\n              <style>\n              .PAFloater{\n                  width:90vw;\n                  margin:0 auto;\n                  padding:10px 5px;\n                  z-index:111;\n                  background:{bgColor};\n                  border: 1px solid {textColor}30;\n                  border-radius: 10px;\n                  margin-left: 20px !important\n              }\n              .PAFloaterClose{\n                  position: absolute;\n                  right: 3vw;\n                  top: -1.5vw;\n                  border-radius: 50%;\n                  padding: 0;\n                  height: 5vw;\n                  width: 5vw;\n                  line-height: 1;\n                  background: #999;\n                  font-size: 1em;\n                  color: #fff;\n                  border-color: transparent !important;\n                  box-shadow: none !important;\n                  outline: none !important;\n                  cursor:pointer;\n              }\n              .PAFloater img{\n                  width:15vh;\n                  border-radius: 14px !important;\n                  max-width: 60px !important;\n                  max-height: none !important;\n                  margin-top: 10px;\n              }\n              .PAFloaterDetails{\n                  margin:5px;\n              }\n              .PAFloaterTitle{\n                  text-transform:uppercase;\n              }\n              .PAFlexBox{\n                  display: flex;\n                  justify-content:space-around;\n                  align-items:center;\n              }\n              h4.PAFloaterTitle {\n                  text-align: center;\n                  font-size: 12px;\n                  font-weight: 700;\n                  color: #4e4b4b;\n              }\n\n              h5.PABigText {\n                  text-align: center;\n                  font-size: 11px;\n                  color: #000;\n                  font-weight: 200;\n              }\n\n              .PACTA{\n                  background-color: {ctaBgColor};\n                  color: {ctaTextColor};\n                  text-align: center;\n                  text-decoration: none;\n                  padding: 0.8em 1.2em;\n                  border-radius: 10px;\n              }\n              .PAFloater p,h5,h4{\n                  margin:.25em 0;\n              }\n              .PAsub-desc{\n                  text-align: center;\n                  color: #000;\n                  font-weight: 200;\n                  font-size: 11px;\n              }\n              </style>\n              <div style=\"width:100vw;position:fixed;bottom: 10vh;z-index: 111;\" id=\"PAFloaterContainer\">\n                  <div class=\"PAFloater\" style=\"cursor:pointer\" onclick=\"PAFloater.go()\">\n                  <button class=\"PAFloaterClose\" onclick=\"event.stopPropagation();PAFloater.close()\">X</button>\n                  <div class=\"PAFlexBox\">\n                  <img src=\"{thumbnail}\" alt=\"\" />\n                  <div class=\"PAFloaterDetails\">\n                  <h4 class=\"PAFloaterTitle\">{title}</h4>\n                  <h5 class=\"PABigText\">{subtitle}</h5>\n                  <p class=\"PAsub-desc\">\n                  {description}\n                  </p>\n                  </div>\n                  <a id=\"pa-floater-cta\" class=\"PACTA\" href=\"{ctaLink}\" target=\"_blank\" onclick=\"event.stopPropagation();PAFloater.ctaClick()\">{ctaTitle}</a>\n                  </div>\n                  </div>\n                  </div>\n              `,settings:{theme:{bgColor:\"#ffffff\",textColor:\"#000000\"},title:\"Download Our App\",subtitle:\"Get 15% OFF on our app when you allow notifications\",description:\"\",thumbnail:\"https://cdn.shopify.com/s/files/1/1603/2381/files/460x0w.png?v=1735045689\",playstore:\"https://play.google.com/store/apps/details?id=topnutritionandfitness.android.app&pli=1\",appstore:\"https://apps.apple.com/us/app/top-nutrition/id6738488766\",cta:{title:\"GET\",bgColor:\"#000000\",textColor:\"#ffffff\"},display:{minVisitCount:1,hideForHoursOnClose:4,hideForDaysOnCtaClick:7}},init:function(){if(this.settings.linkTo=this.getStore(),this.settings.linkTo){let t=parseInt(this.getCookie(\"PAFLoaterVisitCount\"))||0,e=parseInt(this.getCookie(\"PAFloaterKeepHidden\"))||0;if(t+=1,t>=this.settings.display.minVisitCount&&e==0){let s=this.template.replace(\"{bgColor}\",this.settings.theme.bgColor).replace(\"{thumbnail}\",this.settings.thumbnail).replace(\"{textColor}\",this.settings.theme.textColor).replace(\"{title}\",this.settings.title).replace(\"{subtitle}\",this.settings.subtitle).replace(\"{description}\",this.settings.description).replace(\"{ctaTitle}\",this.settings.cta.title).replace(\"{ctaBgColor}\",this.settings.cta.bgColor).replace(\"{ctaTextColor}\",this.settings.cta.textColor).replace(\"{ctaLink}\",this.settings[this.settings.linkTo]);document.body.insertAdjacentHTML(\"beforeend\",s)}this.setCookie(\"PAFLoaterVisitCount\",t,365)}},setCookie:function(name,value,hours){let expirationTime=new Date;expirationTime.setTime(expirationTime.getTime()+hours*60*60*1e3);let expires=\"expires=\"+expirationTime.toUTCString();document.cookie=name+\"=\"+value+\";\"+expires+\";path=/;\"},getCookie:function(t){for(var e=t+\"=\",s=decodeURIComponent(document.cookie),i=s.split(\";\"),r=0;r<i.length;r++){for(var o=i[r];o.charAt(0)==\" \";)o=o.substring(1);if(o.indexOf(e)==0)return o.substring(e.length,o.length)}return!1},getStore:function(){var t=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(t)?!1:/android/i.test(t)?\"playstore\":/iPad|iPhone|iPod/.test(t)&&!window.MSStream?\"appstore\":!1},close:function(){document.getElementById(\"PAFloaterContainer\").style.display=\"none\",this.setCookie(\"PAFloaterKeepHidden\",1,this.settings.display.hideForHoursOnClose)},ctaClick:function(){this.setCookie(\"PAFloaterKeepHidden\",1,this.settings.display.hideForDaysOnCtaClick*24)},go:function(){this.ctaClick();window.open(this.settings[this.settings.linkTo],\"_blank\")}}}(),PAFloater.init();\n\n/* === GA4 dataLayer events for the popup (added 2026-04-30) ============== */\n/* Wraps PAFloater.close + .ctaClick AFTER init() so the inline onclick=\"\" handlers\n   in the rendered HTML still resolve to the wrapped methods. Fires:\n   - tnf_appbuz_view  \u2192 when popup actually renders to the DOM\n   - tnf_appbuz_close \u2192 when shopper taps the X\n   - tnf_appbuz_cta_click \u2192 when shopper taps GET (links to App Store / Play Store) */\n(function(){\n  try {\n    var dl = function(payload) {\n      try { window.dataLayer = window.dataLayer || []; window.dataLayer.push(payload); } catch(e){}\n    };\n    if (typeof PAFloater === 'undefined') return;\n    var store = (PAFloater.settings && PAFloater.settings.linkTo) || '';\n    /* If popup actually rendered (passed cookie checks), fire view */\n    if (document.getElementById('PAFloaterContainer')) {\n      dl({ event: 'tnf_appbuz_view', store: store });\n    }\n    /* Wrap close */\n    var origClose = PAFloater.close.bind(PAFloater);\n    PAFloater.close = function() {\n      try { dl({ event: 'tnf_appbuz_close', store: (this.settings && this.settings.linkTo) || '' }); } catch(e){}\n      return origClose();\n    };\n    /* Wrap ctaClick */\n    var origCta = PAFloater.ctaClick.bind(PAFloater);\n    PAFloater.ctaClick = function() {\n      try {\n        var s = (this.settings && this.settings.linkTo) || '';\n        var target = (this.settings && s && this.settings[s]) || '';\n        dl({ event: 'tnf_appbuz_cta_click', store: s, target_url: target });\n      } catch(e){}\n      return origCta();\n    };\n  } catch(e){}\n})();\n"],
  "mappings": "AAgBA,OAAO,WAAU,UAAU,CAAC,MAAM,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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