!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var v=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",w={};function b(e,t){if(!w[e]){w[e]={};for(var n=0;n>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return k.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n>=1}else{for(i=1,r=0;r>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r>=1;0==--u&&(u=Math.pow(2,d),d++),h[a]=l++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r>=1}else{for(i=1,r=0;r>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r>=1;0==--u&&(u=Math.pow(2,d),d++)}for(i=2,r=0;r>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:k._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,i,o,s,a,c,u,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,_=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(o=0,a=Math.pow(2,2),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 2:return""}for(l[3]=u,i=u,d.push(u);;){if(p.index>e)return"";for(o=0,a=Math.pow(2,_),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(u=o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,_),_++),l[u])g=l[u];else{if(u!==h)return null;g=i+i.charAt(0)}d.push(g),l[h++]=i+g.charAt(0),i=g,0==--f&&(f=Math.pow(2,_),_++)}}},S={DEBUG:!1,LIB_VERSION:"1.29.1"},I=Array.prototype,O=Object.prototype,x=O.toString,A=O.hasOwnProperty,E="undefined"!=typeof window?window:{},F=E.navigator||{userAgent:""},P=E.document||{},$=F.userAgent,C=I.forEach,T=I.indexOf,M=Array.isArray,R={},q=function(){if(S.DEBUG&&!J(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r1?t-1:0),r=1;r0&&(t[n]=e)})),t},K="undefined"!=typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function ee(e,t,n){return e!==Object(e)?t?t(e,n):e:e[K]?void 0:(e[K]=!0,H(e)?(r=[],L(e,(function(e){r.push(ee(e,t))}))):(r={},B(e,(function(e,n){n!==K&&(r[n]=ee(e,t,n))}))),delete e[K],r);var r}var te=["$performance_raw"];function ne(e,t){return ee(e,(function(e,n){return n&&te.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e}))}function re(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=oe(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},se=(ie=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e=(window.screen.height*window.screen.width).toString(16);return ie()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=$,r=0,i=[];function o(e,t){var n,r=0;for(n=0;n=4&&(r=o(r,i),i=[]);return i.length>0&&(r=o(r,i)),r.toString(16)}()+"-"+e+"-"+ie()}),ae=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog)/i.test(e)},ce=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(e){j("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ue=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},le=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,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(window.event)){var o,s=!0;W(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else j("No valid element provided to register_event")}}(),de={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return B(e,(function(e){var n=ce(P.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=de.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=ce(e,n);i.length&&(r.ph_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||Q(e," OPR/")?Q(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Q(e,"IEMobile")||Q(e,"WPDesktop")?"Internet Explorer Mobile":Q(e,"SamsungBrowser/")?"Samsung Internet":Q(e,"Edge")||Q(e,"Edg/")?"Microsoft Edge":Q(e,"FBIOS")?"Facebook Mobile":Q(e,"Chrome")?"Chrome":Q(e,"CriOS")?"Chrome iOS":Q(e,"UCWEB")||Q(e,"UCBrowser")?"UC Browser":Q(e,"FxiOS")?"Firefox iOS":Q(t,"Apple")?Q(e,"Mobile")?"Mobile Safari":"Safari":Q(e,"Android")?"Android Mobile":Q(e,"Konqueror")?"Konqueror":Q(e,"Firefox")?"Firefox":Q(e,"MSIE")||Q(e,"Trident/")?"Internet Explorer":Q(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[de.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},os:function(){var e=$;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return U(Y({$os:de.os(),$browser:de.browser($,F.vendor,window.opera),$device:de.device($),$device_type:de.deviceType($)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:de.browserVersion($,F.vendor,window.opera),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return U(Y({$os:de.os(),$browser:de.browser($,F.vendor,window.opera)}),{$browser_version:de.browserVersion($,F.vendor,window.opera)})}};function pe(e){switch(n(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function fe(e){var t="";return me(e)&&!we(e)&&e.childNodes&&e.childNodes.length&&B(e.childNodes,(function(e){ge(e)&&e.textContent&&(t+=D(e.textContent).split(/(\s+)/).filter(be).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),D(t)}function he(e){return!!e&&1===e.nodeType}function _e(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ge(e){return!!e&&3===e.nodeType}function ve(e){return!!e&&11===e.nodeType}var ye=["a","button","form","input","select","textarea","label"];function me(e){for(var t=e;t.parentNode&&!_e(t,"body");t=t.parentNode){var n=pe(t).split(" ");if(Q(n,"ph-sensitive")||Q(n,"ph-no-capture"))return!1}if(Q(pe(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if("string"==typeof i){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function we(e){return!!(_e(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_e(e,"select")||_e(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function be(e){if(null===e||J(e))return!1;if("string"==typeof e){e=D(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}function ke(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.getElementsByTagName("script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}var Se=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.get_config("rageclick");r(this,e),this.clicks=[],this.instance=t,this.enabled=n}return o(e,[{key:"click",value: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}(),Ie={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!he(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};ye.indexOf(r)>-1&&!n&&(i.$el_text=fe(e));var o=pe(e);o.length>0&&(i.classes=o.split(" ").filter((function(e){return""!==e}))),B(e.attributes,(function(n){var r;we(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&be(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return B(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),be(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return B(this._customProperties,(function(r){B(r.event_selectors,(function(i){B(document.querySelectorAll(i),(function(i){Q(e,i)&&me(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=this._getEventTarget(e);(ge(i)&&(i=i.parentNode||null),"click"===e.type&&e instanceof MouseEvent)&&(null===(n=this.rageclicks)||void 0===n||n.click(e.clientX,e.clientY,(new Date).getTime()));if(i&&function(e,t){if(!e||_e(e,"html")||!he(e))return!1;for(var n=!1,r=[e],i=!0,o=e;o.parentNode&&!_e(o,"body");)if(ve(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{if(!(i=o.parentNode||!1))break;if(ye.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var s=window.getComputedStyle(i);s&&"pointer"===s.getPropertyValue("cursor")&&(n=!0)}r.push(i),o=i}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&&(ye.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e)){for(var o=[i],s=i;s.parentNode&&!_e(s,"body");)ve(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var a,c=[],u=!1;if(B(o,(function(e){var n=me(e);"a"===e.tagName.toLowerCase()&&(a=e.getAttribute("href"),a=n&&be(a)&&a),Q(pe(e).split(" "),"ph-no-capture")&&(u=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")))})),t.get_config("mask_all_text")||(c[0].$el_text=fe(i)),a&&(c[0].attr__href=a),u)return!1;var l=U(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o));return t.capture("$autocapture",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};le(document,"submit",n,!1,!0),le(document,"change",n,!1,!0),le(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,init:function(e){this.rageclicks=new Se(e)},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?q('autocapture already initialized for token "'+n+'"'):(this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&t.get_config("autocapture")?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture_enabled=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=J(t)?10:t,n=J(n)?10:n;for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"receivedFeatureFlags",value:function(e){!function(e,t){var n=e.featureFlags;if(n)if(Array.isArray(n)){var r={};if(n)for(var i=0;i10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],r=0;r2e3?t.push(e.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[r]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===n(e)){var t=JSON.stringify(e);if(t.length>5e6){var r,i=g(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(i.s();!(r=i.n()).done;){var o=r.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(e){i.e(e)}finally{i.f()}}return JSON.parse(t)}return e}(e)),r._updateWindowAndSessionIds(e);var t={$snapshot_data:e,$session_id:r.sessionId,$window_id:r.windowId};r.instance._captureMetrics.incr("rrweb-record"),r.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),r.emit?r._captureSnapshot(t):r.snapshots.push(t)},plugins:window.rrwebConsoleRecord&&this.instance.get_config("enable_recording_console_log")?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},i)),this.instance._addCaptureHook((function(e){var t;"$pageview"===e&&(null===(t=r.rrwebRecord)||void 0===t||t.addCustomEvent("$pageview",{href:window.location.href}))}))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===nt}})}}]),e}(),st=function(){function e(t){r(this,e),this.instance=t,this.instance.decideEndpointWasHit=!1}return o(e,[{key:"call",value:function(){var e=this,t=re(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=2"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Ie.afterDecideResponse(e,this.instance),this.instance.featureFlags.receivedFeatureFlags(e),e.supportedCompression){var r,i={},o=g(e.supportedCompression);try{for(o.s();!(r=o.n()).done;){i[r.value]=!0}}catch(e){o.e(e)}finally{o.f()}this.instance.compression=i}else this.instance.compression={}}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),at=function(){function e(t){r(this,e),this.instance=t}return o(e,[{key:"afterDecideResponse",value:function(e){var n=e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this._loadEditor(t(t({},n),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(e){return!1}t=window.localStorage}var r,i=ue(e.hash,"__posthog")||ue(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null,s=o&&("mpeditor"===o.action||"ph_authorize"===o.action);return s?(r=o)&&Object.keys(r).length>0&&(t.setItem("_postHogEditorParams",JSON.stringify(r)),o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash=""):delete(r=JSON.parse(t.getItem("_postHogEditorParams")||"{}")).userIntent,r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this._loadEditor(r),!0)}catch(e){return!1}}},{key:"_loadEditor",value:function(e){var n=this;if(!window._postHogToolbarLoaded){window._postHogToolbarLoaded=!0;var r=e.jsURL||e.apiURL||this.instance.get_config("api_host"),i=r+(r.endsWith("/")?"":"/")+"static/toolbar.js?_ts="+(new Date).getTime(),o="https://app.posthog.com"!==this.instance.get_config("api_host")&&this.instance.get_config("advanced_disable_toolbar_metrics");return e=t(t({},e),o?{instrument:!1}:{}),ke(i,(function(){window.ph_load_editor(e,n.instance)})),le(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,n._loadEditor(e)})),!0}return!1}}]),e}(),ct=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;r(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return o(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),ut=function(e){a(i,e);var n=d(i);function i(e,t){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return r(this,i),(o=n.call(this,s)).handlePollRequest=t,o.captureMetrics=e,o}return o(i,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;B(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){clearTimeout(this._poller);var e=this._event_queue.length>0?this.formatQueue():{};for(var n in this._event_queue.length=0,e){var r=e[n],i=r.url,o=r.data,s=r.options;this.handlePollRequest(i,o,t(t({},s),{},{transport:"sendBeacon"}))}}},{key:"formatQueue",value:function(){var e={};return B(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),i}(ct),lt=function(){function e(t){r(this,e),this.enabled=t,this.metrics={}}return o(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),dt=Uint8Array,pt=Uint16Array,ft=Uint32Array,ht=new dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_t=new dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gt=new dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vt=function(e,t){for(var n=new pt(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&St)<<1;It=(61680&(It=(52428&It)>>>2|(13107&It)<<2))>>>4|(3855&It)<<4,kt[St]=((65280&It)>>>8|(255&It)<<8)>>>1}var Ot=function(e,t,n){for(var r=e.length,i=0,o=new pt(t);i>>c]=u}else for(s=new pt(r),i=0;i>>15-e[i];return s},xt=new dt(288);for(St=0;St<144;++St)xt[St]=8;for(St=144;St<256;++St)xt[St]=9;for(St=256;St<280;++St)xt[St]=7;for(St=280;St<288;++St)xt[St]=8;var At=new dt(32);for(St=0;St<32;++St)At[St]=5;var Et,Ft=Ot(xt,9,0),Pt=Ot(At,5,0),$t=function(e){return(e/8>>0)+(7&e&&1)},Ct=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof pt?pt:e instanceof ft?ft:dt)(n-t);return r.set(e.subarray(t,n)),r},Tt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Mt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Rt=function(e,t){for(var n=[],r=0;rp&&(p=o[r].s);var f=new pt(p+1),h=qt(n[l-1],f,0);if(h>t){r=0;var _=0,g=h-t,v=1<t))break;_+=v-(1<>>=g;_>0;){var m=o[r].s;f[m]=0&&_;--r){var w=o[r].s;f[w]==t&&(--f[w],++_)}h=t}return[new dt(f),h]},qt=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},jt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pt(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Nt=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o4&&!x[gt[E-1]];--E);var F,P,$,C,T=u+5<<3,M=Nt(i,xt)+Nt(o,At)+s,R=Nt(i,p)+Nt(o,_)+s+14+3*E+Nt(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(T<=M&&T<=R)return Dt(t,l,e.subarray(c,c+u));if(Tt(t,l,1+(R15&&(Tt(t,l,D[I]>>>5&127),l+=D[I]>>>12)}}}else F=Ft,P=xt,$=Pt,C=At;for(I=0;I255){B=r[I]>>>18&31;Mt(t,l,F[B+257]),l+=P[B+257],B>7&&(Tt(t,l,r[I]>>>23&31),l+=ht[B]);var L=31&r[I];Mt(t,l,$[L]),l+=C[L],L>3&&(Mt(t,l,r[I]>>>5&8191),l+=_t[L])}else Mt(t,l,F[r[I]]),l+=P[r[I]];return Mt(t,l,F[256]),l+P[256]},Lt=new ft([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ut=new dt(0),Ht=function(){for(var e=new ft(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Wt=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new dt(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d>>13,h=8191&p,_=(1<7e3||x>24576)&&C>423){u=Bt(e,c,0,b,k,S,O,x,E,l-E,u),x=I=O=0,E=l;for(var T=0;T<286;++T)k[T]=0;for(T=0;T<30;++T)S[T]=0}var M=2,R=0,q=h,j=P-$&32767;if(C>2&&F==w(l-j))for(var N=Math.min(f,C)-1,D=Math.min(32767,l),B=Math.min(258,C);j<=D&&--q&&P!=$;){if(e[l+M]==e[l+M-j]){for(var L=0;LM){if(M=L,R=j,L>N)break;var U=Math.min(j,L-2),H=0;for(T=0;TH&&(H=Q,$=W)}}}j+=(P=$)-($=g[P])+32768&32767}if(R){b[x++]=268435456|wt[M]<<18|bt[R];var G=31&wt[M],J=31&bt[R];O+=ht[G]+_t[J],++k[257+G],++S[J],A=l+M,++I}else b[x++]=e[l],++k[e[l]]}}u=Bt(e,c,o,b,k,S,O,x,E,l-E,u),o||(u=Dt(c,u,Ut))}return Ct(a,0,r+$t(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Qt=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Gt(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=Wt(e,t,10+((i=t).filename&&i.filename.length+1||0),8),s=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Qt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),Qt(o,s-8,n.d()),Qt(o,s-4,r),o}function Jt(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new dt(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;sr.length){var a=new dt(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Ct(r,0,i)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(Et||(Et={}));var zt=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=S.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,s=g(i[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];r[a]&&delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var c=e.indexOf("?")>-1?"&":"?";return e+c+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return B(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(r)},Vt=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if("POST"!==n.method)return null;var i,o;return i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},Zt=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,u=e.onXHRError,l=new XMLHttpRequest;l.open(i.method||"GET",t,!0);var d=Vt(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),B(r,(function(e,t){l.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.withCredentials=!0,l.onreadystatechange=function(){if(4===l.readyState)if(o.incr("xhr-response"),o.incr("xhr-response-".concat(l.status)),o.decr("_send_request_inflight"),200===l.status){if(s){var e;try{e=JSON.parse(l.responseText)}catch(e){return void j(e)}s(e)}}else"function"==typeof u&&u(l),[401,403,404,500].indexOf(l.status)<0&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})},l.send(d)},Xt=function(e){a(i,e);var n=d(i);function i(e,t){var o;return r(this,i),(o=n.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=t,"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return o(i,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;try{window.navigator.sendBeacon(i,Vt(o,t(t({},s),{},{sendBeacon:!0})))}catch(e){S.DEBUG&&console.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;Zt({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),i}(ct),Yt=18e5,Kt=864e5,en=function(){function e(t,n){r(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,t.persistence_name?this.window_id_storage_key="ph_"+t.persistence_name+"_window_id":this.window_id_storage_key="ph_"+t.token+"_window_id"}return o(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&Te.is_supported()&&Te.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&Te.is_supported()?Te.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(s({},Ye,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props.$sesid;return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||(new Date).getTime(),r=this._getSessionId(),i=p(r,3),o=i[0],s=i[1],a=i[2],c=this._getWindowId(),u=a&&a>0&&Math.abs(n-a)>Kt;!s||!e&&Math.abs(n-o)>Yt||u?(s=se(),c=se(),a=n):c||(c=se());var l=0===o||!e||u?n:o,d=0===a?(new Date).getTime():a;return this._setWindowId(c),this._setSessionId(s,l,d),{sessionId:s,windowId:c}}}]),e}();function tn(e){return e.forEach((function(t,n){for(var r in t){var i=r;o=t[i],Number(o)===o&&o%1!=0&&t[i].toString().match(/^\d+\.\d{4,}$/)&&(e[n][i]=Number(t[i].toFixed(3))),"serverTiming"===i&&0===t[i].length&&delete e[n][i],"entryType"===i&&"resource"===t[i]&&delete e[n][i],"nextHopProtocol"===i&&delete e[n][i],0===t[i]&&delete e[n][i]}var o})),function(e){if(0===e.length)return[];var t=Object.keys(e[0]);return[t,e.map((function(e){return t.map((function(t){return e[t]}))}))]}(e)}function nn(e){try{return tn(JSON.parse(JSON.stringify(E.performance.getEntriesByType(e))))}catch(t){return S.DEBUG&&console.warn("not able to capture performance data ("+e+") - "+t),[]}}var rn,on,sn,an=o((function e(t,n,i,o){r(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={}),e.tags["PostHog Person URL"]=t.config.api_host+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.config.api_host+"/recordings/#sessionRecordingId="+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var r={$sentry_event_id:e.event_id,$sentry_exception:e.exception};return n&&i&&(r.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+e.event_id),t.capture("$exception",r),e}))}}));!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(rn||(rn={}));var cn=function(){},un={},ln="posthog",dn=E.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,pn=!dn&&-1===$.indexOf("MSIE")&&-1===$.indexOf("Mozilla"),fn=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",token:"",autocapture:!0,rageclick:!1,cross_subdomain_cookie:-1===(null==P||null===(e=P.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:cn,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:!1,secure_cookie:"https:"===(null==E||null===(n=E.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:cn,_capture_metrics:!1,_capture_performance:!1,name:"posthog",callback_fn:"posthog._jsc"}},hn=function(e,t,n){var r,i=n!==ln&&sn?n?sn[n]:void 0:sn;if(i&&on===rn.INIT_MODULE)r=i;else{if(i&&!H(i))return void console.error("You have already initialized "+n);r=new _n}if(r._init(e,t,n),r.toolbar.maybeLoadEditor(),r.sessionRecording=new ot(r),r.sessionRecording.startRecordingIfEnabled(),r.__autocapture_enabled=r.get_config("autocapture"),r.get_config("autocapture")){Ie.enabledForProject(r.get_config("token"),100,100)?Ie.isBrowserSupported()?Ie.init(r):(r.__autocapture_enabled=!1,q("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture_enabled=!1,q("Not in active bucket: disabling Automatic Event Collection."))}return S.DEBUG=S.DEBUG||r.get_config("debug"),void 0!==i&&H(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r},_n=function(){function e(){r(this,e),this.config=fn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=an,this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__autocapture_enabled=void 0,this._jsc=function(){},this.people=new Ge(this),this.featureFlags=new Je(this),this.feature_flags=this.featureFlags,this.toolbar=new at(this),this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return o(e,[{key:"init",value:function(e,t,n){if(J(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==ln){var r=hn(e,t,n);return sn[n]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(U({},fn(),t,{name:n,token:e,callback_fn:(n===ln?n:"posthog."+n)+"._jsc"})),this._jsc=function(){},this._captureMetrics=new lt(this.get_config("_capture_metrics")),this._requestQueue=new ut(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new Xt(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new tt(this.config),this.sessionManager=new en(this.config,this.persistence),this._gdpr_init(),!this.get_distinct_id()){var r=this.get_config("get_device_id")(se());this.register_once({distinct_id:r,$device_id:r},"")}E.addEventListener&&E.addEventListener("unload",this._handle_unload.bind(this))}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new st(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||L(this.__request_queue,(function(t){e._send_request.apply(e,f(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(J(e))return null;if(dn)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||un,cn)}},{key:"__compress_and_send_json_request",value:function(e,n,r,i){var o,s=function(e,n,r){return e===Et.LZ64?[{data:k.compressToBase64(n),compression:Et.LZ64},r]:e===Et.GZipJS?[Gt(Jt(n),{mtime:0}),t(t({},r),{},{blob:!0,urlQueryArgs:{compression:Et.GZipJS}})]:[{data:re(n)},r]}((o=this.compression)[Et.GZipJS]?Et.GZipJS:o[Et.LZ64]?Et.LZ64:Et.Base64,n,r),a=p(s,2),c=a[0],u=a[1];this._send_request(e,c,u,i)}},{key:"_send_request",value:function(e,n,r,i){if(pn)this.__request_queue.push([e,n,r,i]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=U(o,r||{}),dn||(r.method="GET");var s="sendBeacon"in E.navigator&&"sendBeacon"===r.transport;if(e=zt(e,r.urlQueryArgs||{},{ip:this.get_config("ip")}),G(n)&&this.get_config("img")){var a=P.createElement("img");a.src=e,P.body.appendChild(a)}else if(s)try{E.navigator.sendBeacon(e,Vt(n,t(t({},r),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(dn)try{Zt({url:e,data:n,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var c,u=P.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=P.getElementsByTagName("script")[0];null===(c=l.parentNode)||void 0===c||c.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];L(e,(function(e){e&&(t=e[0],H(t)?o.push(e):"function"==typeof e?e.call(n):H(e)&&"alias"===t?r.push(e):H(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))}));var s=function(e,t){L(e,(function(e){if(H(e[0])){var n=t;B(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:un;if(this.__loaded&&!He(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||un).transport;if(r&&(n.transport=r),J(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!ae($)){var i=this.persistence.remove_event_timer(e);this.persistence.update_search_keyword(P.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(P.referrer);var o={event:e,properties:this._calculate_event_properties(e,t||{},i)};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=ne(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&q("PostHog.js send",o);var s=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),c=n!==un;return!this.get_config("request_batching")||c&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,s,n):this._requestQueue.enqueue(a,o,n),this._invokeCaptureHooks(e,o),o}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),B(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,r,i){var o=t({},r);if(o.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return o.distinct_id=s.distinct_id,o}if(void 0!==i){var a=(new Date).getTime()-i;o.$duration=parseFloat((a/1e3).toFixed(3))}if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),u=c.sessionId,l=c.windowId;o.$session_id=u,o.$window_id=l}o=U({},de.properties(),this.persistence.properties(),o),"$pageview"===e&&this.get_config("_capture_performance")&&(o=U(o,function(){var e={navigation:nn("navigation"),paint:nn("paint"),resource:nn("resource")};void 0!==n(E)&&E.performance&&E.performance.clearResourceTimings&&E.performance.clearResourceTimings();var t={},r=function(e){var t=e.navigation&&e.navigation[0],n=e.navigation&&e.navigation[1]&&e.navigation[1][0],r=t&&t.indexOf("duration");if(r>-1)return n[r];var i=t&&t.indexOf("loadEventEnd"),o=t&&t.indexOf("startTime");return i>-1?(n&&n[i])-(n&&n[o]||0):void 0}(e);return r&&(t.$performance_page_loaded=r),t.$performance_raw=JSON.stringify(e),t}()));var d=this.get_config("property_blacklist");H(d)?B(d,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+d);var p=this.get_config("sanitize_properties");return p&&(o=p(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(s({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Ve)&&(this.unregister(Ve),this.register({distinct_id:e})),e===r||this.get_property("$device_id")&&r!==this.get_property("$device_id")?(t&&this.people.set(t),n&&this.people.set_once(n)):(this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,n,r){if(e&&n){this._captureMetrics.incr("group");var i=this.getGroups();this.register({$groups:t(t({},i),{},s({},e,n))}),r&&this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),i[e]!==n&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(se());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(ze)?(N("Attempting to create alias for existing People user - aborting."),-2):(J(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ve,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var n=t({},this.config);G(e)&&(U(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ee.is_supported()&&"true"===Ee.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(S.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:ln;return t!==ln&&(t="posthog."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&Ee.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!xe.get("ph_optout")||(xe.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=U({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),Ee.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=U({enable_persistence:!0},e||{}),this._gdpr_call_func(Me,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=U({clear_persistence:!0},e||{});this._gdpr_call_func(Re,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(qe,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(je,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=U({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Ne,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(E.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(E.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return k.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n