1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9537],{19537:function(e,t,n){n.r(t),n.d(t,{envs:function(){return xe},fetchApi:function(){return we},httpApi:function(){return ke},usermavenClient:function(){return me}});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function s(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var a={DEBUG:{name:"DEBUG",severity:10},INFO:{name:"INFO",severity:100},WARN:{name:"WARN",severity:1e3},ERROR:{name:"ERROR",severity:1e4},NONE:{name:"NONE",severity:1e4}},c=null;function u(){return c||(c=l())}function l(e){var t=p()&&window.__eventNLogLevel,n=a.WARN;if(t){var r=a[t.toUpperCase()];r&&r>0&&(n=r)}else e&&(n=e);var o={minLogLevel:n};return Object.values(a).forEach((function(e){var t=e.name,r=e.severity;o[t.toLowerCase()]=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];if(r>=n.severity&&e.length>0){var i=e[0],a=e.splice(1),c="[J-".concat(t,"] ").concat(i);"DEBUG"===t||"INFO"===t?console.log.apply(console,s([c],a,!1)):"WARN"===t?console.warn.apply(console,s([c],a,!1)):console.error.apply(console,s([c],a,!1))}}})),function(e,t){if(p()){var n=window;n.__usermavenDebug||(n.__usermavenDebug={}),n.__usermavenDebug[e]=t}}("logger",o),o}function p(e){const t=!!globalThis.window&&!!globalThis.window.document&&!!globalThis.window.location;return!t&&e&&u().warn(e),t}function d(e){if(!p())throw new Error(e||"window' is not available. Seems like this code runs outside browser environment. It shouldn't happen");return window}function h(e,t,n){void 0===n&&(n={});try{var r=n.maxAge,o=n.domain,i=n.path,s=n.expires,a=n.httpOnly,c=n.secure,l=n.sameSite,p="".concat(e,"=").concat(encodeURIComponent(t));if(o&&(p+="; domain=".concat(o)),p+=i?"; path=".concat(i):"; path=/",s&&(p+="; expires=".concat(s.toUTCString())),r&&(p+="; max-age=".concat(r)),a&&(p+="; httponly"),c&&(p+="; secure"),l)switch("string"===typeof l?l.toLowerCase():l){case!0:p+="; SameSite=Strict";break;case"lax":p+="; SameSite=Lax";break;case"strict":p+="; SameSite=Strict";break;case"none":p+="; SameSite=None"}else c&&(p+="; SameSite=None");return p}catch(d){return u().error("serializeCookie",d),""}}var f,v=function(){if(p())return function(e){var t=e.split(".");if(4===t.length&&t.every((function(e){return!isNaN(e)})))return e;var n=function(e){var t=e.match(/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i);return t?t[0]:""}(e);return n||(n=function(e){var t=function(e){return(e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0]).split(":")[0].split("?")[0]}(e),n=t.split("."),r=n.length;return r>2&&(2==n[r-1].length?(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&(t=n[r-3]+"."+t)):t=n[r-2]+"."+n[r-1]),t}(e)),n}(window.location.hostname)};function g(e){if(!e)return{};for(var t={},n=e.split(";"),r=0;r<n.length;r++){var o=n[r],i=o.indexOf("=");i>0&&(t[o.substr(r>0?1:0,r>0?i-1:i)]=o.substr(i+1))}return t}
1function m(e,t){return Array.from(e.attributes).forEach((function(e){t.setAttribute(e.nodeName,e.nodeValue)}))}function y(e,t){e.innerHTML=t;var n,r=e.getElementsByTagName("script");for(n=r.length-1;n>=0;n--){var o=r[n],i=document.createElement("script");m(o,i),o.innerHTML&&(i.innerHTML=o.innerHTML),i.setAttribute("data-usermaven-tag-id",e.id),document.getElementsByTagName("head")[0].appendChild(i),r[n].parentNode.removeChild(r[n])}}var _=function(e){if(!e)return null;try{for(var t=e+"=",n=d().document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}}catch(i){u().error("getCookies",i)}return null},b=function(e,t,n){void 0===n&&(n={}),d().document.cookie=h(e,t,n)},w=function(e,t){void 0===t&&(t="/"),document.cookie=e+"= ; SameSite=Strict; expires = Thu, 01 Jan 1970 00:00:00 GMT"+(t?"; path = "+t:"")},k=function(){return Math.random().toString(36).substring(2,12)},P=function(){return Math.random().toString(36).substring(2,7)},x={utm_source:"source",utm_medium:"medium",utm_campaign:"campaign",utm_term:"term",utm_content:"content"},S={gclid:!0,fbclid:!0,dclid:!0},N=function(e){var t=e.split(".")[1];return t?t.length>=7?e:e.slice(0,-1)+"0".repeat(7-t.length)+"Z":e};var C=function(){function e(){this.queue=[]}return e.prototype.flush=function(){var e=this.queue;return this.queue=[],e},e.prototype.push=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.queue).push.apply(e,t)},e}(),A=function(){function e(e){this.key=e}return e.prototype.flush=function(){var e=this.get();return e.length&&this.set([]),e},e.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.get();n.push.apply(n,e),this.set(n)},e.prototype.set=function(e){localStorage.setItem(this.key,JSON.stringify(e))},e.prototype.get=function(){var e=localStorage.getItem(this.key);return null!==e&&""!==e?JSON.parse(e):[]},e}(),E=Object.prototype,O=E.toString,I=E.hasOwnProperty,T=Array.prototype.forEach,H=Array.isArray,D={},j=H||function(e){return"[object Array]"===O.call(e)};function F(e,t,n){if(Array.isArray(e))if(T&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===D)return}var $=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function L(e,t,n){if(null!==e&&void 0!==e)if(T&&Array.isArray(e)&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===D)return}else for(var i in e)if(I.call(e,i)&&t.call(n,e[i],i)===D)return}var M=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return F(t,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function U(e,t){return-1!==e.indexOf(t)}var z=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},R=function(e){return void 0===e},J=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(n,r,!!i);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(o){if(o=o||e(window.event)){var i,s=!0;z(r)&&(i=r(o));var a=n.call(t,o);return!1!==i&&!1!==a||(s=!1),s}}}(t,r,a)}else u().error("No valid element provided to register_event")}}(),q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return e.apply(this,t)}catch(r){u().error("Implementation error. Please turn on debug and contact [email protected].",r)}}},B="undefined"!==typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function W(e,t,n){return e!==Object(e)?t?t(e,n):e:e[B]?void 0:(e[B]=!0,j(e)?(r=[],F(e,(function(e){r.push(W(e,t))}))):(r={}
1,L(e,(function(e,n){n!==B&&(r[n]=W(e,t,n))}))),delete e[B],r);var r}var V=["$performance_raw"];function G(e,t){return W(e,(function(e,n){return n&&V.indexOf(n)>-1?e:"string"===typeof e&&null!==t?e.slice(0,t):e}))}function K(e){switch(typeof e.className){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Y(e){var t="";return ne(e)&&!re(e)&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){Q(e)&&e.textContent&&(t+=$(e.textContent).split(/(\s+)/).filter(oe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),$(t)}function Z(e){return!!e&&1===e.nodeType}function X(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Q(e){return!!e&&3===e.nodeType}function ee(e){return!!e&&11===e.nodeType}var te=["a","button","form","input","select","textarea","label"];function ne(e){for(var t=e;t.parentNode&&!X(t,"body");t=t.parentNode){var n=K(t).split(" ");if(U(n,"ph-sensitive")||U(n,"ph-no-capture"))return!1}if(U(K(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"===typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";if("string"===typeof o){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function re(e){return!!(X(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||X(e,"select")||X(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function oe(e){if(null===e||R(e))return!1;if("string"===typeof e){e=$(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}var ie=function(){function e(e,t){void 0===t&&(t=!1),this.clicks=[],this.instance=e,this.enabled=t}return e.prototype.click=function(e,t,n){if(this.enabled){var r=this.clicks[this.clicks.length-1];r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3?(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length&&this.instance.capture("$rageclick")):this.clicks=[{x:e,y:t,timestamp:n}]}},e}(),se=function(){function e(e){this.instance=e,this.lastScrollDepth=0,this.canSend=!0,this.documentElement=document.documentElement}return e.prototype.track=function(){var e=this.getScrollDepth();e>this.lastScrollDepth&&(this.lastScrollDepth=e,this.canSend=!0)},e.prototype.send=function(e){if(void 0===e&&(e="$scroll"),this.canSend){var t={percent:this.lastScrollDepth,window_height:this.getWindowHeight(),document_height:this.getDocumentHeight(),scroll_distance:this.getScrollDistance()};this.instance.capture(e,t),this.canSend=!1}},e.prototype.getScrollDepth=function(){try{var e=this.getWindowHeight(),t=this.getDocumentHeight(),n=this.getScrollDistance(),r=t-e;return Math.min(100,Math.floor(n/r*100))}catch(o){return 0}},e.prototype.getWindowHeight=function(){try{return window.innerHeight||this.documentElement.clientHeight||document.body.clientHeight||0}catch(e){return 0}},e.prototype.getDocumentHeight=function(){try{return Math.max(document.body.scrollHeight||0,this.documentElement.scrollHeight||0,document.body.offsetHeight||0,this.documentElement.offsetHeight||0,document.body.clientHeight||0,this.documentElement.clientHeight||0)}catch(e){return 0}},e.prototype.getScrollDistance=function(){try{return window.scrollY||window.pageYOffset||document.body.scrollTop||this.documentElement.scrollTop||0}catch(e){return 0}},e}(),ae={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Z(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};te.indexOf(r)>-1&&!n&&(o.$el_text=Y(e));var i=K(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),L(e.attributes,(function(n){var r;re(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&oe(n.value)&&("string"!==typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(o["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return o.nth_child=s,o.nth_of_type=a,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return L(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),oe(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return L(this._customProperties,(function(r){L(r.event_selectors,(function(o){L(document.querySelectorAll(
1o),(function(o){U(e,o)&&ne(o)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){var t;return"undefined"===typeof e.target?e.srcElement||null:(null===(t=e.target)||void 0===t?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null},_captureEvent:function(e,t,n){var r,o=this,i=this._getEventTarget(e);if(Q(i)&&(i=i.parentNode||null),"scroll"===e.type)return this.scrollDepth.track(),!0;if("visibilitychange"===e.type&&"hidden"===document.visibilityState||"popstate"===e.type)return this.scrollDepth.send(),!0;if("click"===e.type&&e instanceof MouseEvent&&(null===(r=this.rageclicks)||void 0===r||r.click(e.clientX,e.clientY,(new Date).getTime())),i&&function(e,t){if(!e||X(e,"html")||!Z(e))return!1;if(e.classList&&e.classList.contains("um-no-capture"))return!1;for(var n=!1,r=[e],o=!0,i=e;i.parentNode&&!X(i,"body");)if(ee(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{if(!(o=i.parentNode||!1))break;if(te.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var s=window.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(n=!0)}r.push(o),i=o}var a=window.getComputedStyle(e);if(a&&"pointer"===a.getPropertyValue("cursor")&&"click"===t.type)return!0;var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return n?"click"===t.type:"click"===t.type&&(te.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e)){for(var s=[i],a=i;a.parentNode&&!X(a,"body");)ee(a.parentNode)?(s.push(a.parentNode.host),a=a.parentNode.host):(s.push(a.parentNode),a=a.parentNode);var c,u=[],l=!1;if(L(s,(function(e){var t=ne(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=t&&oe(c)&&c),U(K(e).split(" "),"ph-no-capture")&&(l=!0),u.push(o._getPropertiesFromElement(e,null===n||void 0===n?void 0:n.mask_all_element_attributes,null===n||void 0===n?void 0:n.mask_all_text))})),(null===n||void 0===n?void 0:n.mask_all_text)||(u[0].$el_text=Y(i)),c&&(u[0].attr__href=c),l)return!1;var p=M(this._getDefaultProperties(e.type),{$elements:u},this._getCustomProperties(s));return t.capture("$autocapture",p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e,t){var n=this,r=function(r){r=r||window.event,n._captureEvent(r,e,t)};J(document,"submit",r,!1,!0),J(document,"change",r,!1,!0),J(document,"click",r,!1,!0),J(document,"visibilitychange",r,!1,!0),J(document,"scroll",r,!1,!0),J(window,"popstate",r,!1,!0)},_customProperties:[],rageclicks:null,scrollDepth:null,opts:{},init:function(e,t){var n=this;if(this.rageclicks=new ie(e),this.scrollDepth=new se(e),this.opts=t,!document||!document.body)return console.debug("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.readyAutocapture(e,t)}),500);this.readyAutocapture(e,t)},readyAutocapture:function(e,t){this._addDomEventHandlers(e,t)},enabledForProject:function(e,t,n){if(!e)return!0;t=R(t)?10:t,n=R(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return z(document.querySelectorAll)}};!function(e){for(var t in e)"function"===typeof e[t]&&(e[t]=e[t].bind(e))}(ae),function(e){for(var t in e)"function"===typeof e[t]&&(e[t]=q(e[t]))}(ae);var ce="production",ue="2023-09-02T18:25:10.578Z",le="".concat("1.2.4","/").concat(ce,"@").concat(ue),pe=316224e3,de=function(e,t){u().debug("Sending beacon",t);var n=new Blob([t],{type:"text/plain"});return navigator.sendBeacon(e,n),Promise.resolve()};var he=function(e,t){return console.debug("Jitsu client tried to send payload to ".concat(e),function(e){if("string"===typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(t){return e}}(t)),Promise.resolve()};function fe(e,t){void 0===t&&(t=void 0),""!=(t=null!==t&&void 0!==t?t:window.location.pathname)&&"/"!=t&&(w(e,t),fe(e,t.slice(0,t.lastIndexOf("/"))))}var ve=function(){function e(e,t){this.cookieDomain=e,this.cookieName=t}return e.prototype.save=function(e){b(this.cookieName,JSON.stringify(e),{domain:this.cookieDomain,secure:"http:"!==document.location.protocol,maxAge:pe})},e.prototype.restore=function(){fe(this.cookieName);var e=_(this.cookieName);if(e)try{var t=JSON.parse(decodeURIComponent(e));return"object"!==typeof t?void u().warn("Can't restore value of ".concat(this.cookieName,"@").concat(this.cookieDomain,", expected to be object, but found ").concat("object"!==typeof t,": ").concat(t,". Ignoring")):t}catch(n){return void u().error("Failed to decode JSON from "+e,n)}},e.prototype.delete=function(){w(this.cookieName)},e}(),ge=function(){function e(){}return e.prototype.save=function(e){},e.prototype.restore=function(){},e.prototype.delete=function(){},e}();function me(e){var t=new Ne;return t.init(e),t}var ye={getSourceIp:function(){},describeClient:function(){return{referer:document.referrer,url:window.location.href,page_title:document.title,doc_path:document.location.pathname,doc_host:document.location.hostname,doc_search:window.location.search,screen_resolution:screen.width+"x"+screen.height,vp_size:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)+"x"+Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),user_agent:navigator.userAgent,user_language:navigator.language,doc_encoding:document.characterSet}},getAnonymousId:function(e){var t=e.name,n=e.domain;fe(t);var r=_(t);if(r)return u().debug("Existing user id",r),r;var o=k();return u().debug("New user id",o),b(t,o,{domain:n,secure:"http:"!==document.location.protocol,maxAge:pe}),o}};function _e(e,t){return t&&(null===t||void 0===t?void 0:t.length)>0&&0!==t.indexOf(e)?e+t:t}function be(e,t){for(var n=0,r="string"===typeof e?[e]:e;n<r.length;n++)for(var o=r[n];t&&t.length>0&&t.charAt(t.length-1)===o;)t=t.substring(0,t.length-1);return t}function we(e,t,n){return void 0===n&&(n={}),{getAnonymousId:function(r){var o=r.name,i=r.domain;if(null===n||void 0===n?void 0:n.disableCookies)return"";var s=g(e.headers.cookie)[o];if(s)return s;var a={maxAge:316224e3,httpOnly:!1};i&&(a.domain=i);var c=k();return t.headers.set("Set-Cookie",h(o,c,a)),c},getSourceIp:function(){var t=e.headers["x-forwarded-for"]||e.headers["x-real-ip"]||e.ip;return t&&t.split(",")[0].trim()},describeClient:function(){for(var t=e.headers.get("host")||e.headers.get("host"),n=be([":","/"],e.headers["x-forwarded-proto"]||e.nextUrl.protocol||"http");n&&n.length>0&&n.charAt(n.length-1);)n=n.substring(0,n.length-1);var r,o,i=e.url||"/",s=i.indexOf("?");return s>=0?(r=i.substring(0,s),o=i.substring(s+1)):(r=i,o=void 0),o=_e(o,"?"),r=_e(r,"/"),{doc_encoding:"",doc_host:t,doc_path:i,doc_search:o,page_title:"",referer:e.headers.referrer,screen_resolution:"",url:"".concat(n,"://").concat(t).concat(r||"").concat(o||""),user_agent:e.headers["user-agent"],user_language:e.headers["accept-language"]&&e.headers["accept-language"].split(",")[0],vp_size:""}}}}function ke(e,t,n){void 0===n&&(n={});var r=function(e,t){var n=e.headers[t.toLowerCase()];if(n)return"string"===typeof n?n:n.length>0?n.join(","):void 0};return{getAnonymousId:function(r){var o=r.name,i=r.domain;if(null===n||void 0===n?void 0:n.disableCookies)return"";var s=g(e.headers.cookie)[o];if(s)return s;var a={maxAge:316224e3,httpOnly:!1};i&&(a.domain=i);var c=k();return t.setHeader("Set-Cookie",h(o,c,a)),c},getSourceIp:function(){var t=r(e,"x-forwarded-for")||r(e,"x-real-ip")||e.socket.remoteAddress;return t&&t.split(",")[0].trim()},describeClient:function(){var t=e.url?new URL(e.url,e.url.startsWith("http")?void 0:"http://localhost"):{},n=r(e,"x-forwarded-host")||r(e,"host")||t.hostname,o=be([":","/"],r(e,"x-forwarded-proto")||t.protocol),i=_e("?",t.search),s=_e("/",t.pathname);return{doc_encoding:"",doc_host:n,doc_path:e.url,doc_search:i,page_title:"",referer:r(e,"referrer"),screen_resolution:"",url:"".concat(o,"://").concat(n).concat(s||"").concat(i||""),user_agent:e.headers["user-agent"],user_language:e.headers["accept-language"]&&e.headers["accept-language"].split(",")[0],vp_size:""}}}}var Pe={getSourceIp:function(){},describeClient:function(){return{}},getAnonymousId:function(){return""}},xe={httpApi:ke,nextjsApi:ke,browser:function(){return ye},express:ke,empty:function(){return Pe}},Se=function(e,t,n,r){void 0===r&&(r=function(e,t){});var o=new window.XMLHttpRequest;return new Promise((function(i,s){o.onerror=function(n){u().error("Failed to send payload to ".concat(e,": ").concat((null===n||void 0===n?void 0:n.message)||"unknown error"),t,n),r(-1,{}),s(new Error("Failed to send JSON. See console logs"))},o.onload=function(){200!==o.status?(r(o.status,{}),u().warn("Failed to send data to ".concat(e," (#").concat(o.status," - ").concat(o.statusText,")"),t),s(new Error("Failed to send JSON. Error code: ".concat(o.status,". See logs for details")))):r(o.status,o.responseText),i()},o.open("POST",e),o.setRequestHeader("Content-Type","application/json"),Object.entries(n||{}
1).forEach((function(e){var t=e[0],n=e[1];return o.setRequestHeader(t,n)})),o.send(t),u().debug("sending json",t)}))},Ne=function(){function e(){this.userProperties={},this.groupProperties={},this.permanentProperties={globalProps:{},propsPerEvent:{}},this.cookieDomain="",this.trackingHost="",this.idCookieName="",this.randomizeUrl=!1,this.apiKey="",this.initialized=!1,this._3pCookies={},this.cookiePolicy="keep",this.ipPolicy="keep",this.beaconApi=!1,this.transport=Se,this.customHeaders=function(){return{}},this.queue=new C,this.maxSendAttempts=4,this.retryTimeout=[500,1e12],this.flushing=!1,this.attempt=1,this.propertyBlacklist=[],this.__autocapture_enabled=!1,this.trackingHostFallback="https://events.usermaven.com"}return e.prototype.get_config=function(e){return this.config?this.config[e]:null},e.prototype.id=function(e,t){return this.userProperties=r(r({},this.userProperties),e),u().debug("Usermaven user identified",e),this.userIdPersistence?this.userIdPersistence.save(e):u().warn("Id() is called before initialization"),t?Promise.resolve():this.track("user_identify",{})},e.prototype.group=function(e,t){return this.groupProperties=r(r({},this.groupProperties),e),u().debug("Usermaven group identified",e),this.userIdPersistence?this.userIdPersistence.save({company:e}):u().warn("Group() is called before initialization"),t?Promise.resolve():this.track("group",{})},e.prototype.reset=function(e){if(this.userIdPersistence&&this.userIdPersistence.delete(),this.propsPersistance&&this.propsPersistance.delete(),e){var t=_(this.idCookieName);t&&(u().debug("Removing id cookie",t),b(this.idCookieName,"",{domain:this.cookieDomain,expires:new Date(0)}))}return Promise.resolve()},e.prototype.rawTrack=function(e){return this.sendJson(e)},e.prototype.makeEvent=function(e,t,n){var o,i=n.env,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["env"]);i||(i=p()?xe.browser():xe.empty()),this.restoreId();var a=this.getCtx(i),c=r(r({},this.permanentProperties.globalProps),null!==(o=this.permanentProperties.propsPerEvent[e])&&void 0!==o?o:{}),u=r({api_key:this.apiKey,src:t,event_type:e},s),l=i.getSourceIp();return l&&(u.source_ip=l),this.compatMode?r(r(r({},c),{eventn_ctx:a}),u):r(r(r({},c),a),u)},e.prototype._send3p=function(e,t,n){var r="3rdparty";n&&""!==n&&(r=n);var o=this.makeEvent(r,e,{src_payload:t});return this.sendJson(o)},e.prototype.sendJson=function(e){return o(this,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return function(){var e="false";return"undefined"!==typeof window&&window.localStorage&&(e=localStorage.getItem("um_exclusion")),void 0!==e&&null!==e&&"false"!==e}()?[3,3]:this.maxSendAttempts>1?(this.queue.push([e,0]),this.scheduleFlush(0),[3,3]):[3,1];case 1:return[4,this.doSendJson(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}
1))}))},e.prototype.doSendJson=function(e){var t=this,n="keep"!==this.cookiePolicy?"&cookie_policy=".concat(this.cookiePolicy):"",r="keep"!==this.ipPolicy?"&ip_policy=".concat(this.ipPolicy):"",o=p()?"/api/v1/event":"/api/v1/s2s/event",i="".concat(this.trackingHost).concat(o,"?token=").concat(this.apiKey).concat(n).concat(r);this.randomizeUrl&&(i="".concat(this.trackingHost,"/api.").concat(P(),"?p_").concat(P(),"=").concat(this.apiKey).concat(n).concat(r));var s=JSON.stringify(e);return u().debug("Sending payload to ".concat(i),s),this.transport(i,s,this.customHeaders(),(function(e,n){return t.postHandle(e,n)}))},e.prototype.scheduleFlush=function(e){var t=this;if(!this.flushing){if(this.flushing=!0,"undefined"===typeof e){var n=Math.random()+1,r=Math.pow(2,this.attempt++);e=Math.min(this.retryTimeout[0]*n*r,this.retryTimeout[1])}u().debug("Scheduling event queue flush in ".concat(e," ms.")),setTimeout((function(){return t.flush()}),e)}},e.prototype.flush=function(){return o(this,void 0,Promise,(function(){var e,t,n=this;return i(this,(function(r){switch(r.label){case 0:if(p()&&!window.navigator.onLine&&(this.flushing=!1,this.scheduleFlush()),e=this.queue.flush(),this.flushing=!1,0===e.length)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.doSendJson(e.map((function(e){return e[0]})))];case 2:return r.sent(),this.attempt=1,u().debug("Successfully flushed ".concat(e.length," events from queue")),[3,4];case 3:return r.sent(),this.trackingHost!==this.trackingHostFallback&&(u().debug("Using fallback tracking host ".concat(this.trackingHostFallback," instead of ").concat(this.trackingHost," on ").concat(ce)),this.trackingHost=this.trackingHostFallback),(e=e.map((function(e){return[e[0],e[1]+1]})).filter((function(e){return!(e[1]>=n.maxSendAttempts)||(u().error("Dropping queued event after ".concat(e[1]," attempts since max send attempts ").concat(n.maxSendAttempts," reached. See logs for details")),!1)}))).length>0?((t=this.queue).push.apply(t,e),this.scheduleFlush()):this.attempt=1,[3,4];case 4:return[2]}}
1))}))},e.prototype.postHandle=function(e,t){if("strict"===this.cookiePolicy||"comply"===this.cookiePolicy){if(200===e){var n=t;if("string"===typeof t&&(n=JSON.parse(t)),!n.delete_cookie)return}this.userIdPersistence.delete(),this.propsPersistance.delete(),w(this.idCookieName)}if(200===e){n=t;if("string"===typeof t&&t.length>0){var r=(n=JSON.parse(t)).jitsu_sdk_extras;if(r&&r.length>0)if(p())for(var o=0,i=r;o<i.length;o++){var s=i[o],a=s.type,c=s.id,l=s.value;if("tag"===a){var d=document.createElement("div");d.id=c,y(d,l),d.childElementCount>0&&document.body.appendChild(d)}}else u().error("Tags destination supported only in browser environment")}}},e.prototype.getCtx=function(e){var t=new Date,n=e.describeClient()||{},o=r({},this.userProperties),i=o.company||{};delete o.company;var s=r(r({event_id:"",user:r({anonymous_id:"strict"!==this.cookiePolicy?e.getAnonymousId({name:this.idCookieName,domain:this.cookieDomain}):""},o),ids:this._getIds(),utc_time:N(t.toISOString()),local_tz_offset:t.getTimezoneOffset()},n),function(e){var t={utm:{},click_id:{}};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n],o=x[n];o?t.utm[o]=r:S[n]&&(t.click_id[n]=r)}return t}(function(e){if(!e)return{};for(var t=e.length>0&&"?"===e.charAt(0)?e.substring(1):e,n={},r=("?"===t[0]?t.substr(1):t).split("&"),o=0;o<r.length;o++){var i=r[o].split("=");n[decodeURIComponent(i[0])]=decodeURIComponent(i[1]||"")}return n}(n.doc_search)));return Object.keys(i).length&&(s.company=i),s},e.prototype._getIds=function(){if(!p())return{};for(var e=function(e){if(void 0===e&&(e=!1),e&&f)return f;var t=g(document.cookie);return f=t,t}(!1),t={},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],i=o[0],s=o[1];this._3pCookies[i]&&(t["_"==i.charAt(0)?i.substr(1):i]=s)}return t},e.prototype.pathMatches=function(e,t){return new URL(t).pathname.match(new RegExp("^"+e.trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$"))},e.prototype.track=function(e,t){var n=this,r=t||{};u().debug("track event of type",e,r);var o=p()?xe.browser():xe.empty(),i=this.getCtx(o);if(this.config&&this.config.exclude&&this.config.exclude.length>1&&(null===i||void 0===i?void 0:i.url)&&this.config.exclude.split(",").some((function(e){return n.pathMatches(e.trim(),null===i||void 0===i?void 0:i.url)})))return void u().debug("Page is excluded from tracking");var s=t||{};"$autocapture"!==e&&"user_identify"!==e&&"pageview"!==e&&"$pageleave"!==e&&(s={event_attributes:t});var a=this.makeEvent(e,this.compatMode?"eventn":"usermaven",s);return this.sendJson(a)},e.prototype.init=function(e){var t,n,s,d,h,f=this;if(p()&&!e.force_use_fetch)e.fetch&&u().warn("Custom fetch implementation is provided to Usermaven. However, it will be ignored since Usermaven runs in browser"),this.transport=this.beaconApi?de:Se;else{if(!e.fetch&&!globalThis.fetch)throw new Error("Usermaven runs in Node environment. However, neither UsermavenOptions.fetch is provided, nor global fetch function is defined. \nPlease, provide custom fetch implementation. You can get it via node-fetch package");this.transport=(h=e.fetch||globalThis.fetch,function(e,t,n,s){return void 0===s&&(s=function(e,t){}),o(void 0,void 0,void 0,(function(){var o,a,c,l,p,d,f,v;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,h(e,{method:"POST",headers:r({Accept:"application/json","Content-Type":"application/json"},n||{}),body:t})];case 1:return o=i.sent(),[3,3];case 2:return a=i.sent(),u().error("Failed to send data to ".concat(e,": ").concat((null===a||void 0===a?void 0:a.message)||"unknown error"),t,a),s(-1,{}),[2];case 3:if(200!==o.status)return u().warn("Failed to send data to ".concat(e," (#").concat(o.status," - ").concat(o.statusText,")"),t),s(o.status,{}),[2];c={},l="",p=null!==(v=null===(f=o.headers)||void 0===f?void 0:f.get("Content-Type"))&&void 0!==v?v:"",i.label=4;case 4:return i.trys.push([4,6,,7]),[4,o.text()];case 5:return l=i.sent(),c=JSON.parse(l),[3,7];case 6:return d=i.sent(),u().error("Failed to parse ".concat(e," response. Content-type: ").concat(p," text: ").concat(l),d),[3,7];case 7:try{s(o.status,c)}catch(g){u().error("Failed to handle ".concat(e," response. Content-type: ").concat(p," text: ").concat(l),g)}return[2]}}
1))}))})}if(e.custom_headers&&"function"===typeof e.custom_headers?this.customHeaders=e.custom_headers:e.custom_headers&&(this.customHeaders=function(){return e.custom_headers}),"echo"===e.tracking_host&&(u().warn('jitsuClient is configured with "echo" transport. Outgoing requests will be written to console'),this.transport=he),e.ip_policy&&(this.ipPolicy=e.ip_policy),e.cookie_policy&&(this.cookiePolicy=e.cookie_policy),"strict"===e.privacy_policy&&(this.ipPolicy="strict",this.cookiePolicy="strict"),e.use_beacon_api&&navigator.sendBeacon&&(this.beaconApi=!0),"comply"===this.cookiePolicy&&this.beaconApi&&(this.cookiePolicy="strict"),e.log_level&&function(e){var t=a[e.toLocaleUpperCase()];t||(console.warn("Can't find log level with name ".concat(e.toLocaleUpperCase(),", defaulting to INFO")),t=a.INFO),c=l(t)}(e.log_level),this.initialOptions=e,u().debug("Initializing Usemaven Tracker tracker",e,le),e.key){if(this.compatMode=void 0!==e.compat_mode&&!!e.compat_mode,this.cookieDomain=e.cookie_domain||v(),this.trackingHost=function(e){for(;n="/",-1!==(t=e).indexOf(n,t.length-n.length);)e=e.substr(0,e.length-1);var t,n;return 0===e.indexOf("https://")||0===e.indexOf("http://")?e:"https://"+e}(e.tracking_host||"t.usermaven.com"),this.randomizeUrl=e.randomize_url||!1,this.apiKey=e.key,this.idCookieName=e.cookie_name||"__eventn_id_".concat(e.key),"strict"===this.cookiePolicy?this.propsPersistance=new ge:this.propsPersistance=p()?new ve(this.cookieDomain,this.idCookieName+"_props"):new ge,"strict"===this.cookiePolicy?this.userIdPersistence=new ge:this.userIdPersistence=p()?new ve(this.cookieDomain,this.idCookieName+"_usr"):new ge,this.propsPersistance){var g=this.propsPersistance.restore();g&&(this.permanentProperties=g,this.permanentProperties.globalProps=null!==(t=g.globalProps)&&void 0!==t?t:{},this.permanentProperties.propsPerEvent=null!==(n=g.propsPerEvent)&&void 0!==n?n:{}),u().debug("Restored persistent properties",this.permanentProperties)}this.propertyBlacklist=e.property_blacklist&&e.property_blacklist.length>0?e.property_blacklist:[];this.config=M({},{autocapture:!1,properties_string_max_length:null,property_blacklist:[],sanitize_properties:null},e||{},this.config||{},{token:this.apiKey}),u().debug("Default Configuration",this.config),this.manageAutoCapture(this.config),!1===e.capture_3rd_party_cookies?this._3pCookies={}:(e.capture_3rd_party_cookies||["_ga","_fbp","_ym_uid","ajs_user_id","ajs_anonymous_id"]).forEac
1h((function(e){return f._3pCookies[e]=!0})),e.ga_hook&&u().warn("GA event interceptor isn't supported anymore"),e.segment_hook&&function(e){var t=window;t.analytics||(t.analytics=[]);e.interceptAnalytics(t.analytics)}(this),p()&&(e.disable_event_persistence||(this.queue=new A("jitsu-event-queue"),this.scheduleFlush(0)),window.addEventListener("beforeunload",(function(){return f.flush()}))),this.retryTimeout=[null!==(s=e.min_send_timeout)&&void 0!==s?s:this.retryTimeout[0],null!==(d=e.max_send_timeout)&&void 0!==d?d:this.retryTimeout[1]],e.max_send_attempts&&(this.maxSendAttempts=e.max_send_attempts),this.initialized=!0}else u().error("Can't initialize Usemaven, key property is not set")},e.prototype.interceptAnalytics=function(e){var t=this,n=function(e){var n;try{var o=r({},e.payload);u().debug("Intercepted segment payload",o.obj);var i=e.integrations["Segment.io"];if(i&&i.analytics){var s=i.analytics;"function"===typeof s.user&&s.user()&&"function"===typeof s.user().id&&(o.obj.userId=s.user().id())}(null===(n=null===o||void 0===o?void 0:o.obj)||void 0===n?void 0:n.timestamp)&&(o.obj.sentAt=o.obj.timestamp);var a=e.payload.type();"track"===a&&(a=e.payload.event()),t._send3p("ajs",o,a)}catch(c){u().warn("Failed to send an event",c)}e.next(e.payload)};"function"===typeof e.addSourceMiddleware?(u().debug("Analytics.js is initialized, calling addSourceMiddleware"),e.addSourceMiddleware(n)):(u().debug("Analytics.js is not initialized, pushing addSourceMiddleware to callstack"),e.push(["addSourceMiddleware",n])),e.__en_intercepted=!0},e.prototype.restoreId=function(){if(this.userIdPersistence){var e=this.userIdPersistence.restore();e&&(this.userProperties=r(r({},e),this.userProperties))}},e.prototype.set=function(e,t){var n,o=null===t||void 0===t?void 0:t.eventType,i=void 0===(null===t||void 0===t?void 0:t.persist)||(null===t||void 0===t?void 0:t.persist);if(void 0!==o){var s=null!==(n=this.permanentProperties.propsPerEvent[o])&&void 0!==n?n:{};this.permanentProperties.propsPerEvent[o]=r(r({},s),e)}else this.permanentProperties.globalProps=r(r({},this.permanentProperties.globalProps),e);this.propsPersistance&&i&&this.propsPersistance.save(this.permanentProperties)},e.prototype.unset=function(e,t){d();var n=null===t||void 0===t?void 0:t.eventType,r=void 0===(null===t||void 0===t?void 0:t.persist)||(null===t||void 0===t?void 0:t.persist);n?this.permanentProperties.propsPerEvent[n]&&delete this.permanentProperties.propsPerEvent[n][e]:delete this.permanentProperties.globalProps[e],this.propsPersistance&&r&&this.propsPersistance.save(this.permanentProperties)},e.prototype.manageAutoCapture=function(e){if(u().debug("Auto Capture Status: ",this.config.autocapture),this.__autocapture_enabled=this.config.autocapture,this.__autocapture_enabled){ae.enabledForProject(this.apiKey,100,100)?ae.isBrowserSupported()?(u().debug("Autocapture enabled..."),ae.init(this,e)):(this.config.autocapture=!1,this.__autocapture_enabled=!1,u().debug("Disabling Automatic Event Collection because this browser is not supported")):(this.config.autocapture=!1,this.__autocapture_enabled=!1,u().debug("Not in active bucket: disabling Automatic Event Collection."))}},e.prototype.capture=function(e,t){var n,r;if(void 0===t&&(t={}),this.initialized)if(R(e)||"string"!==typeof e)console.error("No event name provided to usermaven.capture");else{var o={event:e+(t.$event_type?"_"+t.$event_type:""),properties:this._calculate_event_properties(e,t)};(null===(r=null===(n=(o=G(o,this.get_config("properties_string_max_length"))).properties)||void 0===n?void 0:n.autocapture_attributes)||void 0===r?void 0:r.tag_name)&&this.track("$autocapture",o.properties),"$scroll"===e&&this.track(e,o.properties)}else console.error("Trying to capture event before initialization")},e.prototype._calculate_event_properties=function(e,t){var n,r,o=t||{};if("$snapshot"===e||"$scroll"===e)return o;j(this.propertyBlacklist)?L(this.propertyBlacklist,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+this.propertyBlacklist);var i={},s=o.$elements||[];return s.length&&(i=s[0]),o.autocapture_attributes=i,o.autocapture_attributes.el_text=null!==(n=o.autocapture_attributes.$el_text)&&void 0!==n?n:"",o.autocapture_attributes.event_type=null!==(r=o.$event_type)&&void 0!==r?r:"",["$ce_version","$event_type","$initial_referrer","$initial_referring_domain","$referrer","$referring_domain","$elements"].forEach((function(e){delete o[e]})),delete o.autocapture_attributes.$el_text,delete o.autocapture_attributes.nth_child,delete o.autocapture_attributes.nth_of_type,o},e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.