(self.webpackChunk_klaviyo_onsite_modules=self.webpackChunk_klaviyo_onsite_modules||[]).push([[377],{24364:function(t,e,o){"use strict";e.Z=({tracking:t})=>{var e;const i=t?"https://static-tracking.klaviyo.com/onsite/js/":"https://static.klaviyo.com/onsite/js/",n=null==(e=window.klaviyoModulesObject)?void 0:e.assetSource;o.p=n?`${i}${n}`:i}},53904:function(t,e,o){"use strict";var i=o(24364);o(78991),o(24570),o(26650);function n(t,e,o,i,n,r,a){this.doc=t||document,this.nav=e||navigator,this.scr=o||window.screen,this.win=i||window,this.loc=n||this.doc.location,this.top=r||window.top,this.parent=a||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=o(87100),a=o(44050);const s={};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,o){if(null!=t)if(t.forEach)t.forEach(e,o);else if(t.length===+t.length){for(let i=0,n=t.length;it===e))}function m(t){return`${(a.Jk.settings.debug?"http://":(new n).getProtocol())+a.Jk.settings.analyticsAPIHost}/${t}`}function g(){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 o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?o:3&o|8).toString(16)}))}function b(){return Math.round(new Date/1e3)}function _(t,...e){"function"==typeof t&&t(...e)}function w(t,e,o=0,i,n){const r=n||0;return t().then((n=>{return(i?-1!==i.indexOf(n.status):n.status>=400)&&rsetTimeout(t,a)))).then((()=>w(t,e,o,i,r+1))):n;var a})).catch((()=>t()))}const k=({metricGroup:t,events:e,companyId:o,sample:i=1})=>Math.random()<=i?(0,r.Z)(`${a.bl.url}/onsite/track-analytics?company_id=${o}`,{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:o})=>{var i;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==(i=window.klaviyoModulesObject)?void 0:i.companyId,account:o,pageUrl:window.location.href})}]})};function x(t){this.context=t||new n,this.cookies=[]}function C(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){}}x.prototype.set=function(t,e,o={}){let i;o.minsToExpire?(i=new Date,i.setTime(i.getTime()+1e3*o.minsToExpire*60)):o.daysToExpire&&(i=new Date,i.setTime(i.getTime()+864e5*o.daysToExpire)),this._set(t,o.alreadyEncoded?e:function(t,e){const o=encodeURIComponent;return o instanceof Function?e?encodeURI(t):o(t):escape(t)}(e,!0),`${c(i)?"":`;expires=${i.toGMTString()}`};path=${o.path?o.path:"/"}${o.domain?`;domain=${o.domain}`:""}${o.secure?";secure":""}`)},x.prototype._set=function(t,e,o){this.context.getDocument().cookie=`${t}=${e}${o}`,this.cookies.push({name:t,value:e,extras:o})},x.prototype.get=function(t){const e=new RegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(this.context.getDocument().cookie);return e?function(t,e){const o=decodeURIComponent;let i;if(t=t.split("+").join(" "),o instanceof Function)try{i=e?decodeURI(t):o(t)}catch(e){i=unescape(t)}else i=unescape(t);return i}(e[2],!0):""},x.prototype.del=function(t,e={}){e.daysToExpire=-1,this.get(t)&&this.set(t,"",e)},x.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")},C.prototype.set=function(t,e){return!!this.is_available&&(localStorage.setItem(t,e),!0)},C.prototype.get=function(t){if(this.is_available)return localStorage.getItem(t)},C.prototype.del=function(t){return!!this.is_available&&(localStorage.removeItem(t),!0)};var I=o(2116),B=o.n(I);o(22923),o(3545),o(19986),o(56816);const $={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,o,i,n,r,a,s,c="",d=0;for(t=$._utf8_encode(t);d>2,r=(3&e)<<4|(o=t.charCodeAt(d++))>>4,a=(15&o)<<2|(i=t.charCodeAt(d++))>>6,s=63&i,isNaN(o)?a=s=64:isNaN(i)&&(s=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(a)+this._keyStr.charAt(s);return c},decode:function(t){var e,o,i,n,r,a,s="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,o=(15&n)<<4|(r=this._keyStr.indexOf(t.charAt(c++)))>>2,i=(3&r)<<6|(a=this._keyStr.indexOf(t.charAt(c++))),s+=String.fromCharCode(e),64!=r&&(s+=String.fromCharCode(o)),64!=a&&(s+=String.fromCharCode(i));return s=$._utf8_decode(s)},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",o=0;o127&&i<2048?(e+=String.fromCharCode(i>>6|192),e+=String.fromCharCode(63&i|128)):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128),e+=String.fromCharCode(63&i|128))}return e},_utf8_decode:function(t){for(var e="",o=0,i=0,n=i;o191&&i<224?(n=t.charCodeAt(o+1),e+=String.fromCharCode((31&i)<<6|63&n),o+=2):(n=t.charCodeAt(o+1),c3=t.charCodeAt(o+2),e+=String.fromCharCode((15&i)<<12|(63&n)<<6|63&c3),o+=3);return e}};var A=$,T=["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 O(t){const e=(t||new n).getNavigator(),o=e.userAgent.toLowerCase(),i={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(G);return e?{encryptedString:e[1],companyId:e[2]}:{}},U=t=>{let e=!1;return t&&L.forEach((o=>{d(t[o])?e=!0:delete t[o]})),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.has_tracked_activity=!1,this.has_tracked_interests=!1,this.is_robot=(e=this.context.getNavigator().userAgent,T.some((t=>RegExp(t).test(e)))),this.is_tracking_on=!this.is_robot&&!this.cookie.get("__kla_off"),this._loadIdentityFromCookie()}V.prototype.stripNonIdentifiers=function(t){const e=Object.entries(t).reduce(((t,[e,o])=>(L.includes(e)&&(t[e]=o),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:o}=e,i=B()(e,P);if(this.identity=i,this.cid=o,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,o,i){if(this._shouldClearIdentity(t)&&this.clearIdentity(),!1===e&&this.identity)return this._getIdentityToReturn(this.identity,i);if(!this._identityNeedsUpdate(t)||!this.account())return this._getIdentityToReturn(this.identity,i);const n=null==t?void 0:t._kx,r=Object.assign({},this.identity,t);if(delete r._kx,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:n}}={})=>{if(n&&this.clearIdentity(),!1!==o){const o=Object.assign({},n?t:r,{$exchange_id:e});["$email","$phone_number","email","phone_number"].forEach((t=>delete o[t])),this._removeSpecialKeysPostIdentify(o),this._populateLegacyMappedIdentifiers(o),this._setIdentity(o,!1)}else{const t=Object.assign({},this.identity,{$exchange_id:e});this._setIdentity(t,!1)}this.trackActivity(),_(i)}));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!==o&&this._setIdentity(r),_(i);return this._getIdentityToReturn(r)},V.prototype._getIdentityToReturn=function(t,e){const o=Object.assign({},t);if(window.klaviyo&&window.klaviyo.sendCachedEvents&&U(t))try{window.klaviyo.sendCachedEvents(this.account(),t)}catch(t){console.error("Failed to send cached events due to error: ",t)}return delete o.$exchange_id,delete o._kx,_(e,o),o},V.prototype._removeSpecialKeysPostIdentify=function(t){return u(["$append","$unappend",M],(function(e){l(t,e)&&(u(t[e],(function(o,i){e===M&&(i=o),l(t,i)&&delete t[i]})),delete t[e])})),t};const z={$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"},K={$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(z).map((t=>t.reverse())));Object.keys(e).forEach((o=>{if(!(o in t))return;const i=e[o];t[i]=t[o],delete t[o]}))},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:g()})},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,o=new O(e),i={page:e.getLocation().href,browser:o.browser,os:o.os};this._parseInitialUrlAndIdentify((()=>{this.track("__activity__",i)&&(this.has_tracked_activity=!0),_(t)}))},V.prototype.trackViewedItem=function(t,e){if(!this.local_storage.is_available)return;const o=b();let i=this.local_storage.get(R);try{i=JSON.parse(i)||[]}catch(t){i=[]}if(i.length){const t=i.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=o,!0)))||(t.LastViewedDate=o,i.unshift([t,1]),i=i.splice(0,20)),i.sort((function(e,o){return e[1]!==o[1]?o[1]-e[1]:e[0].ItemId===t.ItemId?-1:o[0].ItemId===t.ItemId?1:0})),this.local_storage.set(R,JSON.stringify(i));const n={},r=i.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={},o,i="api"){var n;const r=this.account_id,a=this.identity||{},s=B()(a,E),c=!U(s);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[o,i]=Object.keys(t).reduce(((o,i)=>(i in e?o[0][e[i]]=t[i]:o[1][i]=t[i],o)),[{},{}]);return{protectedTrackers:o,otherProperties:i}}(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:s,properties:l}},account:this.account()})}catch(t){console.warn("Error checking for TikTok in-app browser",t)}const{formattedPayload:u}=this.formatProfilePayload(s);return null!=(n=u.properties)&&n.$exchange_id&&!u._kx&&(u._kx=u.properties.$exchange_id),this._sendTrackRequest({data:{type:"event",attributes:Object.assign({metric:{data:{type:"metric",attributes:{name:t,service:i}}},profile:{data:{type:"profile",attributes:u}},properties:l},d)}}),_(o,!0),!0},V.prototype.formatProfilePayload=function(t,e={}){const{protectedIdentifiers:o,locationProperties:i,otherProperties:n}=function(t={},e={},o={}){const[i,n,r]=Object.keys(t).reduce(((i,n)=>(n in e?i[0][e[n]]=t[n]:n in o?i[1][o[n]]=t[n]:i[2][n]=t[n],i)),[{},{},{}]);return{protectedIdentifiers:i,locationProperties:n,otherProperties:r}}(t,z,K),{id:r}=o,a=B()(o,j),s=Object.keys(i).length>0?{location:i}:{},c=Object.assign({},o,Object.assign({},a,s,e,{properties:n}),{_kx:e._kx||o._kx});return c._kx||delete c._kx,{formattedPayload:c,id:r}},V.prototype.trackOnce=function(t,e,o){const i=Object.assign({__track_once__:!0},e);return this.track(t,i,o)},V.prototype._identityNeedsUpdate=function(t){const e=this.identity,o=Object.assign({},e,t);return!e||!y(e,o)},V.prototype._setIdentity=function(t,e=!0){const o=t;delete o._kx,this.identity=o,this._saveIdentity(o,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._saveLastReferrer=function(){const t=Object.assign({},this.identity),e=b();(!t.$last_referrer||t.$last_referrer.ts+1800{let o;return(...i)=>new Promise(((n,r)=>{clearTimeout(o),o=setTimeout((()=>{try{const e=t(...i);n(e)}catch(t){r(t)}}),e)}))})(((t,e)=>w((()=>(0,r.Z)(m(`client/profiles/?company_id=${e}`),{method:"POST",mode:"no-cors",headers:Object.assign({"Content-Type":"application/json"},F(),{revision:"2024-07-15",accept:"application/json"}),body:t})),5,1e3+1e3*Math.random(),[429]).finally((()=>{W={},J={}})))),V.prototype._sendNewIdentifyRequest=function(t,e={}){let o=B()(t,N);const{formattedPayload:i,id:n}=this.formatProfilePayload(o,e);W=Object.assign({},W,i),J=Object.assign({},J,n?{id:n}:{});const r=J?Object.assign({},J):{},a=JSON.stringify({data:Object.assign({type:"profile"},r,{attributes:W})});return this._debouncedIdentifyWithRequestRetry(a,this.account_id)},V.prototype._sendTrackRequest=function(t,e){const o=JSON.stringify({data:t.data});return w((()=>(0,r.Z)(m(`client/events/?company_id=${this.account()}`),{method:"POST",mode:"no-cors",headers:Object.assign({"Content-Type":"application/json"},F(),{revision:"2024-07-15",accept:"application/json"}),body:o})),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),o=Object.assign({},this.identity);o.cid=e,this.cid=e,this._setIdentity(o)},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._parseInitialUrlAndIdentify((()=>window.klaviyo.createClientSession()))};(0,i.Z)({tracking:!0});let q=!1;const H=()=>{q||(q=!0,function(){Array.prototype.toJSON&&delete Array.prototype.toJSON;const t=new n,e=t.getWindow();let o=e._learnq;if(o&&o._loaded)return;const i=new V({cookie:new x(t),local_storage:new C(t),context:t}),r=function(t){if("function"==typeof t)t(i);else if(Array.isArray(t)&&t&&i[t[0]])return i[t[0]].apply(i,t.slice(1))};Array.isArray(o)||(e._learnq=[],o=e._learnq);for(let t=o.length-1;t>=0;t-=1){const e=o[t];Array.isArray(e)&&e&&f(["account","cookieDomain","identify"],e[0])&&(r(e),o.splice(t,1))}for(;o.length;)r(o.shift());o.push=r,["account","cookieDomain","identify","track","isIdentified"].forEach((function(t){i[t]&&(o[t]=function(){return i[t].apply(i,arguments)})})),window.klKeyCollision&&o.push(["sendKlKeyCollision"]),window.tikTokCrawler&&o.push(["sendTikTokCrawler"]),window.tikTokEvent&&o.push(["sendTikTokEvent"]),o._loaded=!0,o.push(["trackActivity"]),o.push(["_checkOrSetClientId"]),o.push(["_clearProfilePropertiesIfIdentified"]),o.push(["initializeClientSession"])}())},Z=t=>{!t.customerPrivacy||t.customerPrivacy.userCanBeTracked()?H():document.addEventListener("trackingConsentAccepted",(()=>{H()}))};if(window.Shopify){const t=window.Shopify;t.customerPrivacy?Z(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 H();Z(t)})),setTimeout((()=>{t.customerPrivacy||H()}),5e3)):H()}else H()},2116:function(t){t.exports=function(t,e){if(null==t)return{};var o,i,n={},r=Object.keys(t);for(i=0;i=0||(n[o]=t[o]);return n},t.exports.__esModule=!0,t.exports.default=t.exports},87100:function(t,e,o){"use strict";function i(t,e){return e=e||{},new Promise((function(o,i){var n=new XMLHttpRequest,r=[],a=[],s={},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 a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};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,o){r.push(e=e.toLowerCase()),a.push([e,o]),s[e]=s[e]?s[e]+","+o:o})),o(c())},n.onerror=i,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(d,e.headers[d]);n.send(e.body||null)}))}o.d(e,{Z:function(){return i}})}},function(t){t.O(0,[2462],(function(){return e=53904,t(t.s=e);var e}));t.O()}]);