!function(){"use strict";var e,n="snaptr",t="PAD_SERVER_URL",i="https://tr.snapchat.com",r="".concat(i,"/p"),o="".concat(i,"/cm/si"),a="".concat(i,"/cm/s"),c="".concat(i,"/log/error"),s="".concat(i,"/init"),d="__scpt__",u="".concat(i,"/cm/i"),l="1d53c387",f="_sctr",p="cmdone",m=34186698e3,h="_scid",g="u_sclid",_="u_scsid";!function(e){e[e.UNSET=0]="UNSET",e[e.JS_BRIDGE=1]="JS_BRIDGE",e[e.CLICK_ID=2]="CLICK_ID"}(e||(e={}));var v={age:"u_age",gender:"u_gd",firstname:"u_fn",lastname:"u_ln",device_brand:"d_br",device_model:"d_md",device_type:"d_type",os_type:"d_ot",os_version:"d_os",locale_country:"d_lc",locale_language:"d_ll",user_agent:"d_ua",limited_ad_tracking:"d_lat",connection_type:"c_type",isp:"c_isp",integration:"intg",mobile_carrier:"c_mc",ip_address:"c_ip",lat:"l_lat",long:"l_lng",geo_country:"l_gc",geo_region:"l_gr",geo_metro:"l_gm",geo_city:"l_city",geo_postal_code:"l_gpc",geo_location_source:"l_ls",geo_address:"l_addr",price:"e_pr",item_category:"e_ic",item_ids:"e_iids",currency:"e_cur",number_items:"e_ni",transaction_id:"e_tid",description:"e_desc",level:"e_lv",search_string:"e_ss",payment_info_available:"e_pia",sign_up_method:"e_sm",success:"e_su",event_tag:"et",brand_id:"br_id",data_use:"du",client_dedup_id:"cdid",client_deduplication_id:"cdid"},w=function(){var e=4022871197,n=function(n){n=n.toString();for(var t=0;t>>0,e=(i*=e)>>>0,e+=4294967296*(i-=e)}return 2.3283064365386963e-10*(e>>>0)};return n.version="Mash 0.9",n},S=function(){for(var e=[],n=0;n=200&&o.status<300){var e=void 0;try{e=JSON.parse(o.responseText)}catch(e){return void(r&&r(e))}r&&r(void 0,e)}},o.onerror=o.onabort=function(e){r&&r(e)},D(i),o.send(JSON.stringify(i))},e.prototype.sendBeacon=function(e,n){if(navigator.sendBeacon){D(n);var t=new FormData;Object.keys(n).forEach((function(e){n[e]&&t.append(e,n[e])}));try{navigator.sendBeacon(e,t)}catch(t){this.sendForm("POST",e,n)}}else this.sendForm("POST",e,n)},e}()),H=function(){return H=Object.assign||function(e){for(var n,t=1,i=arguments.length;t0)return n[0]}return null}(J),X=function(e){if(e){var n=e.getEntriesByType("paint").filter((function(e){return"first-contentful-paint"===e.name}));if(n&&n.length>0)return n[0]}return null}(J),z=q()[1],Y=!!(J&&J.mark&&J.getEntriesByName&&(J.timing||G)&&J.now);function Z(e){if(Y){var t=function(e){if(!Y)return null;var n=null==J?void 0:J.getEntriesByName(e);if(n&&n.length>0)return n[n.length-1];return null}(n);t&&(e.m_sl=Math.floor(t.startTime)),J&&(e.m_rd=Math.floor(J.now())),e.m_pi=G?G.domInteractive:(null==J?void 0:J.timing)?J.timing.domInteractive-J.timing.navigationStart:0,e.m_dcl=G?G.domContentLoadedEventEnd:0,e.m_fcps=X?X.startTime:0,e.m_pl=G?G.loadEventEnd:(null==J?void 0:J.timing)?J.timing.loadEventEnd-J.timing.navigationStart:0,e.m_ic=+z,e.m_pv=G?"v2":(null==J?void 0:J.timing)?"v1":"n/a";var i,r=(i=new URL(x()),new URLSearchParams(i.search).get("sc_wbt"));r&&(e.m_wbt=r)}}function $(){var e=W(h);if(null==e||!E(e)){e=y(1);var n=new Date;n.setTime(n.getTime()+m),K(h,e,n.toUTCString())}j.cookie1=e}function W(e){for(var n=e+"=",t=document.cookie.split(";"),i=t.length-1;i>=0;--i){for(var r=t[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(n))return r.substring(n.length,r.length)}return null}function K(e,n,t,i,r){var o=function(){for(var e="_schn=_"+(Math.random()+1).toString(36).substring(6),n=(document.domain||document.location.hostname).split("."),t="",i=n.length-1;i>=0;i--)if(t="."+n[i]+t,document.cookie=e+";domain="+t+";SameSite=Lax",document.cookie.indexOf(e)>-1)return document.cookie=e.split("=")[0]+"=;domain="+t+";expires=Thu, 01 Jan 1970 00:00:01 GMT;SameSite=Lax",t;return null}();document.cookie=e+"="+n+";"+(null==o?"":"domain="+o+";")+(null==t?"":"expires="+t+";")+(null==i?"path=/;":"path="+i+";")+"SameSite=Lax"+(r?"; Secure":"")}function Q(){try{$();var e={jsrid:y(1),c1:j.cookie1,siid:j.srid?j.srid:"",pids:j.pixelIdList?j.pixelIdList.join(","):"",u_scsid:I(),u_sclid:b()};B.sendForm("GET",o,e)}catch(e){U("cookie_sync_error","cookie sync error: ".concat(e.message),e.stack)}}function V(e){var n=[],t=null==e?void 0:e.sync_modes;if(t){for(var i=0;i6048e5)if(j.cookieSyncInProgress)g(0,n);else{j.cookieSynced=!1,j.cookieSyncInProgress=!0;var c=null===(t=e[1])||void 0===t?void 0:t.sync_modes,d={pid:a,sync_modes:Array.isArray(c)?c.join(","):void 0},l=B.sendForm("GET",u,d,void 0,!0),h=function(e){var n,t,r;if((n=i+"/",t=e.origin+"/",null!=n&&null!=t&&n.substr(!r||r<0?0:+r,t.length)===t)&&e.data===p){try{var o=new Date;o.setHours(0,0,0,0);var a=new Date;a.setTime(a.getTime()+m);var c="1|"+o.valueOf();K(f,c,a.toUTCString(),void 0,!1)}catch(e){U("cookie_sync_error","possCookieSync error: ".concat(e.message),e.stack)}j.cookieSynced=!0,j.cookieSyncInProgress=!1;var s=l.parentNode;s&&s.parentNode&&s.parentNode.removeChild(s)}};window.addEventListener?window.addEventListener("message",h):window.attachEvent("message",h),g(0,n)}else ge(e,n);else U("invalid_params","Invalid pixel id in Init:".concat(a));function g(n,t){if(j.cookieSynced||n<0)return j.cookieSynced=!0,void ge(e,t);setTimeout((function(){g(n-10,t)}),10)}}!function(e){e[e.SHA_ONLY=0]="SHA_ONLY",e[e.SOUNDEX_AND_SHA=1]="SOUNDEX_AND_SHA"}(ie||(ie={}));var pe=new Map([["u_fn",ie.SOUNDEX_AND_SHA],["u_mn",ie.SOUNDEX_AND_SHA],["u_ln",ie.SOUNDEX_AND_SHA],["l_c",ie.SOUNDEX_AND_SHA],["l_s",ie.SOUNDEX_AND_SHA],["l_r",ie.SHA_ONLY],["l_z",ie.SHA_ONLY],["u_dobm",ie.SHA_ONLY],["u_dobd",ie.SHA_ONLY],["u_ems",ie.SHA_ONLY],["u_pns",ie.SHA_ONLY]]);function me(e,n){var t;!function(){$(),j.scut=he(d,window.location.search.substring(1)),j.scut&&K("snaptr-scut",j.scut);if(!j.scut){var e=document.referrer||"",n=e.indexOf("?");n>=0&&(j.scut=he(d,e.substring(n+1)),j.scut&&K("snaptr-scut",j.scut))}if(!j.scut){var t=W("snaptr-scut");t&&(j.scut=t)}}(),(null===(t=e[1])||void 0===t?void 0:t.constructor)===Object&&(j.extractInitInfo(e[1]),j.hashState=P.Loading,ce((function(){j.hashState=P.Ready,n()})))}function he(e,n){for(var t=n.split("&"),i=0;i-1?B.sendJSON("POST","/gateway/p",s):B.sendBeacon(r,s)}else U("invalid_params","Invalid pixel id in sendPixelRequest:".concat(e))}function ve(){}try{Y&&(null==J||J.mark(n)),window.triedToSendCookieToNative=!1,function(){var e=function(){try{return window.sessionStorage&&window.sessionStorage.getItem("srid")}catch(e){return null}}();if(e)j.srid=e;else{window.WebJSBridge={setSRID:function(e){j.srid=e;try{window.sessionStorage&&window.sessionStorage.setItem("srid",e)}catch(e){}Q()}};try{te()?window.JSBridge&&window.JSBridge.getSRID?window.JSBridge.getSRID():U("native_bridge_error","Snap android bridge missing. JSBridge defined: ".concat(void 0!==window.JSBridge)):ne()&&(window.webkit&&window.webkit.messageHandlers.getSRID?window.webkit.messageHandlers.getSRID.postMessage({placeholder:"placeholder"}):U("native_bridge_error","Snap ios bridge missing. window.webkit defined: ".concat(void 0!==window.webkit)))}catch(e){U("native_bridge_error","getSRIDFromNative error: ".concat(e.message),e.stack)}}}(),window.snaptr.handleRequest=function(){for(var e=[],n=0;n0){if("string"==typeof e[0])switch(1===e.length&&(e=[e[0],{}]),e.length){case 2:if("string"==typeof e[1]){if(!E(o=e[0]))return;var n=e[1];-1!==j.pixelIdList.indexOf(o)?_e(o,n):U("invalid_params","Invalid pixel id: ".concat(o))}else for(var t=e[0],i=e[1],r=0;r0&&Se()}else setTimeout((function(){e(n-10)}),10)}(1e4)}}();