(self.webpackChunk_klaviyo_onsite_modules=self.webpackChunk_klaviyo_onsite_modules||[]).push([[377],{24364:function(t,e,i){"use strict";e.Z=({tracking:t})=>{var e;const o=t?"https://static-tracking.klaviyo.com/onsite/js/":"https://static.klaviyo.com/onsite/js/",n=null==(e=window.klaviyoModulesObject)?void 0:e.assetSource;i.p=n?`${o}${n}`:o}},53904:function(t,e,i){"use strict";var o=i(24364);i(78991),i(24570),i(26650);function n(t,e,i,o,n,r,s){this.doc=t||document,this.nav=e||navigator,this.scr=i||window.screen,this.win=o||window,this.loc=n||this.doc.location,this.top=r||window.top,this.parent=s||window.parent}n.prototype.getDocument=function(){return this.doc},n.prototype.getNavigator=function(){return this.nav},n.prototype.getScreen=function(){return this.scr},n.prototype.getWindow=function(){return this.win},n.prototype.getLocation=function(){return this.loc},n.prototype.getProtocol=function(){return"https:"===this.loc.protocol?"https://":"http://"},n.prototype.getHostName=function(){return this.loc.hostname},n.prototype.getTop=function(){return this.top},n.prototype.getParent=function(){return this.parent},n.prototype.getReferrer=function(){let t="";try{t=this.top.document.referrer}catch(e){if(window.parent)try{t=this.parent.document.referrer}catch(e){t=""}}return""===t&&(t=this.doc.referrer),t},n.prototype.getCharacterSet=function(){return this.doc.characterSet||this.doc.charset||""},n.prototype.getLanguage=function(){return this.nav.language||this.nav.browserLanguage||""};var r=i(87100),s=i(44050);const a={};function c(t){return void 0===t}function d(t){return-1===[void 0,null,"undefined","null",""].indexOf(t)}function l(t,e){return hasOwnProperty.call(t,e)}function u(t,e,i){if(null!=t)if(t.forEach)t.forEach(e,i);else if(t.length===+t.length){for(let o=0,n=t.length;ot===e))}function g(t){return`${(s.Jk.settings.debug?"http://":(new n).getProtocol())+s.Jk.settings.analyticsAPIHost}/${t}`}function m(){let t=(new Date).getTime();const e=(new n).getWindow();e.performance&&"function"==typeof e.performance.now&&(t+=performance.now());return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))}function b(){return Math.round(new Date/1e3)}function _(t,...e){"function"==typeof t&&t(...e)}function w(t,e,i=0,o,n){const r=n||0;return t().then((n=>{return(o?-1!==o.indexOf(n.status):n.status>=400)&&rsetTimeout(t,s)))).then((()=>w(t,e,i,o,r+1))):n;var s})).catch((()=>t()))}const k=({metricGroup:t,events:e,companyId:i,sample:o=1})=>Math.random()<=o?(0,r.Z)(`${s.bl.url}/onsite/track-analytics?company_id=${i}`,{method:"POST",mode:"no-cors",body:JSON.stringify({metric_group:t,events:e}),headers:{"Content-Type":"application/json",accept:"application/json"}}):Promise.resolve(),v=()=>{const t=window.navigator.userAgent;return t.toLowerCase().includes("musical_ly")||t.toLowerCase().includes("bytedance")},S=({companyId:t,eventDetails:e,account:i})=>{var o;k({metricGroup:"onsite",companyId:t,events:[{metric:"tikTokInAppBrowser",log_to_statsd:!0,log_to_s3:!0,log_to_metrics_service:!1,event_details:Object.assign({},e,{klKey:window.__klKey,klaviyoModulesObject:null==(o=window.klaviyoModulesObject)?void 0:o.companyId,account:i,pageUrl:window.location.href})}]})};function I(t){this.context=t||new n,this.cookies=[]}function x(t){this.context=t||new n,this.is_available=!1;const e="_kla_test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),this.is_available=!0,this.is_available}catch(t){}}I.prototype.set=function(t,e,i={}){let o;i.minsToExpire?(o=new Date,o.setTime(o.getTime()+1e3*i.minsToExpire*60)):i.daysToExpire&&(o=new Date,o.setTime(o.getTime()+864e5*i.daysToExpire)),this._set(t,i.alreadyEncoded?e:function(t,e){const i=encodeURIComponent;return i instanceof Function?e?encodeURI(t):i(t):escape(t)}(e,!0),`${c(o)?"":`;expires=${o.toGMTString()}`};path=${i.path?i.path:"/"}${i.domain?`;domain=${i.domain}`:""}${i.secure?";secure":""}`)},I.prototype._set=function(t,e,i){this.context.getDocument().cookie=`${t}=${e}${i}`,this.cookies.push({name:t,value:e,extras:i})},I.prototype.get=function(t){const e=new RegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(this.context.getDocument().cookie);return e?function(t,e){const i=decodeURIComponent;let o;if(t=t.split("+").join(" "),i instanceof Function)try{o=e?decodeURI(t):i(t)}catch(e){o=unescape(t)}else o=unescape(t);return o}(e[2],!0):""},I.prototype.del=function(t,e={}){e.daysToExpire=-1,this.get(t)&&this.set(t,"",e)},I.prototype.has=function(){const t="__l_testcookie";return c(this.context.getNavigator().cookieEnabled)?this.context.getNavigator().cookieEnabled?"1":"0":(this.set(t,"1"),"1"===this.get(t)?"1":"0")},x.prototype.set=function(t,e){return!!this.is_available&&(localStorage.setItem(t,e),!0)},x.prototype.get=function(t){if(this.is_available)return localStorage.getItem(t)},x.prototype.del=function(t){return!!this.is_available&&(localStorage.removeItem(t),!0)};var C=i(2116),B=i.n(C);i(22923),i(3545),i(19986),i(56816);const $={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,i,o,n,r,s,a,c="",d=0;for(t=$._utf8_encode(t);d>2,r=(3&e)<<4|(i=t.charCodeAt(d++))>>4,s=(15&i)<<2|(o=t.charCodeAt(d++))>>6,a=63&o,isNaN(i)?s=a=64:isNaN(o)&&(a=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(s)+this._keyStr.charAt(a);return c},decode:function(t){var e,i,o,n,r,s,a="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&n)<<4|(r=this._keyStr.indexOf(t.charAt(c++)))>>2,o=(3&r)<<6|(s=this._keyStr.indexOf(t.charAt(c++))),a+=String.fromCharCode(e),64!=r&&(a+=String.fromCharCode(i)),64!=s&&(a+=String.fromCharCode(o));return a=$._utf8_decode(a)},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i127&&o<2048?(e+=String.fromCharCode(o>>6|192),e+=String.fromCharCode(63&o|128)):(e+=String.fromCharCode(o>>12|224),e+=String.fromCharCode(o>>6&63|128),e+=String.fromCharCode(63&o|128))}return e},_utf8_decode:function(t){for(var e="",i=0,o=0,n=o;i191&&o<224?(n=t.charCodeAt(i+1),e+=String.fromCharCode((31&o)<<6|63&n),i+=2):(n=t.charCodeAt(i+1),c3=t.charCodeAt(i+2),e+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&c3),i+=3);return e}};var A=$,O=["Googlebot\\/","Googlebot-Mobile","Googlebot-Image","Googlebot-News","Googlebot-Video","AdsBot-Google([^-]|$)","AdsBot-Google-Mobile","Feedfetcher-Google","Mediapartners-Google","Mediapartners \\(Googlebot\\)","APIs-Google","bingbot","Slurp","[wW]get","LinkedInBot","Python-urllib","python-requests","aiohttp","httpx","libwww-perl","httpunit","nutch","Go-http-client","phpcrawl","msnbot","jyxobot","FAST-WebCrawler","FAST Enterprise Crawler","BIGLOTRON","Teoma","convera","seekbot","Gigabot","Gigablast","exabot","ia_archiver","GingerCrawler","webmon ","HTTrack","grub.org","UsineNouvelleCrawler","antibot","netresearchserver","speedy","fluffy","findlink","msrbot","panscient","yacybot","AISearchBot","ips-agent","tagoobot","MJ12bot","woriobot","yanga","buzzbot","mlbot","YandexBot","YandexImages","YandexAccessibilityBot","YandexMobileBot","YandexMetrika","YandexTurbo","YandexImageResizer","YandexVideo","YandexAdNet","YandexBlogs","YandexCalendar","YandexDirect","YandexFavicons","YaDirectFetcher","YandexForDomain","YandexMarket","YandexMedia","YandexMobileScreenShotBot","YandexNews","YandexOntoDB","YandexPagechecker","YandexPartner","YandexRCA","YandexSearchShop","YandexSitelinks","YandexSpravBot","YandexTracker","YandexVertis","YandexVerticals","YandexWebmaster","YandexScreenshotBot","purebot","Linguee Bot","CyberPatrol","voilabot","Baiduspider","citeseerxbot","spbot","twengabot","postrank","TurnitinBot","scribdbot","page2rss","sitebot","linkdex","Adidxbot","ezooms","dotbot","Mail.RU_Bot","discobot","heritrix","findthatfile","europarchive.org","NerdByNature.Bot","sistrix crawler","Ahrefs(Bot|SiteAudit)","fuelbot","CrunchBot","IndeedBot","mappydata","woobot","ZoominfoBot","PrivacyAwareBot","Multiviewbot","SWIMGBot","Grobbot","eright","Apercite","semanticbot","Aboundex","domaincrawler","wbsearchbot","summify","CCBot","edisterbot","seznambot","ec2linkfinder","gslfbot","aiHitBot","intelium_bot","facebookexternalhit","Yeti","RetrevoPageAnalyzer","lb-spider","Sogou","lssbot","careerbot","wotbox","wocbot","ichiro","DuckDuckBot","lssrocketcrawler","drupact","webcompanycrawler","acoonbot","openindexspider","gnam gnam spider","web-archive-net.com.bot","backlinkcrawler","coccoc","integromedb","content crawler spider","toplistbot","it2media-domain-crawler","ip-web-crawler.com","siteexplorer.info","elisabot","proximic","changedetection","arabot","WeSEE:Search","niki-bot","CrystalSemanticsBot","rogerbot","360Spider","psbot","InterfaxScanBot","CC Metadata Scaper","g00g1e.net","GrapeshotCrawler","urlappendbot","brainobot","fr-crawler","binlar","SimpleCrawler","Twitterbot","cXensebot","smtbot","bnf.fr_bot","A6-Indexer","ADmantX","Facebot","OrangeBot\\/","memorybot","AdvBot","MegaIndex","SemanticScholarBot","ltx71","nerdybot","xovibot","BUbiNG","Qwantify","archive.org_bot","Applebot","TweetmemeBot","crawler4j","findxbot","S[eE][mM]rushBot","yoozBot","lipperhey","Y!J","Domain Re-Animator Bot","AddThis","Screaming Frog SEO Spider","MetaURI","Scrapy","Livelap[bB]ot","OpenHoseBot","CapsuleChecker","collection@infegy.com","IstellaBot","DeuSu\\/","betaBot","Cliqzbot\\/","MojeekBot\\/","netEstate NE Crawler","SafeSearch microdata crawler","Gluten Free Crawler\\/","Sonic","Sysomos","Trove","deadlinkchecker","Slack-ImgProxy","Embedly","RankActiveLinkBot","iskanie","SafeDNSBot","SkypeUriPreview","Veoozbot","Slackbot","redditbot","datagnionbot","Google-Adwords-Instant","adbeat_bot","WhatsApp","contxbot","pinterest.com.bot","electricmonk","GarlikCrawler","BingPreview\\/","vebidoobot","FemtosearchBot","Yahoo Link Preview","MetaJobBot","DomainStatsBot","mindUpBot","Daum\\/","Jugendschutzprogramm-Crawler","Xenu Link Sleuth","Pcore-HTTP","moatbot","KosmioBot","[pP]ingdom","AppInsights","PhantomJS","Gowikibot","PiplBot","Discordbot","TelegramBot","Jetslide","newsharecounts","James BOT","Bark[rR]owler","TinEye","SocialRankIOBot","trendictionbot","Ocarinabot","epicbot","Primalbot","DuckDuckGo-Favicons-Bot","GnowitNewsbot","Leikibot","LinkArchiver","YaK\\/","PaperLiBot","Digg Deeper","dcrawl","Snacktory","AndersPinkBot","Fyrebot","EveryoneSocialBot","Mediatoolkitbot","Luminator-robots","ExtLinksBot","SurveyBot","NING\\/","okhttp","Nuzzel","omgili","PocketParser","YisouSpider","um-LN","ToutiaoSpider","MuckRack","Jamie's Spider","AHC\\/","NetcraftSurveyAgent","Laserlikebot","^Apache-HttpClient","AppEngine-Google","Jetty","Upflow","Thinklab","Traackr.com","Twurly","Mastodon","http_get","DnyzBot","botify","007ac9 Crawler","BehloolBot","BrandVerity","check_http","BDCbot","ZumBot","EZID","ICC-Crawler","ArchiveBot","^LCC ","filterdb.iss.net\\/crawler","BLP_bbot","BomboraBot","Buck\\/","Companybook-Crawler","Genieo","magpie-crawler","MeltwaterNews","Moreover","newspaper\\/","ScoutJet","(^| )sentry\\/","StorygizeBot","UptimeRobot","OutclicksBot","seoscanners","Hatena","Google Web Preview","MauiBot","AlphaBot","SBL-BOT","IAS crawler","adscanner","Netvibes","acapbot","Baidu-YunGuanCe","bitlybot","blogmuraBot","Bot.AraTurka.com","bot-pge.chlooe.com","BoxcarBot","BTWebClient","ContextAd Bot","Digincore bot","Disqus","Feedly","Fetch\\/","Fever","Flamingo_SearchEngine","FlipboardProxy","g2reader-bot","G2 Web Services","imrbot","K7MLWCBot","Kemvibot","Landau-Media-Spider","linkapediabot","vkShare","Siteimprove.com","BLEXBot\\/","DareBoost","ZuperlistBot\\/","Miniflux\\/","Feedspot","Diffbot\\/","SEOkicks","tracemyfile","Nimbostratus-Bot","zgrab","PR-CY.RU","AdsTxtCrawler","Datafeedwatch","Zabbix","TangibleeBot","google-xrawler","axios","Amazon CloudFront","Pulsepoint","CloudFlare-AlwaysOnline","Google-Structured-Data-Testing-Tool","WordupInfoSearch","WebDataStats","HttpUrlConnection","Seekport Crawler","ZoomBot","VelenPublicWebCrawler","MoodleBot","jpg-newsbot","outbrain","W3C_Validator","Validator\\.nu","W3C-checklink","W3C-mobileOK","W3C_I18n-Checker","FeedValidator","W3C_CSS_Validator","W3C_Unicorn","Google-PhysicalWeb","Blackboard","ICBot\\/","BazQux","Twingly","Rivva","Experibot","awesomecrawler","Dataprovider.com","GroupHigh\\/","theoldreader.com","AnyEvent","Uptimebot\\.org","Nmap Scripting Engine","2ip.ru","Clickagy","Caliperbot","MBCrawler","online-webceo-bot","B2B Bot","AddSearchBot","Google Favicon","HubSpot","Chrome-Lighthouse","HeadlessChrome","CheckMarkNetwork\\/","www\\.uptime\\.com","Streamline3Bot\\/","serpstatbot\\/","MixnodeCache\\/","^curl","SimpleScraper","RSSingBot","Jooblebot","fedoraplanet","Friendica","NextCloud","Tiny Tiny RSS","RegionStuttgartBot","Bytespider","Datanyze","Google-Site-Verification","TrendsmapResolver","tweetedtimes","NTENTbot","Gwene","SimplePie","SearchAtlas","Superfeedr","feedbot","UT-Dorkbot","Amazonbot","SerendeputyBot","Eyeotabot","officestorebot","Neticle Crawler","SurdotlyBot","LinkisBot","AwarioSmartBot","AwarioRssBot","RyteBot","FreeWebMonitoring SiteChecker","AspiegelBot","NAVER Blog Rssbot","zenback bot","SentiBot","Domains Project\\/","Pandalytics","VKRobot","bidswitchbot","tigerbot","NIXStatsbot","Atom Feed Robot","Curebot","PagePeeker\\/","Vigil\\/","rssbot\\/","startmebot\\/","JobboerseBot","seewithkids","NINJA bot","Cutbot","BublupBot","BrandONbot","RidderBot","Taboolabot","Dubbotbot","FindITAnswersbot","infoobot","Refindbot","BlogTraffic\\/\\d\\.\\d+ Feed-Fetcher","SeobilityBot","Cincraw","Dragonbot","VoluumDSP-content-bot","FreshRSS","BitBot","^PHP-Curl-Class","Google-Certificates-Bridge","centurybot","Viber","e\\.ventures Investment Crawler","evc-batch","PetalBot","virustotal","(^| )PTST\\/","minicrawler","Cookiebot"];function T(t){const e=(t||new n).getNavigator(),i=e.userAgent.toLowerCase(),o={init(){this.browser=this.searchString(this.dataBrowser)||"",this.version=this.searchVersion(e.userAgent)||this.searchVersion(e.appVersion)||"",this.OS=this.searchString(this.dataOS)||""},searchString(t){for(let e=0;e{const t={"X-Klaviyo-Onsite":"1"};try{var e;return Object.assign({},t,{"X-Klaviyo-Js-Url":!0===(null==(e=window.klaviyoModulesObject)?void 0:e.v2Route)?"path":"query"})}catch(e){return t}},Y=t=>{const e=t.match(F);return e?{encryptedString:e[1],companyId:e[2]}:{}},U=t=>{let e=!1;return t&&G.forEach((i=>{d(t[i])?e=!0:delete t[i]})),e};function V(t){var e;this.context=t.context,this.cookie=t.cookie,this.local_storage=t.local_storage,this.account_id=null,this.cookie_domain=null,this.identity=null,this.cid=null,this.klSessionId=null,this.parsedInitialIdentity=!1,this.has_tracked_activity=!1,this.has_tracked_interests=!1,this.is_robot=(e=this.context.getNavigator().userAgent,O.some((t=>RegExp(t).test(e)))),this.is_tracking_on=!this.is_robot&&!this.cookie.get("__kla_off"),this._loadIdentityFromCookie()}function z(t,e){return window.klaviyo&&window.klaviyo.getClientIdentifiers&&e?window.klaviyo.getClientIdentifiers().then((e=>(e&&(t.extended_id_metadata=e),t))):Promise.resolve(t)}V.prototype.stripNonIdentifiers=function(t){const e=Object.entries(t).reduce(((t,[e,i])=>([...G,M].includes(e)&&(t[e]=i),t)),{});return["$email","$phone_number","email","phone_number"].forEach((t=>delete e[t])),e},V.prototype._safelyGetIdentityCookieValue=function(){const t=this.cookie.get(D);if(!(encodeURIComponent(`${t}`).length>3e3))return t;this.clearIdentity(!1)},V.prototype._loadIdentityFromCookie=function(){const t=this._safelyGetIdentityCookieValue();if(t)try{const e=JSON.parse(A.decode(t)),{cid:i}=e,o=B()(e,P);if(this.identity=o,this.cid=i,this.identity&&this.identity.$email)try{const t=JSON.parse(this.identity.$email);this.identity=this._getIdentityFromKLObject(t),this._saveIdentity(this.identity)}catch(t){}}catch(t){}},V.prototype.account=function(t,e){return this.account_id||!c(t)||c(window.__klKey)||(t=window.__klKey),this.is_tracking_on&&!c(t)&&(this.account_id=t),_(e,this.account_id),this.account_id},V.prototype.cookieDomain=function(t,e){return this.is_tracking_on&&!c(t)&&(this.cookie_domain=t),_(e,this.cookie_domain),this.cookie_domain},V.prototype.isIdentified=function(t){const e=U(this.identity);return _(t,e),e},V.prototype._getIdentifiers=function(){const t={};return this.isIdentified()?(this.identity.$exchange_id&&(t.$exchange_id=this.identity.$exchange_id),this.identity.$email&&(t.$email=this.identity.$email),this.identity.email&&(t.email=this.identity.email),this.identity.$id&&(t.$id=this.identity.$id),this.identity.id&&(t.id=this.identity.id),this.identity.$phone_number&&(t.$phone_number=this.identity.$phone_number),this.identity.$anonymous&&(t.$anonymous=this.identity.$anonymous),t):t},V.prototype._hasMismatchedExchangeToken=function(t){if(void 0===t)return!1;const{companyId:e}=Y(t);return!(!this.account()||!e||this.account()===e)},V.prototype.identify=function(t,e,i,o){if(this._shouldClearIdentity(t)&&this.clearIdentity(),!1===e&&this.identity)return this._getIdentityToReturn(this.identity,o);if(!this._identityNeedsUpdate(t)||!this.account())return this._getIdentityToReturn(this.identity,o);const n=null==t?void 0:t._kx,r=Object.assign({},this.identity,t);if(delete r._kx,(U(t)||n&&this._getKlSessionId().klSessionId)&&!t[M]&&this._clearKlSessionId(),U(r)||n){try{v()&&window.__klKey&&S({companyId:this.account(),eventDetails:{source:"PROFILES",data:{identity:r,_kx:n}},account:this.account()})}catch(t){console.warn("Error checking for TikTok in-app browser",t)}this._sendNewIdentifyRequest(r,{_kx:n}).then((e=>{if(e.ok)e.json().then((({meta:{exchange_id:e,should_clear_cookie:s}}={})=>{if(s&&this.clearIdentity(),!1!==i){var a;const i=Object.assign({},s?t:r,{$exchange_id:e});["$email","$phone_number","email","phone_number"].forEach((t=>delete i[t])),this._removeSpecialKeysPostIdentify(i),this._populateLegacyMappedIdentifiers(i);const o=null==(a=this.identity)?void 0:a.$exchange_id;this._setIdentity(i,!1),(o&&o!==e||n!==e)&&this.initializeClientSession()}else{const t=Object.assign({},this.identity,{$exchange_id:e});this._setIdentity(t,!1)}this.trackActivity(),_(o)}));else{if(this._setIdentity(r),e.status>=500)throw new Error(`Failed with status ${e.status}`);console.error(`identify failed with status ${e.status}`)}}))}else!1!==i&&this._setIdentity(r),_(o);return this._getIdentityToReturn(r)},V.prototype._getIdentityToReturn=function(t,e){const i=Object.assign({},t);if(window.klaviyo&&window.klaviyo.sendCachedEvents&&U(t))try{z({},this._getKlSessionId().klSessionId).then((e=>{window.klaviyo.sendCachedEvents(this.account(),t,e)}))}catch(t){console.error("Failed to send cached events due to error: ",t)}return delete i.$exchange_id,delete i._kx,delete i[M],_(e,i),i},V.prototype._removeSpecialKeysPostIdentify=function(t){return u(["$append","$unappend",L],(function(e){l(t,e)&&(u(t[e],(function(i,o){e===L&&(o=i),l(t,o)&&delete t[o]})),delete t[e])})),t};const W={$id:"external_id",$kid:"id",$email:"email",$phone_number:"phone_number",$anonymous:"anonymous_id",$first_name:"first_name",$last_name:"last_name",$organization:"organization",$title:"title",$image:"image",email:"email",phone_number:"phone_number",_kx:"_kx"},J={$address1:"address1",$address2:"address2",$city:"city",$country:"country",$region:"region",$zip:"zip",$timezone:"timezone"};V.prototype._populateLegacyMappedIdentifiers=function(t){const e=Object.fromEntries(Object.entries(W).map((t=>t.reverse())));Object.keys(e).forEach((i=>{if(!(i in t))return;const o=e[i];t[o]=t[i],delete t[i]}))},V.prototype.clearIdentity=function(t=!0){this.cookie.del(D),this.identity=null,t&&this.clearViewedItems()},V.prototype.enableAnonymousTracking=function(){this.identity&&this.identity.$anonymous||this.identify({$anonymous:m()})},V.prototype.clearViewedItems=function(){this.local_storage.del(R)},V.prototype.trackActivity=function(t){if(this.has_tracked_activity)return;this._saveReferrer(),this._saveLastReferrer();const{context:e}=this,i=new T(e),o={page:e.getLocation().href,browser:i.browser,os:i.os};this._parseInitialUrlAndIdentify((()=>{this.track("__activity__",o)&&(this.has_tracked_activity=!0),_(t)}))},V.prototype.trackViewedItem=function(t,e){if(!this.local_storage.is_available)return;const i=b();let o=this.local_storage.get(R);try{o=JSON.parse(o)||[]}catch(t){o=[]}if(o.length){const t=o.reduce(((t,e)=>e[0].LastViewedDate&&(!t||e[0].LastViewedDate>t)?e[0].LastViewedDate:t),0);(!t||t+2592e3t.ItemId===e[0].ItemId&&(e[1]+=1,e[0].LastViewedDate=i,!0)))||(t.LastViewedDate=i,o.unshift([t,1]),o=o.splice(0,20)),o.sort((function(e,i){return e[1]!==i[1]?i[1]-e[1]:e[0].ItemId===t.ItemId?-1:i[0].ItemId===t.ItemId?1:0})),this.local_storage.set(R,JSON.stringify(o));const n={},r=o.map((t=>Object.assign({},t[0],{Views:t[1]})));n.$viewed_items=r,this.identify(n,!0,!1,e)},V.prototype.track=function(t,e={},i,o="api"){var n;const r=this.account_id,s=this.identity||{},a=B()(s,j),c=!U(a);if(!r||c)return window.klaviyo&&window.klaviyo.cacheEvent&&window.klaviyo.cacheEvent({event:t,properties:e}),!1;e.$use_ip=!0,e.$is_session_activity=!0;const{protectedTrackers:d,otherProperties:l}=function(t={},e=[]){const[i,o]=Object.keys(t).reduce(((i,o)=>(o in e?i[0][e[o]]=t[o]:i[1][o]=t[o],i)),[{},{}]);return{protectedTrackers:i,otherProperties:o}}(e,{time:"time",$value:"value",$event_id:"unique_id"});try{v()&&window.__klKey&&S({companyId:this.account(),eventDetails:{source:"EVENTS",data:{metric:{name:t},profile:a,properties:l}},account:this.account()})}catch(t){console.warn("Error checking for TikTok in-app browser",t)}const{formattedPayload:u}=this.formatProfilePayload(a);return null!=(n=u.properties)&&n.$exchange_id&&!u._kx&&(u._kx=u.properties.$exchange_id),z(l,this._getKlSessionId().klSessionId).then((e=>{this._sendTrackRequest({data:{type:"event",attributes:Object.assign({metric:{data:{type:"metric",attributes:{name:t,service:o}}},profile:{data:{type:"profile",attributes:u}},properties:e},d)}})})),_(i,!0),!0},V.prototype.formatProfilePayload=function(t,e={}){const{protectedIdentifiers:i,locationProperties:o,otherProperties:n}=function(t={},e={},i={}){const[o,n,r]=Object.keys(t).reduce(((o,n)=>(n in e?o[0][e[n]]=t[n]:n in i?o[1][i[n]]=t[n]:o[2][n]=t[n],o)),[{},{},{}]);return{protectedIdentifiers:o,locationProperties:n,otherProperties:r}}(t,W,J),{id:r}=i,s=B()(i,E),a=Object.keys(o).length>0?{location:o}:{},c=Object.assign({},i,Object.assign({},s,a,e,{properties:n}),{_kx:e._kx||i._kx});return c._kx||delete c._kx,{formattedPayload:c,id:r}},V.prototype.trackOnce=function(t,e,i){const o=Object.assign({__track_once__:!0},e);return this.track(t,o,i)},V.prototype._identityNeedsUpdate=function(t){const e=this.identity,i=Object.assign({},e,t);return!e||!y(e,i)},V.prototype._setIdentity=function(t,e=!0){const i=t;delete i._kx,this.identity=i,this._saveIdentity(i,e)},V.prototype._getClientIdFromCookie=function(){if(this.cid)return{cid:this.cid};const t=this._safelyGetIdentityCookieValue();let e;try{({cid:e}=JSON.parse(A.decode(t))),this.cid=e}catch(t){}return this.cid?{cid:this.cid}:{}},V.prototype._saveIdentity=function(t,e=!0){this._getClientIdFromCookie(),this.cid&&(t=Object.assign({cid:this.cid},t)),e||(t=this.stripNonIdentifiers(t)),this.cookie.set(D,A.encode(JSON.stringify(t)),{daysToExpire:730,domain:this.cookie_domain})},V.prototype._saveReferrer=function(){const t=Object.assign({},this.identity);t.$referrer||(t.$referrer={ts:b(),value:this.context.getReferrer(),first_page:this.context.getLocation().href},this._setIdentity(t))},V.prototype._setKlSessionId=function(t){const e=Object.assign({},this.identity);e[M]||(e[M]=t,this._setIdentity(e))},V.prototype._getKlSessionId=function(){if(this.klSessionId)return{klSessionId:this.klSessionId};const t=this._safelyGetIdentityCookieValue();let e;try{({[M]:e}=JSON.parse(A.decode(t))),this.klSessionId=e}catch(t){}return this.klSessionId?{klSessionId:this.klSessionId}:{}},V.prototype._clearKlSessionId=function(){this.klSessionId=null;const t=Object.assign({},this.identity);delete t[M],this._setIdentity(t)},V.prototype._saveLastReferrer=function(){const t=Object.assign({},this.identity),e=b();(!t.$last_referrer||t.$last_referrer.ts+1800{let i;return(...o)=>new Promise(((n,r)=>{clearTimeout(i),i=setTimeout((()=>{try{const e=t(...o);n(e)}catch(t){r(t)}}),e)}))})(((t,e)=>w((()=>(0,r.Z)(g(`client/profiles/?company_id=${e}`),{method:"POST",mode:"no-cors",headers:Object.assign({"Content-Type":"application/json"},K(),{revision:"2024-07-15",accept:"application/json"}),body:t})),5,1e3+1e3*Math.random(),[429]).finally((()=>{q={},H={}})))),V.prototype._sendNewIdentifyRequest=function(t,e={}){let i=B()(t,N);const{formattedPayload:o,id:n}=this.formatProfilePayload(i,e);q=Object.assign({},q,o),H=Object.assign({},H,n?{id:n}:{});const r=H?Object.assign({},H):{},s=JSON.stringify({data:Object.assign({type:"profile"},r,{attributes:q})});return this._debouncedIdentifyWithRequestRetry(s,this.account_id)},V.prototype._sendTrackRequest=function(t,e){const i=JSON.stringify({data:t.data});return w((()=>(0,r.Z)(g(`client/events/?company_id=${this.account()}`),{method:"POST",mode:"no-cors",headers:Object.assign({"Content-Type":"application/json"},K(),{revision:"2024-07-15",accept:"application/json"}),body:i})),5,1e3+1e3*Math.random(),[429]).then((t=>{if(!t.ok)throw new Error(`Failed with status ${t.status}`);return null==e||e(),t.json()})).catch((t=>null==e?void 0:e(t)))},V.prototype._shouldClearIdentity=function(t){return!(!t||!this.identity)&&(this._hasCachedIdAndNewIdDiffers(t)||!this._hasCachedId()&&this._hasCachedEmailAndNewEmailDiffers(t)||this._hasExchangeIdAndCompanyIdDiffers())},V.prototype._hasCachedEmailAndNewEmailDiffers=function(t){return this.identity.$email&&t.$email&&this.identity.$email!==t.$email},V.prototype._hasCachedIdAndNewIdDiffers=function(t){return this._hasCachedId()&&!c(t.$id)&&t.$id!==this.identity.$id},V.prototype._hasCachedId=function(){return!c(this.identity.$id)},V.prototype._hasExchangeId=function(){return!c(this.identity.$exchange_id)},V.prototype._hasExchangeIdAndCompanyIdDiffers=function(){if(!this._hasExchangeId())return!1;const{companyId:t}=Y(this.identity.$exchange_id);return this.account()&&t&&this.account()!==t},V.prototype._checkOrSetClientId=function(){if(this._getClientIdFromCookie(),this.cid)return;const t="randomUUID"in window.crypto?window.crypto.randomUUID():void 0;if(!t)return;const e=A.encode(t),i=Object.assign({},this.identity);i.cid=e,this.cid=e,this._setIdentity(i)},V.prototype._clearProfilePropertiesIfIdentified=function(){this.isIdentified()&&this._setIdentity(this.stripNonIdentifiers(this.identity),!1)},V.prototype.sendKlKeyCollision=function(){window.klKeyCollision&&k({metricGroup:"onsite",companyId:window.klKeyCollision.companyId||this.account(),events:[{metric:"klKeyCollision",log_to_statsd:!0,log_to_s3:!0,log_to_metrics_service:!1,event_details:Object.assign({},window.klKeyCollision,{hostname:window.location.hostname,href:window.location.href,page_url:`${window.location.origin}${window.location.pathname}`})}]})},V.prototype.sendTikTokEvent=function(){var t,e;window.tikTokEvent&&k({metricGroup:"onsite",companyId:window.tikTokEvent.companyId||this.account(),events:[{metric:"tikTokEvent",log_to_statsd:!0,log_to_s3:!0,log_to_metrics_service:!1,event_details:Object.assign({},window.tikTokEvent,{klaviyo_modules_object_company_id:null==(t=window.klaviyoModulesObject)?void 0:t.companyId,klaviyo_modules_object_v2_route:!(null==(e=window.klaviyoModulesObject)||!e.v2Route),window_kl_key:window.__klKey,hostname:window.location.hostname,href:window.location.href,page_url:`${window.location.origin}${window.location.pathname}`})}]})},V.prototype.sendTikTokCrawler=function(){window.tikTokCrawler&&k({metricGroup:"onsite",companyId:window.tikTokCrawler.companyId||this.account(),events:[{metric:"tikTokCrawler",log_to_statsd:!0,log_to_s3:!0,log_to_metrics_service:!1,event_details:Object.assign({},window.tikTokCrawler,{hostname:window.location.hostname,href:window.location.href,page_url:`${window.location.origin}${window.location.pathname}`})}]})},V.prototype.initializeClientSession=function(){window.klaviyo&&window.klaviyo.createClientSession&&(this.parsedInitialIdentity?window.klaviyo.createClientSession():this._parseInitialUrlAndIdentify((()=>{window.klaviyo.createClientSession()})))};(0,o.Z)({tracking:!0});let Z=!1;const X=()=>{Z||(Z=!0,function(){Array.prototype.toJSON&&delete Array.prototype.toJSON;const t=new n,e=t.getWindow();let i=e._learnq;if(i&&i._loaded)return;const o=new V({cookie:new I(t),local_storage:new x(t),context:t}),r=function(t){if("function"==typeof t)t(o);else if(Array.isArray(t)&&t&&o[t[0]])return o[t[0]].apply(o,t.slice(1))};Array.isArray(i)||(e._learnq=[],i=e._learnq);for(let t=i.length-1;t>=0;t-=1){const e=i[t];Array.isArray(e)&&e&&f(["account","cookieDomain","identify"],e[0])&&(r(e),i.splice(t,1))}for(;i.length;)r(i.shift());i.push=r,["account","cookieDomain","identify","track","isIdentified"].forEach((function(t){o[t]&&(i[t]=function(){return o[t].apply(o,arguments)})})),window.klKeyCollision&&i.push(["sendKlKeyCollision"]),window.tikTokCrawler&&i.push(["sendTikTokCrawler"]),window.tikTokEvent&&i.push(["sendTikTokEvent"]),i._loaded=!0,i.push(["trackActivity"]),i.push(["_checkOrSetClientId"]),i.push(["_clearProfilePropertiesIfIdentified"]),i.push(["initializeClientSession"])}())},Q=t=>{!t.customerPrivacy||t.customerPrivacy.userCanBeTracked()?X():document.addEventListener("trackingConsentAccepted",(()=>{X()}))};if(window.Shopify){const t=window.Shopify;t.customerPrivacy?Q(t):t.loadFeatures?(t.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],(e=>{if(e)return console.warn(`Unable to initialize Shopify Consent Tracking API: ${e.message}`),void X();Q(t)})),setTimeout((()=>{t.customerPrivacy||X()}),5e3)):X()}else X()},2116:function(t){t.exports=function(t,e){if(null==t)return{};var i,o,n={},r=Object.keys(t);for(o=0;o=0||(n[i]=t[i]);return n},t.exports.__esModule=!0,t.exports.default=t.exports},87100:function(t,e,i){"use strict";function o(t,e){return e=e||{},new Promise((function(i,o){var n=new XMLHttpRequest,r=[],s=[],a={},c=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:c,headers:{keys:function(){return r},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var d in n.open(e.method||"get",t,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,i){r.push(e=e.toLowerCase()),s.push([e,i]),a[e]=a[e]?a[e]+","+i:i})),i(c())},n.onerror=o,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(d,e.headers[d]);n.send(e.body||null)}))}i.d(e,{Z:function(){return o}})}},function(t){t.O(0,[2462],(function(){return e=53904,t(t.s=e);var e}));t.O()}]);