posthog-js 1.53.2 → 1.53.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(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))}function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var O,x,E=1,T=new RegExp("[^a-z0-9-_:]"),M=-2;function F(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(R).join(""):null}catch(e){return null}}function R(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=F(e.styleSheet)||t}catch(e){}return t}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(P,(function(e,n,r,o,i,a){var s,u=r||i||a,c=n||o||"";if(!u)return e;if(!N.test(u))return"url("+c+u+c+")";if(A.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var D,$,j,q,B,H,U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?V(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(W),!(n>=t.length);){var i=r(U);if(","===i.slice(-1))i=V(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=V(e,i);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?L(r,z()):"object"===t&&"data"===n&&r?V(e,r):r:V(e,r)}function Q(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!(!n||!e.matches(n))||Q(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Q(e.parentNode,t,n)}function J(t,n){var r,o,i,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;o=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,u,c),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),M={},R=0,P=Array.from(t.attributes);R<P.length;R++){var N=P[R],A=N.name,D=N.value;M[A]=G(s,E,A,D)}if("link"===E&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=F($)),j&&(delete M.rel,delete M.href,M._cssText=L(j,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=F(t.sheet))&&(M._cssText=L(j,z()));if("input"===E||"textarea"===E||"select"===E){D=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&D?M.value=C({type:M.type,tagName:E,value:D,maskInputOptions:h,maskInputFn:g}):t.checked&&(M.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?M.selected=!0:delete M.selected),"canvas"===E&&b)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=I in o?o[I]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var q=t.toDataURL(_.type,_.quality),B=document.createElement("canvas");B.width=t.width,B.height=t.height,q!==B.toDataURL(_.type,_.quality)&&(M.rr_dataURL=q)}if("img"===E&&y){O||(O=s.createElement("canvas"),x=O.getContext("2d"));var H=t,U=H.crossOrigin;H.crossOrigin="anonymous";var W=function(){try{O.width=H.naturalWidth,O.height=H.naturalHeight,x.drawImage(H,0,0),M.rr_dataURL=O.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}U?M.crossOrigin=U:delete M.crossOrigin};H.complete&&0!==H.naturalWidth?W():H.onload=W}if("audio"!==E&&"video"!==E||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),S){var V=t.getBoundingClientRect(),J=V.width,X=V.height;M={class:M.class,rr_width:J+"px",rr_height:X+"px"}}return"iframe"!==E||w(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:E,attributes:M,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:o};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,Y=t.textContent,K="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(K&&Y){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(Y=(i=t.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}Y=L(Y,z())}return ee&&(Y="SCRIPT_PLACEHOLDER"),!K&&!ee&&Q(t,l,d)&&Y&&(Y=v?v(Y):Y.replace(/[\S]/g,"*")),{type:e.Text,textContent:Y||"",isStyle:K,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function X(e){return void 0===e?"":e.toLowerCase()}function Z(t,n){var r,o=n.doc,i=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,C=n.recordCanvas,I=void 0!==C&&C,O=n.onSerialize,x=n.onIframeLoad,T=n.iframeLoadTimeout,F=void 0===T?5e3:T,R=n.keepIframeSrcFn,P=void 0===R?function(){return!1}:R,N=n.preserveWhiteSpace,A=void 0===N||N,L=J(t,{doc:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:P});if(!L)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(X(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(t.attributes.name)||"icon"===X(t.attributes.rel)||"apple-touch-icon"===X(t.attributes.rel)||"shortcut icon"===X(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&X(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(X(t.attributes.property).match(/^(og|twitter|fb):/)||X(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===X(t.attributes.name)||"googlebot"===X(t.attributes.name)||"bingbot"===X(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===X(t.attributes.name)||"generator"===X(t.attributes.name)||"framework"===X(t.attributes.name)||"publisher"===X(t.attributes.name)||"progid"===X(t.attributes.name)||X(t.attributes.property).match(/^article:/)||X(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===X(t.attributes.name)||"yandex-verification"===X(t.attributes.name)||"csrf-token"===X(t.attributes.name)||"p:domain_verify"===X(t.attributes.name)||"verify-v1"===X(t.attributes.name)||"verification"===X(t.attributes.name)||"shopify-checkout-api-token"===X(t.attributes.name)))return!0}}return!1}(L,_)&&(A||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:M;var D=Object.assign(L,{id:r});if(t.__sn=D,r===M)return null;i[r]=t,O&&O(t);var $=!d;if(D.type===e.Element&&($=$&&!D.needBlock,delete D.needBlock,t.shadowRoot&&(D.isShadowHost=!0)),(D.type===e.Document||D.type===e.Element)&&$){_.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(A=!1);for(var j={doc:o,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:P},q=0,B=Array.from(t.childNodes);q<B.length;q++){(W=Z(B[q],j))&&D.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var H=0,U=Array.from(t.shadowRoot.childNodes);H<U.length;H++){var W;(W=Z(U[H],j))&&(W.isShadow=!0,D.childNodes.push(W))}}return t.parentNode&&S(t.parentNode)&&(D.isShadow=!0),D.type===e.Element&&"iframe"===D.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&x){var n=Z(e,{doc:e,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:P});n&&x(t,n)}}),F),D}function Y(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(D||(D={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}($||($={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(j||(j={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(q||(q={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(B||(B={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(H||(H={}));var K="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ee={map:{},getId:function(){return console.error(K),-1},getNode:function(){return console.error(K),null},removeNodeFromMap:function(){console.error(K)},has:function(){return console.error(K),!1},reset:function(){console.error(K)}};function te(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function ne(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return ne(e,t,i||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===M}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function pe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(K),Reflect.get(e,t,n)}}));var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var a=[],s=new fe,u=function(t){for(var n=t,r=M;r===M;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,o,i,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(o=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===o?void 0:o.host;)d=(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=Z(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){le(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;_e(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;ye(e.droppedSet,p)||_e(e.removes,p,e.mirror)?ye(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,o,i,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:Q(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(l.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(me(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,o)]?me(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function me(e,t){e.delete(t),t.childNodes.forEach((function(t){return me(e,t)}))}function _e(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||_e(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,we=[],ke="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function Oe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function xe(e,t){var n,r,o=new be;we.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ee(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(j).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var i=e.toLowerCase(),a=function(e){return function(n){var i=Oe(n);if(!ae(i,o)){var a=ce(n)?n.changedTouches[0]:n;if(a){var s=r.getId(i),u=a.clientX,c=a.clientY;t({type:j[e],id:s,x:u,y:c})}}}}(e);s.push(Y(i,a,n))})),function(){s.forEach((function(e){return e()}))}}function Te(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return Y("scroll",te((function(e){var i=Oe(e);if(i&&!ae(i,o)){var a=r.getId(i);if(i===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Me(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Fe=["INPUT","TEXTAREA","SELECT"],Re=new WeakMap;function Pe(e){return function(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,i){var a,s;void 0===i&&(i={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];t.mutation&&t.mutation.apply(t,o([],r(e),!1)),n.apply(void 0,o([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o([],r(e),!1)),i.apply(void 0,o([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o([],r(e),!1)),a.apply(void 0,o([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o([],r(e),!1)),s.apply(void 0,o([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o([],r(e),!1)),u.apply(void 0,o([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o([],r(e),!1)),c.apply(void 0,o([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o([],r(e),!1)),l.apply(void 0,o([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o([],r(e),!1)),d.apply(void 0,o([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o([],r(e),!1)),p.apply(void 0,o([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o([],r(e),!1)),f.apply(void 0,o([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o([],r(e),!1)),h.apply(void 0,o([],r(e),!1))}}(e,i);var c=xe(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=te((function(e){var n=Date.now()-i;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],i=null}),s),l=te((function(e){var t=Oe(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=Date.now()),u.push({x:r,y:a,id:o.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[Y("mousemove",l,r),Y("touchmove",l,r),Y("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Ee(e),p=Te(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return Y("resize",te((function(){var e=oe(),o=ie();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(e),h=function(e){var n=e.inputCb,i=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Oe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Fe.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var o=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(o=C({maskInputOptions:c,tagName:t.tagName,type:r,value:o,maskInputFn:l})),h(t,Me({text:o,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&i.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Me({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var o=Re.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Re.set(e,r);var i=a.getId(e);n(t(t({},r),{id:i}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return Y(e,f,i)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,o([],r(m.map((function(e){return ne(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,o=e.sampling,i=function(e){return te((function(o){var i=Oe(o);if(i&&!ae(i,n)){var a=i,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(i),currentTime:s,volume:u,muted:c})}}),o.media||500)},a=[Y("play",i(0)),Y("pause",i(1)),Y("seeked",i(2)),Y("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=i.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=i.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};ke?c.CSSGroupingRule=a.CSSGroupingRule:(Se&&(c.CSSMediaRule=a.CSSMediaRule),Ie&&(c.CSSConditionRule=a.CSSConditionRule),Ce&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=i.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:o(o([],r(Pe(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=i.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:o(o([],r(Pe(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=l[n].insertRule,o.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:o},index:Pe(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=r.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&n({id:i,remove:{property:e},index:Pe(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){we.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Ae=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),Le=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){xe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Te(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),je=0;je<De.length;je++)$e[De.charCodeAt(je)]=je;var qe=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=De[n[t]>>2],o+=De[(3&n[t])<<4|n[t+1]>>4],o+=De[(15&n[t+1])<<2|n[t+2]>>6],o+=De[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Be=new Map;var He=function(e,t,n){if(e&&(Ve(e,t)||"object"===s(e))){var r=function(e,t){var n=Be.get(e);return n||(n=new Map,Be.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function Ue(e,t,n){return e instanceof Array?e.map((function(e){return Ue(e,t,n)})):null===e?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:qe(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}:Ve(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:He(e,t,n)}:e}var We=function(e,t,n){return o([],r(e),!1).map((function(e){return Ue(e,t,n)}))},Ve=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,i,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=re(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(He(p,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var f=We(o([],r(l),!1),u,e),h={type:t,property:n,args:f};i(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=ne(e,n,{set:function(e){i(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ge,Qe,Je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=function(e,t){var n=[];try{var i=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,o([n],r(i),!1))}}));n.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,i,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,i)||setTimeout((function(){var t=o([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var i=t[0],u=i.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,i.width,i.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:q["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:q["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,i){var a=[];return a.push.apply(a,o([],r(ze(t.WebGLRenderingContext.prototype,q.WebGL,e,n,i,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,o([],r(ze(t.WebGL2RenderingContext.prototype,q.WebGL2,e,n,i,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){i(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=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}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Xe(e){return t(t({},e),{timestamp:Date.now()})}var Ze={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ye(e){void 0===e&&(e={});var o=e.emit,i=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,O=e.sampling,x=void 0===O?{}:O,E=e.mousemoveWait,T=e.recordCanvas,M=void 0!==T&&T,F=e.userTriggeredOnInput,R=void 0!==F&&F,P=e.collectFonts,N=void 0!==P&&P,A=e.inlineImages,L=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,B=void 0===q?function(){return!1}:q;if(!o)throw new Error("emit function is required");void 0!==E&&void 0===x.mousemove&&(x.mousemove=E);var H,U=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ge=function(e,t){var r;if(!(null===(r=we[0])||void 0===r?void 0:r.isFrozen())||e.type===D.FullSnapshot||e.type===D.IncrementalSnapshot&&e.data.source===$.Mutation||we.forEach((function(e){return e.unfreeze()})),o(function(e){var t,r;try{for(var o=n(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===D.FullSnapshot)H=e,V=0;else if(e.type===D.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=i&&e.timestamp-H.timestamp>i;(s||u)&&Qe(!0)}};var z=function(e){Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},Q=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},J=new Ae({mutationCb:z}),X=new Je({recordCanvas:M,mutationCb:Q,win:window,blockClass:u,mirror:Ze}),K=new Le({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:U,maskTextFn:S,maskInputFn:k,recordCanvas:M,inlineImages:L,sampling:x,slimDOMOptions:W,iframeManager:J,canvasManager:X},mirror:Ze});Qe=function(e){var t,n,o,i;void 0===e&&(e=!1),Ge(Xe({type:D.Meta,data:{href:window.location.href,width:ie(),height:oe()}}),e),we.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,i=n.blockSelector,a=void 0===i?null:i,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,O=n.onIframeLoad,x=n.iframeLoadTimeout,E=n.keepIframeSrcFn,T={};return[Z(e,{doc:e,map:T,blockClass:o,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:O,iframeLoadTimeout:x,keepIframeSrcFn:void 0===E?function(){return!1}:E}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:U,maskTextFn:S,slimDOM:W,recordCanvas:M,inlineImages:L,onSerialize:function(e){le(e)&&J.addIframe(e),de(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),K.observeAttachShadow(e)},keepIframeSrcFn:B}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Ze.map=c,Ge(Xe({type:D.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),we.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(Y("DOMContentLoaded",(function(){Ge(Xe({type:D.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Xe({type:D.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:U,inlineStylesheet:_,sampling:x,recordCanvas:M,inlineImages:L,userTriggeredOnInput:R,collectFonts:N,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Ze,iframeManager:J,shadowDomManager:K,canvasManager:X,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Xe({type:D.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Qe(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(Y("load",(function(){Ge(Xe({type:D.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ye.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Xe({type:D.Custom,data:{tag:e,payload:t}}))},Ye.freezePage=function(){we.forEach((function(e){return e.freeze()}))},Ye.takeFullSnapshot=function(e){if(!Qe)throw new Error("please take full snapshot after start recording");Qe(e)},Ye.mirror=Ze;var Ke=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(tt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Ke({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ke({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Ke({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ke({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function ot(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function it(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=n(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(it(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1}function st(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(it(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(it(e)&&at(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=ot(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var ut={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function ct(e,t,i){var a,s,u,c=i.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(i.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,o=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(i.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,i.stringifyOptions)}));++l<i.lengthThreshold?e({level:n,trace:c,payload:d}):l===i.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,o(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var lt="undefined"!=typeof window?window:{};lt.rrweb={record:Ye,version:"v1",rrwebVersion:"1.1.3"},lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:ct,options:e?Object.assign({},ut,e):ut}}};var dt=String.fromCharCode,pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",ht={};function vt(e,t){if(!ht[e]){ht[e]={};for(var n=0;n<e.length;n++)ht[e][e.charAt(n)]=n}return ht[e][t]}var gt={compressToBase64:function(e){if(null==e)return"";var t=gt._compress(e,6,(function(e){return pt.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:gt._decompress(e.length,32,(function(t){return vt(pt,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":gt._compress(e,15,(function(e){return dt(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:gt._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=gt.compress(e),n=new Uint8Array(2*t.length),r=0,o=t.length;r<o;r++){var i=t.charCodeAt(r);n[2*r]=i>>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(e){if(null==e)return gt.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var o=[];return t.forEach((function(e){o.push(dt(e))})),gt.decompress(o.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":gt._compress(e,6,(function(e){return ft.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),gt._decompress(e.length,32,(function(t){return vt(ft,e.charAt(t))})))},compress:function(e){return gt._compress(e,16,(function(e){return dt(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,o,i,a="",s="",u="",c=2,l=3,d=2,p=0,f=0,h={},v={},g=[];for(i=0;i<e.length;i+=1)if(a=e.charAt(i),Object.prototype.hasOwnProperty.call(h,a)||(h[a]=l++,v[a]=!0),s=u+a,Object.prototype.hasOwnProperty.call(h,s))u=s;else{if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++),h[s]=l++,u=String(a)}if(""!==u){if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++)}for(o=2,r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=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:gt._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,o,i,a,s,u,c,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,v=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(i=0,s=Math.pow(2,2),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 2:return""}for(l[3]=c,o=c,d.push(c);;){if(p.index>e)return"";for(i=0,s=Math.pow(2,v),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(c=i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,v),v++),l[c])g=l[c];else{if(c!==h)return null;g=o+o.charAt(0)}d.push(g),l[h++]=o+g.charAt(0),o=g,0==--f&&(f=Math.pow(2,v),v++)}}},mt={DEBUG:!1,LIB_VERSION:"1.53.2"},_t=Array.prototype,yt=Object.prototype,bt=yt.toString,wt=yt.hasOwnProperty,kt="undefined"!=typeof window?window:{},St=kt.navigator||{userAgent:""},Ct=kt.document||{},It=St.userAgent,Ot=["localhost","127.0.0.1"],xt=_t.forEach,Et=_t.indexOf,Tt=Array.isArray,Mt={},Ft={log:function(){if(mt.DEBUG&&!qt(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;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){Nt(n,(function(t){e(t)}))}}},error:function(){if(mt.DEBUG&&!qt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}},critical:function(){if(!qt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}}},Rt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Pt(e,t,n){if(null!=e)if(xt&&Array.isArray(e)&&e.forEach===xt)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)===Mt)return}else for(var i in e)if(wt.call(e,i)&&t.call(n,e[i],i)===Mt)return}function Nt(e,t,n){if(Array.isArray(e))if(xt&&e.forEach===xt)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)===Mt)return}var At=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Lt=Tt||function(e){return"[object Array]"===bt.call(e)},Dt=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function $t(e,t){return-1!==e.indexOf(t)}var jt=function(e){return e===Object(e)&&!Lt(e)},qt=function(e){return void 0===e},Bt=function(e){return"[object String]"==bt.call(e)},Ht=function(e){return"[object Number]"==bt.call(e)},Ut=function e(t){return Pt(t,(function(n,r){!function(e){return"[object Date]"==bt.call(e)}(n)?jt(n)&&(t[r]=e(n)):t[r]=Wt(n)})),t},Wt=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Vt=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Ft.critical("Implementation error. Please turn on debug and contact support@posthog.com."),Ft.critical(e)}}},zt=function(e){var t={};return Pt(e,(function(e,n){Bt(e)&&e.length>0&&(t[n]=e)})),t};var Gt=["$performance_raw"];function Qt(e,t){return n=e,r=function(e,n){return n&&Gt.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},o=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:o.has(t)?void 0:(o.add(t),Lt(t)?(i=[],Nt(t,(function(t){i.push(e(t))}))):(i={},Pt(t,(function(t,n){o.has(t)||(i[n]=e(t,n))}))),i);var i}(n);var n,r,o}function Jt(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Zt(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(o)}while(s<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}var Xt,Zt=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var a=e.charCodeAt(o),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},Yt=(Xt=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return Xt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=It,r=0,o=[];function i(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=o[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),o.unshift(255&t),o.length>=4&&(r=i(r,o),o=[]);return o.length>0&&(r=i(r,o)),r.toString(16)}()+"-"+e+"-"+Xt()}),Kt=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(e)},en=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 o=r[1];try{o=decodeURIComponent(o)}catch(e){Ft.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},tn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},nn=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 a="on"+n,s=t[a];t[a]=function(t,n,r){return function(o){if(o=o||e(window.event)){var i,a=!0;Dt(r)&&(i=r(o));var s=n.call(t,o);return!1!==i&&!1!==s||(a=!1),a}}}(t,r,s)}else Ft.error("No valid element provided to register_event")}}(),rn={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return Pt(t,(function(e){var t=en(Ct.URL,e);t.length&&(n[e]=t)})),n},searchEngine:function(){var e=Ct.referrer;return e?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:null},searchInfo:function(){var e=rn.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(null!==e){n.$search_engine=e;var r=en(Ct.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||$t(e," OPR/")?$t(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":$t(e,"IEMobile")||$t(e,"WPDesktop")?"Internet Explorer Mobile":$t(e,"SamsungBrowser/")?"Samsung Internet":$t(e,"Edge")||$t(e,"Edg/")?"Microsoft Edge":$t(e,"FBIOS")?"Facebook Mobile":$t(e,"Chrome")?"Chrome":$t(e,"CriOS")?"Chrome iOS":$t(e,"UCWEB")||$t(e,"UCBrowser")?"UC Browser":$t(e,"FxiOS")?"Firefox iOS":$t(t,"Apple")?$t(e,"Mobile")?"Mobile Safari":"Safari":$t(e,"Android")?"Android Mobile":$t(e,"Konqueror")?"Konqueror":$t(e,"Firefox")?"Firefox":$t(e,"MSIE")||$t(e,"Trident/")?"Internet Explorer":$t(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+)?)/}[rn.browser(e,t,n)];if(void 0===r)return null;var o=e.match(r);return o?parseFloat(o[o.length-2]):null},browserLanguage:function(){return St.language||St.userLanguage},os:function(){var e=It;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"},referrer:function(){return Ct.referrer||"$direct"},referringDomain:function(){if(!Ct.referrer)return"$direct";var e=Ct.createElement("a");return e.href=Ct.referrer,e.host},properties:function(){return At(zt({$os:rn.os(),$browser:rn.browser(It,St.vendor,kt.opera),$device:rn.device(It),$device_type:rn.deviceType(It)}),{$current_url:null==kt?void 0:kt.location.href,$host:null==kt?void 0:kt.location.host,$pathname:null==kt?void 0:kt.location.pathname,$browser_version:rn.browserVersion(It,St.vendor,kt.opera),$browser_language:rn.browserLanguage(),$screen_height:null==kt?void 0:kt.screen.height,$screen_width:null==kt?void 0:kt.screen.width,$viewport_height:null==kt?void 0:kt.innerHeight,$viewport_width:null==kt?void 0:kt.innerWidth,$lib:"web",$lib_version:mt.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 At(zt({$os:rn.os(),$browser:rn.browser(It,St.vendor,kt.opera)}),{$browser_version:rn.browserVersion(It,St.vendor,kt.opera)})}};function on(e){switch(s(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function an(e){var t="";return pn(e)&&!fn(e)&&e.childNodes&&e.childNodes.length&&Pt(e.childNodes,(function(e){cn(e)&&e.textContent&&(t+=Rt(e.textContent).split(/(\s+)/).filter(hn).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Rt(t)}function sn(e){return!!e&&1===e.nodeType}function un(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function cn(e){return!!e&&3===e.nodeType}function ln(e){return!!e&&11===e.nodeType}var dn=["a","button","form","input","select","textarea","label"];function pn(e){for(var t=e;t.parentNode&&!un(t,"body");t=t.parentNode){var n=on(t).split(" ");if($t(n,"ph-sensitive")||$t(n,"ph-no-capture"))return!1}if($t(on(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 fn(e){return!!(un(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||un(e,"select")||un(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function hn(e){if(null===e||qt(e))return!1;if("string"==typeof e){e=Rt(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 vn(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,o=document.querySelectorAll("body > script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):document.body.appendChild(n)}function gn(e){var t=an(e);return hn(t="".concat(t," ").concat(mn(e)).trim())?t:""}function mn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pt(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=an(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(mn(e)).trim())}catch(e){console.error(e)}})),t}var _n=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return l(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),yn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,bn={is_supported:function(){return!0},error:function(e){Ft.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=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(e){}return null},parse:function(e){var t;try{t=JSON.parse(bn.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,o){try{var i="",a="",s="";if(r){var u=document.location.hostname.match(yn),c=u?u[0]:"";i=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(s="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+i+s;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{bn.set(e,"",-1,t)}catch(e){return}}},wn=null,kn={is_supported:function(){if(null!==wn)return wn;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";kn.set(t,"xyz"),'"xyz"'!==kn.get(t)&&(e=!1),kn.remove(t)}catch(t){e=!1}else e=!1;return e||Ft.error("localStorage unsupported; falling back to cookie store"),wn=e,e},error:function(e){Ft.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){kn.error(e)}return null},parse:function(e){try{return JSON.parse(kn.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){kn.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){kn.error(e)}}},Sn=a(a({},kn),{},{parse:function(e){try{var t={};try{(t=bn.parse(e)||{}).distinct_id&&bn.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=At(t,JSON.parse(kn.get(e)||"{}"));return kn.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{kn.set(e,t),t.distinct_id&&bn.set(e,{distinct_id:t.distinct_id},n,r,o)}catch(e){kn.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),bn.remove(e,t)}catch(e){kn.error(e)}}}),Cn={},In={is_supported:function(){return!0},error:function(e){Ft.error("memoryStorage error: "+e)},get:function(e){return Cn[e]||null},parse:function(e){return Cn[e]||null},set:function(e,t){Cn[e]=t},remove:function(e){delete Cn[e]}},On=null,xn={is_supported:function(){if(null!==On)return On;if(On=!0,"undefined"!=typeof window)try{var e="__support__";xn.set(e,"xyz"),'"xyz"'!==xn.get(e)&&(On=!1),xn.remove(e)}catch(e){On=!1}else On=!1;return On},error:function(e){mt.DEBUG&&Ft.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){xn.error(e)}return null},parse:function(e){try{return JSON.parse(xn.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){xn.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){xn.error(e)}}},En="$people_distinct_id",Tn="__alias",Mn="__timers",Fn="$autocapture_disabled_server_side",Rn="$session_recording_enabled_server_side",Pn="$console_log_recording_enabled_server_side",Nn="$session_recording_recorder_version_server_side",An="$sesid",Ln="$enabled_feature_flags",Dn="$user_state",$n=[En,Tn,"__cmpns",Mn,Rn,An,Ln,Dn],jn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],qn=function(){function e(t){u(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===jn.indexOf(t.persistence.toLowerCase())&&(Ft.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&kn.is_supported()?this.storage=kn:"localstorage+cookie"===r&&Sn.is_supported()?this.storage=Sn:"sessionstorage"===r&&xn.is_supported()?this.storage=xn:this.storage="memory"===r?In:bn,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return l(e,[{key:"properties",value:function(){var e={};return Pt(this.props,(function(t,n){if(n===Ln&&"object"===s(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/".concat(r[o])]=t[r[o]];else a=n,u=!1,(null===(i=$n)?u:Et&&i.indexOf===Et?-1!=i.indexOf(a):(Pt(i,(function(e){if(u||(u=e===a))return Mt})),u))||(e[n]=t);var i,a,u})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=At({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(jt(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var o=!1;if(Pt(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,o=!0)})),o)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(jt(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(Pt(e,(function(t,o){e.hasOwnProperty(o)&&n.props[o]!==t&&(n.props[o]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(rn.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(rn.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||rn.referrer(),$referring_domain:this.props.$referring_domain||rn.referringDomain()})}},{key:"get_referrer_info",value:function(){return zt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Pt(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Mn]||{};n[e]=t,this.props[Mn]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Mn]||{})[e];return qt(t)||(delete this.props[Mn][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Dn]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Dn]=e,this.save()}}]),e}(),Bn={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(Fn),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!sn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!pn(e))return{};var t={};return Pt(e.attributes,(function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&hn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};dn.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=gn(e):o.$el_text=an(e));var i=on(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),Pt(e.attributes,(function(n){var r;fn(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&hn(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 a=1,s=1,u=e;u=this._previousElementSibling(u);)a++,u.tagName===e.tagName&&s++;return o.nth_child=a,o.nth_of_type=s,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return Pt(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),hn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return Pt(this._customProperties,(function(r){Pt(r.event_selectors,(function(o){Pt(document.querySelectorAll(o),(function(o){$t(e,o)&&pn(o)&&(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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",i=this._getEventTarget(e);(cn(i)&&(i=i.parentNode||null),"$autocapture"===o&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(i&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||un(e,"html")||!sn(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,o=n.url_allowlist;if(o&&!o.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!un(d,"body");)if(ln(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(dn.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){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 u?"click"===t.type:"click"===t.type&&(dn.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.config)){for(var a=[i],s=i;s.parentNode&&!un(s,"body");)ln(s.parentNode)?(a.push(s.parentNode.host),s=s.parentNode.host):(a.push(s.parentNode),s=s.parentNode);var u,c=[],l={},d=!1;if(Pt(a,(function(e){var n=pn(e);"a"===e.tagName.toLowerCase()&&(u=e.getAttribute("href"),u=n&&hn(u)&&u),$t(on(e).split(" "),"ph-no-capture")&&(d=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var o=r._getAugmentPropertiesFromElement(e);At(l,o)})),t.get_config("mask_all_text")||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?c[0].$el_text=gn(i):c[0].$el_text=an(i)),u&&(c[0].attr__href=u),d)return!1;var p=At(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(a),l);return t.capture(o,p),!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)};nn(document,"submit",n,!1,!0),nn(document,"change",n,!1,!0),nn(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new _n(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?Ft.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(d({},Fn,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=qt(t)?10:t,n=qt(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return Dt(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(Bn),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Vt(e[t]))}(Bn);var Hn="__ph_opt_in_out_";function Un(e,t){Zn(!0,e,t)}function Wn(e,t){Zn(!1,e,t)}function Vn(e,t){return"1"===Xn(e,t)}function zn(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||kt,n=t.navigator||{},r=!1;return Pt([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){$t([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Xn(e,t)}function Gn(e,t){Qn(t=t||{}).remove(Jn(e,t),!!t.crossSubdomainCookie)}function Qn(e){return"localStorage"===(e=e||{}).persistenceType?kn:"localStorage+cookie"===e.persistenceType?Sn:bn}function Jn(e,t){return((t=t||{}).persistencePrefix||Hn)+e}function Xn(e,t){return Qn(t).get(Jn(e,t))}function Zn(e,t,n){Bt(t)&&t.length?(Qn(n=n||{}).set(Jn(t,n),e?1:0,Ht(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Yn(e,t){var n=!1;try{var r=e.get_config("token"),o=e.get_config("respect_dnt"),i=e.get_config("opt_out_capturing_persistence_type"),a=e.get_config("opt_out_capturing_cookie_prefix")||void 0,s=e.get_config("window");r&&(n=zn(r,{respectDnt:o,persistenceType:i,persistencePrefix:a,window:s}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function Kn(e,t,n){return function(){for(var r=Yn(e,n),o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];if(!r)return t.apply(this,i);var s=i[i.length-1];"function"==typeof s&&s(0)}}var er="$set",tr=function(){function e(t){var n=this;u(this,e),this._posthog=t,this.set=Kn(t,(function(e,t,r){var o=n.set_action(e,t);return jt(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.sessionPersistence.update_referrer_info(),o[er]=At({},rn.people_properties(),n._posthog.sessionPersistence.get_referrer_info(),o[er]),n._send_request(o,r)})),this.set_once=Kn(t,(function(e,t,r){var o=n.set_once_action(e,t);return jt(e)&&(r=t),n._send_request(o,r)}))}return l(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),o=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),o&&(e.$had_persisted_distinct_id=o);var i=Ut(e),a=Qt(i,this._get_config("properties_string_max_length")),s=Jt(JSON.stringify(i));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:s},{},this._posthog._prepare_callback(t,a)),a}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(er,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,o={},i={};return jt(t)?Pt(t,(function(e,t){r._is_reserved_property(t)||(i[t]=e)})):i[t]=n,o[e]=i,o}}]),e}(),nr="$active_feature_flags",rr="$enabled_feature_flags",or="$override_feature_flags",ir="$feature_flag_payloads",ar=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return l(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(rr),t=this.instance.get_property(or);if(!t)return e||{};for(var n=At({},e),r=Object.keys(t),o=0;o<r.length;o++)!1===t[r[o]]?delete n[r[o]]:n[r[o]]=t[r[o]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ir)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=Jt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&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:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{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:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,i=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var s,u={};if(o)for(var c=0;c<o.length;c++)u[o[c]]=!0;t&&t.register((d(s={},nr,o),d(s,rr,u),s))}else{var l,p=o,f=i;e.errorsWhileComputingFlags&&(p=a(a({},n),p),f=a(a({},r),f)),t&&t.register((d(l={},nr,Object.keys(p||{})),d(l,rr,p||{}),d(l,ir,f||{}),l))}else t&&(t.unregister(nr),t.unregister(rr),t.unregister(ir))}(e,this.instance.persistence,t,n);var r=this._prepareFeatureFlagsForCallbacks(),o=r.flags,i=r.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,i)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(or);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},or,t))}else this.instance.persistence.register(d({},or,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,o=n.flagVariants;e(r,o)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}}]),e}(),sr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",ur=2,cr=4,lr=6;var dr="rrweb/console@1";var pr="/e/",fr=function(){function e(t){u(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=pr,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return l(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(Rn),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Pn),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Nn);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,o,i,a;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((d(i={},Rn,!!e.sessionRecording),d(i,Pn,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),d(i,Nn,null===(o=e.sessionRecording)||void 0===o?void 0:o.recorderVersion),i));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(a=e.sessionRecording)||void 0===a?void 0:a.endpoint);null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?vn(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(mt.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),r=this.instance.sessionManager.checkAndGetSessionAndWindowId(n,e.timestamp),o=r.windowId,i=r.sessionId;if(this.captureStarted&&(this.windowId!==o||this.sessionId!==i)&&-1===[ur,cr].indexOf(e.type))try{var a;null===(a=this.rrwebRecord)||void 0===a||a.takeFullSnapshot()}catch(e){Ft.error("Error taking full snapshot.",e)}this.windowId=o,this.sessionId=i}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var n=this.instance.get_config("session_recording"),r=0,o=Object.entries(n||{});r<o.length;r++){var i=_(o[r],2),s=i[0],u=i[1];s in t&&(t[s]=u)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(a({emit:function(t){e.onRRwebEmit(t)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook((function(t){try{var n;if("$pageview"===t)null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href})}catch(e){Ft.error("Could not add $pageview to rrweb session",e)}}))):Ft.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){e=function(e){if(e&&"object"===s(e)&&e.type===lr&&"object"===s(e.data)&&e.data.plugin===dr){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===s(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,r=k(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],sr):t.replace(o[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),this._updateWindowAndSessionIds(e);var t={$snapshot_data:e,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),this.emit?this._captureSnapshot(t):this.snapshots.push(t)}},{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===ur}})}}]),e}(),hr={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},vr=["first-input","navigation","paint","resource"],gr=["/s/","/e/"],mr=function(){function e(t){u(this,e),d(this,"_forceAllowLocalhost",!1),this.instance=t}return l(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)if(!Ot.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))}));var t=PerformanceObserver.supportedEntryTypes.filter((function(e){return vr.includes(e)}));t.forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(e){console.error("PostHog failed to start performance observer",e),this.stopObserving()}else Ft.log("PostHog Peformance observer not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(gr.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},o=Math.floor(Date.now()-performance.now());for(var i in r[hr.timeOrigin]=o,r[hr.timestamp]=Math.floor(o+e.startTime),hr)void 0!==n[i]&&(r[hr[i]]=n[i]);if(this.capturePerformanceEvent(r),_r(e)){var a,s=k(e.serverTiming||[]);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;this.capturePerformanceEvent((d(u={},hr.timeOrigin,o),d(u,hr.timestamp,Math.floor(o+e.startTime)),d(u,hr.name,c.name),d(u,hr.duration,c.duration),d(u,hr.entryType,"serverTiming"),u))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[hr.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),_r=function(e){return"navigation"===e.entryType||"resource"===e.entryType},yr=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return l(e,[{key:"call",value:function(){var e=this,t=Jt(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=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r=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(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Bn.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var o,i={},a=k(e.supportedCompression);try{for(a.s();!(o=a.n()).done;){i[o.value]=!0}}catch(e){a.e(e)}finally{a.f()}this.instance.compression=i}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var s,u=this.instance.get_config("api_host"),c=k(e.siteApps);try{var l=function(){var e=s.value,t=e.id,n=e.url,o=document.createElement("script");o.src=[u,"/"===u[u.length-1]&&"/"===n[0]?n.substring(1):n].join(""),o.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(o)};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),br=["https://app.posthog.com","https://eu.posthog.com"],wr=["source"],kr=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a(a({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",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,o=tn(e.hash,"__posthog")||tn(e.hash,"state"),i=o?JSON.parse(decodeURIComponent(o)):null;return i&&"ph_authorize"===i.action?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var n=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),r=3e4*Math.floor(Date.now()/3e4),o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(r),i=!br.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=a(a({apiURL:n,jsURL:n,token:this.instance.get_config("token")},e),i?{instrument:!1}:{});s.source;var u=v(s,wr);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),vn(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(s,t.instance)})),nn(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(s)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{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;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return l(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}(),Cr=function(e){p(n,e);var t=m(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return u(this,n),(o=t.call(this,i)).handlePollRequest=r,o.captureMetrics=e,o}return l(n,[{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],o=r.url,i=r.data,a=r.options;Pt(i,(function(t,n){i[n].offset=Math.abs(i[n].timestamp-e.getTime()),delete i[n].timestamp})),e.handlePollRequest(o,i,a),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(o.slice(o.length-2))),e.captureMetrics.incr("batch-handle",i.length),e.captureMetrics.incr("batch-handle-".concat(o.slice(o.length-2)),i.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,o=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",o.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),o.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,o=t.options;e.handlePollRequest(n,r,a(a({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return Pt(this._event_queue,(function(t){var n=t.url,r=t.data,o=t.options,i=(o?o._batchKey:null)||n;void 0===e[i]&&(e[i]={data:[],url:n,options:o}),o&&e[i].options&&e[i].options._metrics&&!e[i].options._metrics.rrweb_full_snapshot&&(e[i].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),e[i].data.push(r)})),e}}]),n}(Sr),Ir=function(){function e(t){u(this,e),this.enabled=t,this.metrics={}}return l(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}(),Or=Uint8Array,xr=Uint16Array,Er=Uint32Array,Tr=new Or([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]),Mr=new Or([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]),Fr=new Or([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rr=function(e,t){for(var n=new xr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Er(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Pr=Rr(Tr,2),Nr=Pr[0],Ar=Pr[1];Nr[28]=258,Ar[258]=28;for(var Lr=Rr(Mr,0)[1],Dr=new xr(32768),$r=0;$r<32768;++$r){var jr=(43690&$r)>>>1|(21845&$r)<<1;jr=(61680&(jr=(52428&jr)>>>2|(13107&jr)<<2))>>>4|(3855&jr)<<4,Dr[$r]=((65280&jr)>>>8|(255&jr)<<8)>>>1}var qr=function(e,t,n){for(var r=e.length,o=0,i=new xr(t);o<r;++o)++i[e[o]-1];var a,s=new xr(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new xr(1<<t);var u=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],d=s[e[o]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)a[Dr[d]>>>u]=c}else for(a=new xr(r),o=0;o<r;++o)a[o]=Dr[s[e[o]-1]++]>>>15-e[o];return a},Br=new Or(288);for($r=0;$r<144;++$r)Br[$r]=8;for($r=144;$r<256;++$r)Br[$r]=9;for($r=256;$r<280;++$r)Br[$r]=7;for($r=280;$r<288;++$r)Br[$r]=8;var Hr=new Or(32);for($r=0;$r<32;++$r)Hr[$r]=5;var Ur,Wr=qr(Br,9,0),Vr=qr(Hr,5,0),zr=function(e){return(e/8>>0)+(7&e&&1)},Gr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof xr?xr:e instanceof Er?Er:Or)(n-t);return r.set(e.subarray(t,n)),r},Qr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Jr=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},Xr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new Or(0),0];if(1==o){var a=new Or(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:s.f+u.f,l:s,r:u};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new xr(p+1),h=Zr(n[l-1],f,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var _=i[r].s;if(!(f[_]>t))break;v+=m-(1<<h-f[_]),f[_]=t}for(v>>>=g;v>0;){var y=i[r].s;f[y]<t?v-=1<<t-f[y]++-1:++r}for(;r>=0&&v;--r){var b=i[r].s;f[b]==t&&(--f[b],++v)}h=t}return[new Or(f),h]},Zr=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},Yr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new xr(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Kr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},eo=function(e,t,n){var r=n.length,o=zr(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},to=function(e,t,n,r,o,i,a,s,u,c,l){Qr(t,l++,n),++o[256];for(var d=Xr(o,15),p=d[0],f=d[1],h=Xr(i,15),v=h[0],g=h[1],m=Yr(p),_=m[0],y=m[1],b=Yr(v),w=b[0],k=b[1],S=new xr(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var I=Xr(S,7),O=I[0],x=I[1],E=19;E>4&&!O[Fr[E-1]];--E);var T,M,F,R,P=c+5<<3,N=Kr(o,Br)+Kr(i,Hr)+a,A=Kr(o,p)+Kr(i,v)+a+14+3*E+Kr(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(P<=N&&P<=A)return eo(t,l,e.subarray(u,u+c));if(Qr(t,l,1+(A<N)),l+=2,A<N){T=qr(p,f,0),M=p,F=qr(v,g,0),R=v;var L=qr(O,x,0);Qr(t,l,y-257),Qr(t,l+5,k-1),Qr(t,l+10,E-4),l+=14;for(C=0;C<E;++C)Qr(t,l+3*C,O[Fr[C]]);l+=3*E;for(var D=[_,w],$=0;$<2;++$){var j=D[$];for(C=0;C<j.length;++C){var q=31&j[C];Qr(t,l,L[q]),l+=O[q],q>15&&(Qr(t,l,j[C]>>>5&127),l+=j[C]>>>12)}}}else T=Wr,M=Br,F=Vr,R=Hr;for(C=0;C<s;++C)if(r[C]>255){q=r[C]>>>18&31;Jr(t,l,T[q+257]),l+=M[q+257],q>7&&(Qr(t,l,r[C]>>>23&31),l+=Tr[q]);var B=31&r[C];Jr(t,l,F[B]),l+=R[B],B>3&&(Jr(t,l,r[C]>>>5&8191),l+=Mr[B])}else Jr(t,l,T[r[C]]),l+=M[r[C]];return Jr(t,l,T[256]),l+M[256]},no=new Er([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ro=new Or(0),oo=function(){for(var e=new Er(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),io=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=oo[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ao=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Or(r+a+5*(1+Math.floor(a/7e3))+o),u=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=eo(u,c,e.subarray(l,d)):(u[l]=i,c=eo(u,c,e.subarray(l,a)))}else{for(var p=no[t-1],f=p>>>13,h=8191&p,v=(1<<n)-1,g=new xr(32768),m=new xr(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},w=new Er(25e3),k=new xr(288),S=new xr(32),C=0,I=0,O=(l=0,0),x=0,E=0;l<a;++l){var T=b(l),M=32767&l,F=m[T];if(g[M]=F,m[T]=M,x<=l){var R=a-l;if((C>7e3||O>24576)&&R>423){c=to(e,u,0,w,k,S,I,O,E,l-E,c),O=C=I=0,E=l;for(var P=0;P<286;++P)k[P]=0;for(P=0;P<30;++P)S[P]=0}var N=2,A=0,L=h,D=M-F&32767;if(R>2&&T==b(l-D))for(var $=Math.min(f,R)-1,j=Math.min(32767,l),q=Math.min(258,R);D<=j&&--L&&M!=F;){if(e[l+N]==e[l+N-D]){for(var B=0;B<q&&e[l+B]==e[l+B-D];++B);if(B>N){if(N=B,A=D,B>$)break;var H=Math.min(D,B-2),U=0;for(P=0;P<H;++P){var W=l-D+P+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,F=W)}}}D+=(M=F)-(F=g[M])+32768&32767}if(A){w[O++]=268435456|Ar[N]<<18|Lr[A];var z=31&Ar[N],G=31&Lr[A];I+=Tr[z]+Mr[G],++k[257+z],++S[G],x=l+N,++C}else w[O++]=e[l],++k[e[l]]}}c=to(e,u,i,w,k,S,I,O,E,l-E,c),i||(c=eo(u,c,ro))}return Gr(s,0,r+zr(c)+o)}(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,!o)},so=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uo=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&&so(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)}},co=function(e){return 10+(e.filename&&e.filename.length+1||0)};function lo(e,t){void 0===t&&(t={});var n=io(),r=e.length;n.p(e);var o=ao(e,t,co(t),8),i=o.length;return uo(o,t),so(o,i-8,n.d()),so(o,i-4,r),o}function po(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Or(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new Or(o+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?i(u):u<2048?(i(192|u>>>6),i(128|63&u)):u>55295&&u<57344?(i(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),i(128|u>>>12&63),i(128|u>>>6&63),i(128|63&u)):(i(224|u>>>12),i(128|u>>>6&63),i(128|63&u))}return Gr(r,0,o)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(Ur||(Ur={}));var fo,ho,vo,go=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=mt.LIB_VERSION;var o=e.split("?");if(o.length>1){var i,a=k(o[1].split("&"));try{for(a.s();!(i=a.n()).done;){var s=i.value.split("=")[0];r[s]&&delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return Pt(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t})),o.join(r)}(r)},mo=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 o,i;return o=Array.isArray(t)||(i=t,"[object Uint8Array]"===Object.prototype.toString.call(i))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(o+="&compression="+t.compression),o},_o=function(e){var t=e.url,n=e.data,r=e.headers,o=e.options,i=e.captureMetrics,a=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(o.method||"GET",t,!0);var f=mo(n,o);i.incr("_send_request"),i.incr("_send_request_inflight"),Pt(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==o.method||o.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(i.incr("xhr-response"),i.incr("xhr-response-".concat(p.status)),i.decr("_send_request_inflight"),200===p.status){if(a){var e;try{e=JSON.parse(p.responseText)}catch(e){return void Ft.error(e)}a(e)}}else"function"==typeof c&&c(p),[401,403,404,500].indexOf(p.status)<0&&u.enqueue({url:t,data:n,options:o,headers:r,retriesPerformedSoFar:(s||0)+1,callback:a}),a&&a({status:0})},p.send(f)},yo=function(e){p(n,e);var t=m(n);function n(e,r){var o;return u(this,n),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=r,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return l(n,[{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.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.requestData;this._executeXhrRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=k(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,o=n.data,i=n.options;try{window.navigator.sendBeacon(r,mo(o,a(a({},i),{},{sendBeacon:!0})))}catch(e){mt.DEBUG&&console.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,o=e.headers,i=e.callback,a=e.retriesPerformedSoFar;_o({url:t,data:n||{},options:r||{},headers:o||{},retriesPerformedSoFar:a||0,callback:i,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(Sr),bo=18e5,wo=864e5,ko=function(){function e(t,n){u(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&xn.is_supported()){var o=xn.parse(this.window_id_storage_key),i=xn.parse(this.primary_window_exists_storage_key);o&&!i?this._windowId=o:xn.remove(this.window_id_storage_key),xn.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return l(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&xn.is_supported()&&xn.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&xn.is_supported()?xn.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(d({},An,[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[An];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:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&xn.is_supported()&&xn.remove(e.primary_window_exists_storage_key)}))}},{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)||(new Date).getTime(),n=_(this._getSessionId(),3),r=n[0],o=n[1],i=n[2],a=this._getWindowId(),s=i&&i>0&&Math.abs(t-i)>wo;!o||!e&&Math.abs(t-r)>bo||s?(o=Yt(),a=Yt(),i=t):a||(a=Yt());var u=0===r||!e||s?t:r,c=0===i?(new Date).getTime():i;return this._setWindowId(a),this._setSessionId(o,u,c),{sessionId:o,windowId:a}}}]),e}(),So=l((function e(t,n,r,o){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,a,s;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var u=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=u+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=u+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var c=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(a=c[0])||void 0===a?void 0:a.value,$sentry_exception_type:null===(s=c[0])||void 0===s?void 0:s.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),Co=function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},Io=function(){function e(){u(this,e),d(this,"_seenFirstPageView",!1)}return l(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=Yt()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=Yt()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(fo||(fo={}));var Oo=function(){},xo={},Eo="posthog",To=kt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Mo=!To&&-1===It.indexOf("MSIE")&&-1===It.indexOf("Mozilla"),Fo=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==Ct||null===(e=Ct.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:Oo,store_google:!0,custom_campaign_params:[],save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==kt||null===(n=kt.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,opt_in_site_apps:!1,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:Oo,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},Ro=function(e,t,n,r){var o,i=n!==Eo&&vo?n?vo[n]:void 0:vo,a={initComplete:!1,syncCode:!1},s=function(e){return function(t){a[e]||(a[e]=!0,a.initComplete&&a.syncCode&&(null==r||r(t)))}};if(i&&ho===fo.INIT_MODULE)o=i;else{if(i&&!Lt(i))return void console.error("You have already initialized "+n);o=new Po}if(o._init(e,t,n,s("initComplete")),o.toolbar.maybeLoadToolbar(),o.sessionRecording=new fr(o),o.sessionRecording.startRecordingIfEnabled(),o.webPerformance=new mr(o),o.webPerformance.startObservingIfEnabled(),o.__autocapture=o.get_config("autocapture"),Bn._setIsAutocaptureEnabled(o),Bn._isAutocaptureEnabled){o.__autocapture=o.get_config("autocapture");Bn.enabledForProject(o.get_config("token"),100,100)?Bn.isBrowserSupported()?Bn.init(o):(o.__autocapture=!1,Ft.log("Disabling Automatic Event Collection because this browser is not supported")):(o.__autocapture=!1,Ft.log("Not in active bucket: disabling Automatic Event Collection."))}return mt.DEBUG=mt.DEBUG||o.get_config("debug"),void 0!==i&&Lt(i)&&(o._execute_array.call(o.people,i.people),o._execute_array(i)),s("syncCode")(o),o},Po=function(){function e(){var t=this;u(this,e),this.config=Fo(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=So,this.segmentIntegration=function(){return Co(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new tr(this),this.featureFlags=new ar(this),this.feature_flags=this.featureFlags,this.toolbar=new kr(this),this.pageViewIdManager=new Io,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionPersistence=void 0,this.sessionManager=void 0}return l(e,[{key:"init",value:function(e,t,n){if(qt(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==Eo){var r=Ro(e,t,n,(function(e){vo[n]=e,e._loaded()}));return vo[n]=r,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,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var u,c={segmentRegister:!1,syncCode:!1},l=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==s||s(r)))}};(this.set_config(At({},Fo(),o,{name:i,token:e,callback_fn:(i===Eo?i:Eo+"."+i)+"._jsc"})),this._jsc=function(){},null!=kt&&null!==(t=kt.rrweb)&&void 0!==t&&t.record||null!=kt&&kt.rrwebRecord)&&(this.__loaded_recorder_version=null==kt||null===(u=kt.rrweb)||void 0===u?void 0:u.version);if(this._captureMetrics=new Ir(this.get_config("_capture_metrics")),this._requestQueue=new Cr(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new yo(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new qn(this.config),this.sessionManager=new ko(this.config,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new qn(a(a({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),o.segment?(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration()).then(l("segmentRegister"))):l("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var d,p,f=this.get_config("get_device_id")(Yt()),h=null!==(d=o.bootstrap)&&void 0!==d&&d.isIdentifiedID?f:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(p=o.bootstrap)&&void 0!==p&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var v,g,m=Object.keys((null===(v=o.bootstrap)||void 0===v?void 0:v.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),_=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlagPayloads)||{}).filter((function(e){return m[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(Yt());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}kt.addEventListener&&kt.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),l("syncCode")()}},{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 yr(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()||Nt(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(qt(e))return null;if(To)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&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.get_config("capture_pageleave")&&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||xo,Oo)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,i=function(e,t,n){return e===Ur.LZ64?[{data:gt.compressToBase64(t),compression:Ur.LZ64},n]:e===Ur.GZipJS?[lo(po(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:Ur.GZipJS}})]:[{data:Jt(t)},n]}((o=this.compression)[Ur.GZipJS]?Ur.GZipJS:o[Ur.LZ64]?Ur.LZ64:Ur.Base64,t,n),s=_(i,2),u=s[0],c=s[1];this._send_request(e,u,c,r)}},{key:"_send_request",value:function(e,t,n,r){if(Mo)this.__request_queue.push([e,t,n,r]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};n=At(o,n||{}),To||(n.method="GET");var i="sendBeacon"in kt.navigator&&"sendBeacon"===n.transport;if(e=go(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),jt(t)&&this.get_config("img")){var s=Ct.createElement("img");s.src=e,Ct.body.appendChild(s)}else if(i)try{kt.navigator.sendBeacon(e,mo(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(To)try{_o({url:e,data:t,headers:this.get_config("xhr_headers"),options:n,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var u,c=Ct.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=Ct.getElementsByTagName("script")[0];null===(u=l.parentNode)||void 0===u||u.insertBefore(c,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],o=[],i=[];Nt(e,(function(e){e&&(t=e[0],Lt(t)?i.push(e):"function"==typeof e?e.call(n):Lt(e)&&"alias"===t?r.push(e):Lt(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?i.push(e):o.push(e))}));var a=function(e,t){Nt(e,(function(e){if(Lt(e[0])){var n=t;Pt(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(o,this),a(i,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{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]:xo;if(this.__loaded&&!Yn(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||xo).transport;if(r&&(n.transport=r),qt(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!Kt(It)){this.sessionPersistence.update_search_keyword(),this.get_config("store_google")&&this.sessionPersistence.update_campaign_params(),this.get_config("save_referrer")&&this.sessionPersistence.update_referrer_info();var o={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=Qt(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&Ft.log("PostHog.js send",o);var i=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),s=n!==xo;return!this.get_config("request_batching")||s&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,i,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),Pt(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var n,r=this.persistence.remove_event_timer(e),o=a({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var i=a(a({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=i.distinct_id,o}var s=rn.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,l=u.windowId;o.$session_id=c,o.$window_id=l}if(null!==(n=this.webPerformance)&&void 0!==n&&n.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=At(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=s.$current_url,o}if(void 0!==r){var p=(new Date).getTime()-r;o.$duration=parseFloat((p/1e3).toFixed(3))}o=At({},rn.properties(),this.persistence.properties(),this.sessionPersistence.properties(),o);var f=this.get_config("property_blacklist");Lt(f)?Pt(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(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:"register_for_session",value:function(e){this.sessionPersistence.register(e)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"unregister_for_session",value:function(e){this.sessionPersistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return 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 o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Tn)&&(this.unregister(Tn),this.register({distinct_id:e}));var i="anonymous"===this.persistence.get_user_state();e!==r&&i?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,n){if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:a(a({},r),{},d({},e,t))}),n&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionPersistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(Yt());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(En)?(Ft.critical("Attempting to create alias for existing People user - aborting."),-2):(qt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Tn,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 t=a({},this.config);jt(e)&&(At(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),this.sessionPersistence&&this.sessionPersistence.update_config(this.config),kn.is_supported()&&"true"===kn.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(mt.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.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:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{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:"getSessionProperty",value:function(e){return this.sessionPersistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:Eo;return t!==Eo&&(t=Eo+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&kn.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")&&!bn.get("ph_optout")||(bn.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),this.get_config("disable_persistence")||this.sessionPersistence.disabled===t||this.sessionPersistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=At({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||{}),kn.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=At({enable_persistence:!0},e||{}),this._gdpr_call_func(Un,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=At({clear_persistence:!0},e||{});this._gdpr_call_func(Wn,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Vn,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(zn,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=At({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Gn,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(kt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(kt.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 gt.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Vt(e.prototype[t[n]])}(Po,["identify"]);var No={},Ao=function(){vo.init=function(e,t,n){if(n)return vo[n]||(vo[n]=No[n]=Ro(e||"",t||{},n,(function(e){vo[n]=No[n]=e,e._loaded()}))),vo[n];var r=vo;return No[Eo]?r=No[Eo]:e&&(r=Ro(e,t||{},Eo,(function(e){No[Eo]=e,e._loaded()})),No[Eo]=r),vo=r,ho===fo.INIT_SNIPPET&&(kt[Eo]=vo),Pt(No,(function(e,t){t!==Eo&&(vo[t]=e)})),r}},Lo=function(){function e(){e.done||(e.done=!0,Mo=!1,Pt(No,(function(e){e._dom_loaded()})))}Ct.addEventListener&&("complete"===Ct.readyState?e():Ct.addEventListener("DOMContentLoaded",e,!1)),nn(kt,"load",e,!0)};ho=fo.INIT_SNIPPET,qt(kt.posthog)&&(kt.posthog=[]),(vo=kt.posthog).__loaded||vo.config&&vo.persistence?console.error("PostHog library has already been downloaded at least once."):(Pt(vo._i,(function(e){e&&Lt(e)&&(No[e[2]]=Ro.apply(void 0,y(e)))})),Ao(),vo.init(),Pt(No,(function(e){e._loaded()})),Lo())}();
15
+ ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(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))}function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var O,x,E=1,T=new RegExp("[^a-z0-9-_:]"),M=-2;function F(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(R).join(""):null}catch(e){return null}}function R(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=F(e.styleSheet)||t}catch(e){}return t}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(P,(function(e,n,r,o,i,a){var s,u=r||i||a,c=n||o||"";if(!u)return e;if(!N.test(u))return"url("+c+u+c+")";if(A.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var D,$,j,q,B,H,U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?V(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(W),!(n>=t.length);){var i=r(U);if(","===i.slice(-1))i=V(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=V(e,i);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?L(r,z()):"object"===t&&"data"===n&&r?V(e,r):r:V(e,r)}function Q(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!(!n||!e.matches(n))||Q(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Q(e.parentNode,t,n)}function J(t,n){var r,o,i,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;o=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,u,c),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),M={},R=0,P=Array.from(t.attributes);R<P.length;R++){var N=P[R],A=N.name,D=N.value;M[A]=G(s,E,A,D)}if("link"===E&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=F($)),j&&(delete M.rel,delete M.href,M._cssText=L(j,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=F(t.sheet))&&(M._cssText=L(j,z()));if("input"===E||"textarea"===E||"select"===E){D=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&D?M.value=C({type:M.type,tagName:E,value:D,maskInputOptions:h,maskInputFn:g}):t.checked&&(M.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?M.selected=!0:delete M.selected),"canvas"===E&&b)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=I in o?o[I]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var q=t.toDataURL(_.type,_.quality),B=document.createElement("canvas");B.width=t.width,B.height=t.height,q!==B.toDataURL(_.type,_.quality)&&(M.rr_dataURL=q)}if("img"===E&&y){O||(O=s.createElement("canvas"),x=O.getContext("2d"));var H=t,U=H.crossOrigin;H.crossOrigin="anonymous";var W=function(){try{O.width=H.naturalWidth,O.height=H.naturalHeight,x.drawImage(H,0,0),M.rr_dataURL=O.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}U?M.crossOrigin=U:delete M.crossOrigin};H.complete&&0!==H.naturalWidth?W():H.onload=W}if("audio"!==E&&"video"!==E||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),S){var V=t.getBoundingClientRect(),J=V.width,X=V.height;M={class:M.class,rr_width:J+"px",rr_height:X+"px"}}return"iframe"!==E||w(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:E,attributes:M,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:o};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,Y=t.textContent,K="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(K&&Y){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(Y=(i=t.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}Y=L(Y,z())}return ee&&(Y="SCRIPT_PLACEHOLDER"),!K&&!ee&&Q(t,l,d)&&Y&&(Y=v?v(Y):Y.replace(/[\S]/g,"*")),{type:e.Text,textContent:Y||"",isStyle:K,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function X(e){return void 0===e?"":e.toLowerCase()}function Z(t,n){var r,o=n.doc,i=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,C=n.recordCanvas,I=void 0!==C&&C,O=n.onSerialize,x=n.onIframeLoad,T=n.iframeLoadTimeout,F=void 0===T?5e3:T,R=n.keepIframeSrcFn,P=void 0===R?function(){return!1}:R,N=n.preserveWhiteSpace,A=void 0===N||N,L=J(t,{doc:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:P});if(!L)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(X(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(t.attributes.name)||"icon"===X(t.attributes.rel)||"apple-touch-icon"===X(t.attributes.rel)||"shortcut icon"===X(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&X(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(X(t.attributes.property).match(/^(og|twitter|fb):/)||X(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===X(t.attributes.name)||"googlebot"===X(t.attributes.name)||"bingbot"===X(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===X(t.attributes.name)||"generator"===X(t.attributes.name)||"framework"===X(t.attributes.name)||"publisher"===X(t.attributes.name)||"progid"===X(t.attributes.name)||X(t.attributes.property).match(/^article:/)||X(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===X(t.attributes.name)||"yandex-verification"===X(t.attributes.name)||"csrf-token"===X(t.attributes.name)||"p:domain_verify"===X(t.attributes.name)||"verify-v1"===X(t.attributes.name)||"verification"===X(t.attributes.name)||"shopify-checkout-api-token"===X(t.attributes.name)))return!0}}return!1}(L,_)&&(A||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:M;var D=Object.assign(L,{id:r});if(t.__sn=D,r===M)return null;i[r]=t,O&&O(t);var $=!d;if(D.type===e.Element&&($=$&&!D.needBlock,delete D.needBlock,t.shadowRoot&&(D.isShadowHost=!0)),(D.type===e.Document||D.type===e.Element)&&$){_.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(A=!1);for(var j={doc:o,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:P},q=0,B=Array.from(t.childNodes);q<B.length;q++){(W=Z(B[q],j))&&D.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var H=0,U=Array.from(t.shadowRoot.childNodes);H<U.length;H++){var W;(W=Z(U[H],j))&&(W.isShadow=!0,D.childNodes.push(W))}}return t.parentNode&&S(t.parentNode)&&(D.isShadow=!0),D.type===e.Element&&"iframe"===D.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&x){var n=Z(e,{doc:e,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:P});n&&x(t,n)}}),F),D}function Y(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(D||(D={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}($||($={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(j||(j={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(q||(q={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(B||(B={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(H||(H={}));var K="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ee={map:{},getId:function(){return console.error(K),-1},getNode:function(){return console.error(K),null},removeNodeFromMap:function(){console.error(K)},has:function(){return console.error(K),!1},reset:function(){console.error(K)}};function te(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function ne(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return ne(e,t,i||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===M}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function pe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(K),Reflect.get(e,t,n)}}));var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var a=[],s=new fe,u=function(t){for(var n=t,r=M;r===M;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,o,i,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(o=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===o?void 0:o.host;)d=(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=Z(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){le(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;_e(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;ye(e.droppedSet,p)||_e(e.removes,p,e.mirror)?ye(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,o,i,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:Q(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(l.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(me(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,o)]?me(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function me(e,t){e.delete(t),t.childNodes.forEach((function(t){return me(e,t)}))}function _e(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||_e(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,we=[],ke="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function Oe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function xe(e,t){var n,r,o=new be;we.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ee(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(j).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var i=e.toLowerCase(),a=function(e){return function(n){var i=Oe(n);if(!ae(i,o)){var a=ce(n)?n.changedTouches[0]:n;if(a){var s=r.getId(i),u=a.clientX,c=a.clientY;t({type:j[e],id:s,x:u,y:c})}}}}(e);s.push(Y(i,a,n))})),function(){s.forEach((function(e){return e()}))}}function Te(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return Y("scroll",te((function(e){var i=Oe(e);if(i&&!ae(i,o)){var a=r.getId(i);if(i===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Me(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Fe=["INPUT","TEXTAREA","SELECT"],Re=new WeakMap;function Pe(e){return function(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,i){var a,s;void 0===i&&(i={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];t.mutation&&t.mutation.apply(t,o([],r(e),!1)),n.apply(void 0,o([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o([],r(e),!1)),i.apply(void 0,o([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o([],r(e),!1)),a.apply(void 0,o([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o([],r(e),!1)),s.apply(void 0,o([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o([],r(e),!1)),u.apply(void 0,o([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o([],r(e),!1)),c.apply(void 0,o([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o([],r(e),!1)),l.apply(void 0,o([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o([],r(e),!1)),d.apply(void 0,o([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o([],r(e),!1)),p.apply(void 0,o([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o([],r(e),!1)),f.apply(void 0,o([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o([],r(e),!1)),h.apply(void 0,o([],r(e),!1))}}(e,i);var c=xe(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=te((function(e){var n=Date.now()-i;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],i=null}),s),l=te((function(e){var t=Oe(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=Date.now()),u.push({x:r,y:a,id:o.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[Y("mousemove",l,r),Y("touchmove",l,r),Y("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Ee(e),p=Te(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return Y("resize",te((function(){var e=oe(),o=ie();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(e),h=function(e){var n=e.inputCb,i=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Oe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Fe.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var o=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(o=C({maskInputOptions:c,tagName:t.tagName,type:r,value:o,maskInputFn:l})),h(t,Me({text:o,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&i.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Me({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var o=Re.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Re.set(e,r);var i=a.getId(e);n(t(t({},r),{id:i}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return Y(e,f,i)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,o([],r(m.map((function(e){return ne(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,o=e.sampling,i=function(e){return te((function(o){var i=Oe(o);if(i&&!ae(i,n)){var a=i,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(i),currentTime:s,volume:u,muted:c})}}),o.media||500)},a=[Y("play",i(0)),Y("pause",i(1)),Y("seeked",i(2)),Y("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=i.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=i.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};ke?c.CSSGroupingRule=a.CSSGroupingRule:(Se&&(c.CSSMediaRule=a.CSSMediaRule),Ie&&(c.CSSConditionRule=a.CSSConditionRule),Ce&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=i.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:o(o([],r(Pe(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=i.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:o(o([],r(Pe(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=l[n].insertRule,o.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:o},index:Pe(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=r.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&n({id:i,remove:{property:e},index:Pe(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){we.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Ae=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),Le=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){xe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Te(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),je=0;je<De.length;je++)$e[De.charCodeAt(je)]=je;var qe=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=De[n[t]>>2],o+=De[(3&n[t])<<4|n[t+1]>>4],o+=De[(15&n[t+1])<<2|n[t+2]>>6],o+=De[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Be=new Map;var He=function(e,t,n){if(e&&(Ve(e,t)||"object"===s(e))){var r=function(e,t){var n=Be.get(e);return n||(n=new Map,Be.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function Ue(e,t,n){return e instanceof Array?e.map((function(e){return Ue(e,t,n)})):null===e?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:qe(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}:Ve(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:He(e,t,n)}:e}var We=function(e,t,n){return o([],r(e),!1).map((function(e){return Ue(e,t,n)}))},Ve=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,i,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=re(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(He(p,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var f=We(o([],r(l),!1),u,e),h={type:t,property:n,args:f};i(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=ne(e,n,{set:function(e){i(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ge,Qe,Je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=function(e,t){var n=[];try{var i=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,o([n],r(i),!1))}}));n.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,i,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,i)||setTimeout((function(){var t=o([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var i=t[0],u=i.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,i.width,i.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:q["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:q["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,i){var a=[];return a.push.apply(a,o([],r(ze(t.WebGLRenderingContext.prototype,q.WebGL,e,n,i,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,o([],r(ze(t.WebGL2RenderingContext.prototype,q.WebGL2,e,n,i,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){i(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=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}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Xe(e){return t(t({},e),{timestamp:Date.now()})}var Ze={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ye(e){void 0===e&&(e={});var o=e.emit,i=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,O=e.sampling,x=void 0===O?{}:O,E=e.mousemoveWait,T=e.recordCanvas,M=void 0!==T&&T,F=e.userTriggeredOnInput,R=void 0!==F&&F,P=e.collectFonts,N=void 0!==P&&P,A=e.inlineImages,L=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,B=void 0===q?function(){return!1}:q;if(!o)throw new Error("emit function is required");void 0!==E&&void 0===x.mousemove&&(x.mousemove=E);var H,U=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ge=function(e,t){var r;if(!(null===(r=we[0])||void 0===r?void 0:r.isFrozen())||e.type===D.FullSnapshot||e.type===D.IncrementalSnapshot&&e.data.source===$.Mutation||we.forEach((function(e){return e.unfreeze()})),o(function(e){var t,r;try{for(var o=n(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===D.FullSnapshot)H=e,V=0;else if(e.type===D.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=i&&e.timestamp-H.timestamp>i;(s||u)&&Qe(!0)}};var z=function(e){Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},Q=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},J=new Ae({mutationCb:z}),X=new Je({recordCanvas:M,mutationCb:Q,win:window,blockClass:u,mirror:Ze}),K=new Le({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:U,maskTextFn:S,maskInputFn:k,recordCanvas:M,inlineImages:L,sampling:x,slimDOMOptions:W,iframeManager:J,canvasManager:X},mirror:Ze});Qe=function(e){var t,n,o,i;void 0===e&&(e=!1),Ge(Xe({type:D.Meta,data:{href:window.location.href,width:ie(),height:oe()}}),e),we.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,i=n.blockSelector,a=void 0===i?null:i,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,O=n.onIframeLoad,x=n.iframeLoadTimeout,E=n.keepIframeSrcFn,T={};return[Z(e,{doc:e,map:T,blockClass:o,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:O,iframeLoadTimeout:x,keepIframeSrcFn:void 0===E?function(){return!1}:E}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:U,maskTextFn:S,slimDOM:W,recordCanvas:M,inlineImages:L,onSerialize:function(e){le(e)&&J.addIframe(e),de(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),K.observeAttachShadow(e)},keepIframeSrcFn:B}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Ze.map=c,Ge(Xe({type:D.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),we.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(Y("DOMContentLoaded",(function(){Ge(Xe({type:D.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Xe({type:D.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:U,inlineStylesheet:_,sampling:x,recordCanvas:M,inlineImages:L,userTriggeredOnInput:R,collectFonts:N,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Ze,iframeManager:J,shadowDomManager:K,canvasManager:X,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Xe({type:D.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Qe(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(Y("load",(function(){Ge(Xe({type:D.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ye.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Xe({type:D.Custom,data:{tag:e,payload:t}}))},Ye.freezePage=function(){we.forEach((function(e){return e.freeze()}))},Ye.takeFullSnapshot=function(e){if(!Qe)throw new Error("please take full snapshot after start recording");Qe(e)},Ye.mirror=Ze;var Ke=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(tt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Ke({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ke({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Ke({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ke({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function ot(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function it(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=n(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(it(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1}function st(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(it(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(it(e)&&at(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=ot(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var ut={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function ct(e,t,i){var a,s,u,c=i.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(i.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,o=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(i.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,i.stringifyOptions)}));++l<i.lengthThreshold?e({level:n,trace:c,payload:d}):l===i.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,o(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var lt="undefined"!=typeof window?window:{};lt.rrweb={record:Ye,version:"v1",rrwebVersion:"1.1.3"},lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:ct,options:e?Object.assign({},ut,e):ut}}};var dt=String.fromCharCode,pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",ht={};function vt(e,t){if(!ht[e]){ht[e]={};for(var n=0;n<e.length;n++)ht[e][e.charAt(n)]=n}return ht[e][t]}var gt={compressToBase64:function(e){if(null==e)return"";var t=gt._compress(e,6,(function(e){return pt.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:gt._decompress(e.length,32,(function(t){return vt(pt,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":gt._compress(e,15,(function(e){return dt(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:gt._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=gt.compress(e),n=new Uint8Array(2*t.length),r=0,o=t.length;r<o;r++){var i=t.charCodeAt(r);n[2*r]=i>>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(e){if(null==e)return gt.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var o=[];return t.forEach((function(e){o.push(dt(e))})),gt.decompress(o.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":gt._compress(e,6,(function(e){return ft.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),gt._decompress(e.length,32,(function(t){return vt(ft,e.charAt(t))})))},compress:function(e){return gt._compress(e,16,(function(e){return dt(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,o,i,a="",s="",u="",c=2,l=3,d=2,p=0,f=0,h={},v={},g=[];for(i=0;i<e.length;i+=1)if(a=e.charAt(i),Object.prototype.hasOwnProperty.call(h,a)||(h[a]=l++,v[a]=!0),s=u+a,Object.prototype.hasOwnProperty.call(h,s))u=s;else{if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++),h[s]=l++,u=String(a)}if(""!==u){if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++)}for(o=2,r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=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:gt._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,o,i,a,s,u,c,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,v=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(i=0,s=Math.pow(2,2),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 2:return""}for(l[3]=c,o=c,d.push(c);;){if(p.index>e)return"";for(i=0,s=Math.pow(2,v),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(c=i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,v),v++),l[c])g=l[c];else{if(c!==h)return null;g=o+o.charAt(0)}d.push(g),l[h++]=o+g.charAt(0),o=g,0==--f&&(f=Math.pow(2,v),v++)}}},mt={DEBUG:!1,LIB_VERSION:"1.53.4"},_t=Array.prototype,yt=Object.prototype,bt=yt.toString,wt=yt.hasOwnProperty,kt="undefined"!=typeof window?window:{},St=kt.navigator||{userAgent:""},Ct=kt.document||{},It=St.userAgent,Ot=["localhost","127.0.0.1"],xt=_t.forEach,Et=_t.indexOf,Tt=Array.isArray,Mt={},Ft={log:function(){if(mt.DEBUG&&!qt(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;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){Nt(n,(function(t){e(t)}))}}},error:function(){if(mt.DEBUG&&!qt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}},critical:function(){if(!qt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}}},Rt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Pt(e,t,n){if(null!=e)if(xt&&Array.isArray(e)&&e.forEach===xt)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)===Mt)return}else for(var i in e)if(wt.call(e,i)&&t.call(n,e[i],i)===Mt)return}function Nt(e,t,n){if(Array.isArray(e))if(xt&&e.forEach===xt)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)===Mt)return}var At=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Lt=Tt||function(e){return"[object Array]"===bt.call(e)},Dt=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function $t(e,t){return-1!==e.indexOf(t)}var jt=function(e){return e===Object(e)&&!Lt(e)},qt=function(e){return void 0===e},Bt=function(e){return"[object String]"==bt.call(e)},Ht=function(e){return"[object Number]"==bt.call(e)},Ut=function e(t){return Pt(t,(function(n,r){!function(e){return"[object Date]"==bt.call(e)}(n)?jt(n)&&(t[r]=e(n)):t[r]=Wt(n)})),t},Wt=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Vt=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Ft.critical("Implementation error. Please turn on debug and contact support@posthog.com."),Ft.critical(e)}}},zt=function(e){var t={};return Pt(e,(function(e,n){Bt(e)&&e.length>0&&(t[n]=e)})),t};var Gt=["$performance_raw"];function Qt(e,t){return n=e,r=function(e,n){return n&&Gt.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},o=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:o.has(t)?void 0:(o.add(t),Lt(t)?(i=[],Nt(t,(function(t){i.push(e(t))}))):(i={},Pt(t,(function(t,n){o.has(t)||(i[n]=e(t,n))}))),i);var i}(n);var n,r,o}function Jt(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Zt(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(o)}while(s<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}var Xt,Zt=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var a=e.charCodeAt(o),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},Yt=(Xt=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return Xt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=It,r=0,o=[];function i(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=o[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),o.unshift(255&t),o.length>=4&&(r=i(r,o),o=[]);return o.length>0&&(r=i(r,o)),r.toString(16)}()+"-"+e+"-"+Xt()}),Kt=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(e)},en=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 o=r[1];try{o=decodeURIComponent(o)}catch(e){Ft.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},tn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},nn=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 a="on"+n,s=t[a];t[a]=function(t,n,r){return function(o){if(o=o||e(window.event)){var i,a=!0;Dt(r)&&(i=r(o));var s=n.call(t,o);return!1!==i&&!1!==s||(a=!1),a}}}(t,r,s)}else Ft.error("No valid element provided to register_event")}}(),rn={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return Pt(t,(function(e){var t=en(Ct.URL,e);t.length&&(n[e]=t)})),n},searchEngine:function(){var e=Ct.referrer;return e?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:null},searchInfo:function(){var e=rn.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(null!==e){n.$search_engine=e;var r=en(Ct.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||$t(e," OPR/")?$t(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":$t(e,"IEMobile")||$t(e,"WPDesktop")?"Internet Explorer Mobile":$t(e,"SamsungBrowser/")?"Samsung Internet":$t(e,"Edge")||$t(e,"Edg/")?"Microsoft Edge":$t(e,"FBIOS")?"Facebook Mobile":$t(e,"Chrome")?"Chrome":$t(e,"CriOS")?"Chrome iOS":$t(e,"UCWEB")||$t(e,"UCBrowser")?"UC Browser":$t(e,"FxiOS")?"Firefox iOS":$t(t,"Apple")?$t(e,"Mobile")?"Mobile Safari":"Safari":$t(e,"Android")?"Android Mobile":$t(e,"Konqueror")?"Konqueror":$t(e,"Firefox")?"Firefox":$t(e,"MSIE")||$t(e,"Trident/")?"Internet Explorer":$t(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+)?)/}[rn.browser(e,t,n)];if(void 0===r)return null;var o=e.match(r);return o?parseFloat(o[o.length-2]):null},browserLanguage:function(){return St.language||St.userLanguage},os:function(){var e=It;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"},referrer:function(){return Ct.referrer||"$direct"},referringDomain:function(){if(!Ct.referrer)return"$direct";var e=Ct.createElement("a");return e.href=Ct.referrer,e.host},properties:function(){return At(zt({$os:rn.os(),$browser:rn.browser(It,St.vendor,kt.opera),$device:rn.device(It),$device_type:rn.deviceType(It)}),{$current_url:null==kt?void 0:kt.location.href,$host:null==kt?void 0:kt.location.host,$pathname:null==kt?void 0:kt.location.pathname,$browser_version:rn.browserVersion(It,St.vendor,kt.opera),$browser_language:rn.browserLanguage(),$screen_height:null==kt?void 0:kt.screen.height,$screen_width:null==kt?void 0:kt.screen.width,$viewport_height:null==kt?void 0:kt.innerHeight,$viewport_width:null==kt?void 0:kt.innerWidth,$lib:"web",$lib_version:mt.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 At(zt({$os:rn.os(),$browser:rn.browser(It,St.vendor,kt.opera)}),{$browser_version:rn.browserVersion(It,St.vendor,kt.opera)})}};function on(e){switch(s(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function an(e){var t="";return pn(e)&&!fn(e)&&e.childNodes&&e.childNodes.length&&Pt(e.childNodes,(function(e){cn(e)&&e.textContent&&(t+=Rt(e.textContent).split(/(\s+)/).filter(hn).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Rt(t)}function sn(e){return!!e&&1===e.nodeType}function un(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function cn(e){return!!e&&3===e.nodeType}function ln(e){return!!e&&11===e.nodeType}var dn=["a","button","form","input","select","textarea","label"];function pn(e){for(var t=e;t.parentNode&&!un(t,"body");t=t.parentNode){var n=on(t).split(" ");if($t(n,"ph-sensitive")||$t(n,"ph-no-capture"))return!1}if($t(on(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 fn(e){return!!(un(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||un(e,"select")||un(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function hn(e){if(null===e||qt(e))return!1;if("string"==typeof e){e=Rt(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 vn(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,o=document.querySelectorAll("body > script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):document.body.appendChild(n)}function gn(e){var t=an(e);return hn(t="".concat(t," ").concat(mn(e)).trim())?t:""}function mn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pt(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=an(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(mn(e)).trim())}catch(e){console.error(e)}})),t}var _n=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return l(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),yn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,bn={is_supported:function(){return!0},error:function(e){Ft.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=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(e){}return null},parse:function(e){var t;try{t=JSON.parse(bn.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,o){try{var i="",a="",s="";if(r){var u=document.location.hostname.match(yn),c=u?u[0]:"";i=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(s="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+i+s;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{bn.set(e,"",-1,t)}catch(e){return}}},wn=null,kn={is_supported:function(){if(null!==wn)return wn;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";kn.set(t,"xyz"),'"xyz"'!==kn.get(t)&&(e=!1),kn.remove(t)}catch(t){e=!1}else e=!1;return e||Ft.error("localStorage unsupported; falling back to cookie store"),wn=e,e},error:function(e){Ft.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){kn.error(e)}return null},parse:function(e){try{return JSON.parse(kn.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){kn.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){kn.error(e)}}},Sn=a(a({},kn),{},{parse:function(e){try{var t={};try{(t=bn.parse(e)||{}).distinct_id&&bn.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=At(t,JSON.parse(kn.get(e)||"{}"));return kn.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{kn.set(e,t),t.distinct_id&&bn.set(e,{distinct_id:t.distinct_id},n,r,o)}catch(e){kn.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),bn.remove(e,t)}catch(e){kn.error(e)}}}),Cn={},In={is_supported:function(){return!0},error:function(e){Ft.error("memoryStorage error: "+e)},get:function(e){return Cn[e]||null},parse:function(e){return Cn[e]||null},set:function(e,t){Cn[e]=t},remove:function(e){delete Cn[e]}},On=null,xn={is_supported:function(){if(null!==On)return On;if(On=!0,"undefined"!=typeof window)try{var e="__support__";xn.set(e,"xyz"),'"xyz"'!==xn.get(e)&&(On=!1),xn.remove(e)}catch(e){On=!1}else On=!1;return On},error:function(e){mt.DEBUG&&Ft.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){xn.error(e)}return null},parse:function(e){try{return JSON.parse(xn.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){xn.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){xn.error(e)}}},En="$people_distinct_id",Tn="__alias",Mn="__timers",Fn="$autocapture_disabled_server_side",Rn="$session_recording_enabled_server_side",Pn="$console_log_recording_enabled_server_side",Nn="$session_recording_recorder_version_server_side",An="$sesid",Ln="$enabled_feature_flags",Dn="$user_state",$n=[En,Tn,"__cmpns",Mn,Rn,An,Ln,Dn],jn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],qn=function(){function e(t){u(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===jn.indexOf(t.persistence.toLowerCase())&&(Ft.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&kn.is_supported()?this.storage=kn:"localstorage+cookie"===r&&Sn.is_supported()?this.storage=Sn:"sessionstorage"===r&&xn.is_supported()?this.storage=xn:this.storage="memory"===r?In:bn,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return l(e,[{key:"properties",value:function(){var e={};return Pt(this.props,(function(t,n){if(n===Ln&&"object"===s(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/".concat(r[o])]=t[r[o]];else a=n,u=!1,(null===(i=$n)?u:Et&&i.indexOf===Et?-1!=i.indexOf(a):(Pt(i,(function(e){if(u||(u=e===a))return Mt})),u))||(e[n]=t);var i,a,u})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=At({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(jt(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var o=!1;if(Pt(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,o=!0)})),o)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(jt(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(Pt(e,(function(t,o){e.hasOwnProperty(o)&&n.props[o]!==t&&(n.props[o]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(rn.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(rn.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||rn.referrer(),$referring_domain:this.props.$referring_domain||rn.referringDomain()})}},{key:"get_referrer_info",value:function(){return zt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Pt(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Mn]||{};n[e]=t,this.props[Mn]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Mn]||{})[e];return qt(t)||(delete this.props[Mn][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Dn]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Dn]=e,this.save()}}]),e}(),Bn={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(Fn),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!sn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!pn(e))return{};var t={};return Pt(e.attributes,(function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&hn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};dn.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=gn(e):o.$el_text=an(e));var i=on(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),Pt(e.attributes,(function(n){var r;fn(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&hn(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 a=1,s=1,u=e;u=this._previousElementSibling(u);)a++,u.tagName===e.tagName&&s++;return o.nth_child=a,o.nth_of_type=s,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return Pt(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),hn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return Pt(this._customProperties,(function(r){Pt(r.event_selectors,(function(o){Pt(document.querySelectorAll(o),(function(o){$t(e,o)&&pn(o)&&(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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",i=this._getEventTarget(e);(cn(i)&&(i=i.parentNode||null),"$autocapture"===o&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(i&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||un(e,"html")||!sn(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,o=n.url_allowlist;if(o&&!o.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!un(d,"body");)if(ln(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(dn.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){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 u?"click"===t.type:"click"===t.type&&(dn.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.config)){for(var a=[i],s=i;s.parentNode&&!un(s,"body");)ln(s.parentNode)?(a.push(s.parentNode.host),s=s.parentNode.host):(a.push(s.parentNode),s=s.parentNode);var u,c=[],l={},d=!1;if(Pt(a,(function(e){var n=pn(e);"a"===e.tagName.toLowerCase()&&(u=e.getAttribute("href"),u=n&&hn(u)&&u),$t(on(e).split(" "),"ph-no-capture")&&(d=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var o=r._getAugmentPropertiesFromElement(e);At(l,o)})),t.get_config("mask_all_text")||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?c[0].$el_text=gn(i):c[0].$el_text=an(i)),u&&(c[0].attr__href=u),d)return!1;var p=At(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(a),l);return t.capture(o,p),!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)};nn(document,"submit",n,!1,!0),nn(document,"change",n,!1,!0),nn(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new _n(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?Ft.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(d({},Fn,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=qt(t)?10:t,n=qt(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return Dt(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(Bn),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Vt(e[t]))}(Bn);var Hn="__ph_opt_in_out_";function Un(e,t){Zn(!0,e,t)}function Wn(e,t){Zn(!1,e,t)}function Vn(e,t){return"1"===Xn(e,t)}function zn(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||kt,n=t.navigator||{},r=!1;return Pt([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){$t([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Xn(e,t)}function Gn(e,t){Qn(t=t||{}).remove(Jn(e,t),!!t.crossSubdomainCookie)}function Qn(e){return"localStorage"===(e=e||{}).persistenceType?kn:"localStorage+cookie"===e.persistenceType?Sn:bn}function Jn(e,t){return((t=t||{}).persistencePrefix||Hn)+e}function Xn(e,t){return Qn(t).get(Jn(e,t))}function Zn(e,t,n){Bt(t)&&t.length?(Qn(n=n||{}).set(Jn(t,n),e?1:0,Ht(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Yn(e,t){var n=!1;try{var r=e.get_config("token"),o=e.get_config("respect_dnt"),i=e.get_config("opt_out_capturing_persistence_type"),a=e.get_config("opt_out_capturing_cookie_prefix")||void 0,s=e.get_config("window");r&&(n=zn(r,{respectDnt:o,persistenceType:i,persistencePrefix:a,window:s}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function Kn(e,t,n){return function(){for(var r=Yn(e,n),o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];if(!r)return t.apply(this,i);var s=i[i.length-1];"function"==typeof s&&s(0)}}var er="$set",tr=function(){function e(t){var n=this;u(this,e),this._posthog=t,this.set=Kn(t,(function(e,t,r){var o=n.set_action(e,t);return jt(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.sessionPersistence.update_referrer_info(),o[er]=At({},rn.people_properties(),n._posthog.sessionPersistence.get_referrer_info(),o[er]),n._send_request(o,r)})),this.set_once=Kn(t,(function(e,t,r){var o=n.set_once_action(e,t);return jt(e)&&(r=t),n._send_request(o,r)}))}return l(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),o=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),o&&(e.$had_persisted_distinct_id=o);var i=Ut(e),a=Qt(i,this._get_config("properties_string_max_length")),s=Jt(JSON.stringify(i));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:s},{},this._posthog._prepare_callback(t,a)),a}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(er,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,o={},i={};return jt(t)?Pt(t,(function(e,t){r._is_reserved_property(t)||(i[t]=e)})):i[t]=n,o[e]=i,o}}]),e}(),nr="$active_feature_flags",rr="$enabled_feature_flags",or="$override_feature_flags",ir="$feature_flag_payloads",ar=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return l(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(rr),t=this.instance.get_property(or);if(!t)return e||{};for(var n=At({},e),r=Object.keys(t),o=0;o<r.length;o++)!1===t[r[o]]?delete n[r[o]]:n[r[o]]=t[r[o]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ir)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=Jt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&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:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{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:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,i=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var s,u={};if(o)for(var c=0;c<o.length;c++)u[o[c]]=!0;t&&t.register((d(s={},nr,o),d(s,rr,u),s))}else{var l,p=o,f=i;e.errorsWhileComputingFlags&&(p=a(a({},n),p),f=a(a({},r),f)),t&&t.register((d(l={},nr,Object.keys(p||{})),d(l,rr,p||{}),d(l,ir,f||{}),l))}else t&&(t.unregister(nr),t.unregister(rr),t.unregister(ir))}(e,this.instance.persistence,t,n);var r=this._prepareFeatureFlagsForCallbacks(),o=r.flags,i=r.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,i)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(or);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},or,t))}else this.instance.persistence.register(d({},or,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,o=n.flagVariants;e(r,o)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}}]),e}(),sr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",ur=2,cr=4,lr=6;var dr="rrweb/console@1";var pr="/e/",fr=function(){function e(t){u(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=pr,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return l(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(Rn),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Pn),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Nn);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,o,i,a;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((d(i={},Rn,!!e.sessionRecording),d(i,Pn,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),d(i,Nn,null===(o=e.sessionRecording)||void 0===o?void 0:o.recorderVersion),i));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(a=e.sessionRecording)||void 0===a?void 0:a.endpoint);null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?vn(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(mt.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),r=this.instance.sessionManager.checkAndGetSessionAndWindowId(n,e.timestamp),o=r.windowId,i=r.sessionId;if(this.captureStarted&&(this.windowId!==o||this.sessionId!==i)&&-1===[ur,cr].indexOf(e.type))try{var a;null===(a=this.rrwebRecord)||void 0===a||a.takeFullSnapshot()}catch(e){Ft.error("Error taking full snapshot.",e)}this.windowId=o,this.sessionId=i}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var n=this.instance.get_config("session_recording"),r=0,o=Object.entries(n||{});r<o.length;r++){var i=_(o[r],2),s=i[0],u=i[1];s in t&&(t[s]=u)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(a({emit:function(t){e.onRRwebEmit(t)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook((function(t){try{var n;if("$pageview"===t)null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href})}catch(e){Ft.error("Could not add $pageview to rrweb session",e)}}))):Ft.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){e=function(e){if(e&&"object"===s(e)&&e.type===lr&&"object"===s(e.data)&&e.data.plugin===dr){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===s(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,r=k(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],sr):t.replace(o[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),this._updateWindowAndSessionIds(e);var t={$snapshot_data:e,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),this.emit?this._captureSnapshot(t):this.snapshots.push(t)}},{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===ur}})}}]),e}(),hr={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},vr=["first-input","navigation","paint","resource"],gr=["/s/","/e/"],mr=function(){function e(t){u(this,e),d(this,"_forceAllowLocalhost",!1),this.instance=t}return l(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)if(!Ot.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))}));var t=PerformanceObserver.supportedEntryTypes.filter((function(e){return vr.includes(e)}));t.forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(e){console.error("PostHog failed to start performance observer",e),this.stopObserving()}else Ft.log("PostHog Peformance observer not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(gr.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},o=Math.floor(Date.now()-performance.now());for(var i in r[hr.timeOrigin]=o,r[hr.timestamp]=Math.floor(o+e.startTime),hr)void 0!==n[i]&&(r[hr[i]]=n[i]);if(this.capturePerformanceEvent(r),_r(e)){var a,s=k(e.serverTiming||[]);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;this.capturePerformanceEvent((d(u={},hr.timeOrigin,o),d(u,hr.timestamp,Math.floor(o+e.startTime)),d(u,hr.name,c.name),d(u,hr.duration,c.duration),d(u,hr.entryType,"serverTiming"),u))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[hr.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),_r=function(e){return"navigation"===e.entryType||"resource"===e.entryType},yr=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return l(e,[{key:"call",value:function(){var e=this,t=Jt(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=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r=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(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Bn.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var o,i={},a=k(e.supportedCompression);try{for(a.s();!(o=a.n()).done;){i[o.value]=!0}}catch(e){a.e(e)}finally{a.f()}this.instance.compression=i}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var s,u=this.instance.get_config("api_host"),c=k(e.siteApps);try{var l=function(){var e=s.value,t=e.id,n=e.url,o=document.createElement("script");o.src=[u,"/"===u[u.length-1]&&"/"===n[0]?n.substring(1):n].join(""),o.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(o)};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),br=["https://app.posthog.com","https://eu.posthog.com"],wr=["source"],kr=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a(a({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",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,o=tn(e.hash,"__posthog")||tn(e.hash,"state"),i=o?JSON.parse(decodeURIComponent(o)):null;return i&&"ph_authorize"===i.action?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var n=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),r=3e4*Math.floor(Date.now()/3e4),o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(r),i=!br.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=a(a({apiURL:n,jsURL:n,token:this.instance.get_config("token")},e),i?{instrument:!1}:{});s.source;var u=v(s,wr);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),vn(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(s,t.instance)})),nn(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(s)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{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;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return l(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}(),Cr=function(e){p(n,e);var t=m(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return u(this,n),(o=t.call(this,i)).handlePollRequest=r,o.captureMetrics=e,o}return l(n,[{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],o=r.url,i=r.data,a=r.options;Pt(i,(function(t,n){i[n].offset=Math.abs(i[n].timestamp-e.getTime()),delete i[n].timestamp})),e.handlePollRequest(o,i,a),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(o.slice(o.length-2))),e.captureMetrics.incr("batch-handle",i.length),e.captureMetrics.incr("batch-handle-".concat(o.slice(o.length-2)),i.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,o=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",o.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),o.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,o=t.options;e.handlePollRequest(n,r,a(a({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return Pt(this._event_queue,(function(t){var n=t.url,r=t.data,o=t.options,i=(o?o._batchKey:null)||n;void 0===e[i]&&(e[i]={data:[],url:n,options:o}),o&&e[i].options&&e[i].options._metrics&&!e[i].options._metrics.rrweb_full_snapshot&&(e[i].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),e[i].data.push(r)})),e}}]),n}(Sr),Ir=function(){function e(t){u(this,e),this.enabled=t,this.metrics={}}return l(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}(),Or=Uint8Array,xr=Uint16Array,Er=Uint32Array,Tr=new Or([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]),Mr=new Or([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]),Fr=new Or([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rr=function(e,t){for(var n=new xr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Er(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Pr=Rr(Tr,2),Nr=Pr[0],Ar=Pr[1];Nr[28]=258,Ar[258]=28;for(var Lr=Rr(Mr,0)[1],Dr=new xr(32768),$r=0;$r<32768;++$r){var jr=(43690&$r)>>>1|(21845&$r)<<1;jr=(61680&(jr=(52428&jr)>>>2|(13107&jr)<<2))>>>4|(3855&jr)<<4,Dr[$r]=((65280&jr)>>>8|(255&jr)<<8)>>>1}var qr=function(e,t,n){for(var r=e.length,o=0,i=new xr(t);o<r;++o)++i[e[o]-1];var a,s=new xr(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new xr(1<<t);var u=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],d=s[e[o]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)a[Dr[d]>>>u]=c}else for(a=new xr(r),o=0;o<r;++o)a[o]=Dr[s[e[o]-1]++]>>>15-e[o];return a},Br=new Or(288);for($r=0;$r<144;++$r)Br[$r]=8;for($r=144;$r<256;++$r)Br[$r]=9;for($r=256;$r<280;++$r)Br[$r]=7;for($r=280;$r<288;++$r)Br[$r]=8;var Hr=new Or(32);for($r=0;$r<32;++$r)Hr[$r]=5;var Ur,Wr=qr(Br,9,0),Vr=qr(Hr,5,0),zr=function(e){return(e/8>>0)+(7&e&&1)},Gr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof xr?xr:e instanceof Er?Er:Or)(n-t);return r.set(e.subarray(t,n)),r},Qr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Jr=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},Xr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new Or(0),0];if(1==o){var a=new Or(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:s.f+u.f,l:s,r:u};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new xr(p+1),h=Zr(n[l-1],f,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var _=i[r].s;if(!(f[_]>t))break;v+=m-(1<<h-f[_]),f[_]=t}for(v>>>=g;v>0;){var y=i[r].s;f[y]<t?v-=1<<t-f[y]++-1:++r}for(;r>=0&&v;--r){var b=i[r].s;f[b]==t&&(--f[b],++v)}h=t}return[new Or(f),h]},Zr=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},Yr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new xr(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Kr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},eo=function(e,t,n){var r=n.length,o=zr(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},to=function(e,t,n,r,o,i,a,s,u,c,l){Qr(t,l++,n),++o[256];for(var d=Xr(o,15),p=d[0],f=d[1],h=Xr(i,15),v=h[0],g=h[1],m=Yr(p),_=m[0],y=m[1],b=Yr(v),w=b[0],k=b[1],S=new xr(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var I=Xr(S,7),O=I[0],x=I[1],E=19;E>4&&!O[Fr[E-1]];--E);var T,M,F,R,P=c+5<<3,N=Kr(o,Br)+Kr(i,Hr)+a,A=Kr(o,p)+Kr(i,v)+a+14+3*E+Kr(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(P<=N&&P<=A)return eo(t,l,e.subarray(u,u+c));if(Qr(t,l,1+(A<N)),l+=2,A<N){T=qr(p,f,0),M=p,F=qr(v,g,0),R=v;var L=qr(O,x,0);Qr(t,l,y-257),Qr(t,l+5,k-1),Qr(t,l+10,E-4),l+=14;for(C=0;C<E;++C)Qr(t,l+3*C,O[Fr[C]]);l+=3*E;for(var D=[_,w],$=0;$<2;++$){var j=D[$];for(C=0;C<j.length;++C){var q=31&j[C];Qr(t,l,L[q]),l+=O[q],q>15&&(Qr(t,l,j[C]>>>5&127),l+=j[C]>>>12)}}}else T=Wr,M=Br,F=Vr,R=Hr;for(C=0;C<s;++C)if(r[C]>255){q=r[C]>>>18&31;Jr(t,l,T[q+257]),l+=M[q+257],q>7&&(Qr(t,l,r[C]>>>23&31),l+=Tr[q]);var B=31&r[C];Jr(t,l,F[B]),l+=R[B],B>3&&(Jr(t,l,r[C]>>>5&8191),l+=Mr[B])}else Jr(t,l,T[r[C]]),l+=M[r[C]];return Jr(t,l,T[256]),l+M[256]},no=new Er([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ro=new Or(0),oo=function(){for(var e=new Er(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),io=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=oo[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ao=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Or(r+a+5*(1+Math.floor(a/7e3))+o),u=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=eo(u,c,e.subarray(l,d)):(u[l]=i,c=eo(u,c,e.subarray(l,a)))}else{for(var p=no[t-1],f=p>>>13,h=8191&p,v=(1<<n)-1,g=new xr(32768),m=new xr(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},w=new Er(25e3),k=new xr(288),S=new xr(32),C=0,I=0,O=(l=0,0),x=0,E=0;l<a;++l){var T=b(l),M=32767&l,F=m[T];if(g[M]=F,m[T]=M,x<=l){var R=a-l;if((C>7e3||O>24576)&&R>423){c=to(e,u,0,w,k,S,I,O,E,l-E,c),O=C=I=0,E=l;for(var P=0;P<286;++P)k[P]=0;for(P=0;P<30;++P)S[P]=0}var N=2,A=0,L=h,D=M-F&32767;if(R>2&&T==b(l-D))for(var $=Math.min(f,R)-1,j=Math.min(32767,l),q=Math.min(258,R);D<=j&&--L&&M!=F;){if(e[l+N]==e[l+N-D]){for(var B=0;B<q&&e[l+B]==e[l+B-D];++B);if(B>N){if(N=B,A=D,B>$)break;var H=Math.min(D,B-2),U=0;for(P=0;P<H;++P){var W=l-D+P+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,F=W)}}}D+=(M=F)-(F=g[M])+32768&32767}if(A){w[O++]=268435456|Ar[N]<<18|Lr[A];var z=31&Ar[N],G=31&Lr[A];I+=Tr[z]+Mr[G],++k[257+z],++S[G],x=l+N,++C}else w[O++]=e[l],++k[e[l]]}}c=to(e,u,i,w,k,S,I,O,E,l-E,c),i||(c=eo(u,c,ro))}return Gr(s,0,r+zr(c)+o)}(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,!o)},so=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uo=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&&so(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)}},co=function(e){return 10+(e.filename&&e.filename.length+1||0)};function lo(e,t){void 0===t&&(t={});var n=io(),r=e.length;n.p(e);var o=ao(e,t,co(t),8),i=o.length;return uo(o,t),so(o,i-8,n.d()),so(o,i-4,r),o}function po(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Or(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new Or(o+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?i(u):u<2048?(i(192|u>>>6),i(128|63&u)):u>55295&&u<57344?(i(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),i(128|u>>>12&63),i(128|u>>>6&63),i(128|63&u)):(i(224|u>>>12),i(128|u>>>6&63),i(128|63&u))}return Gr(r,0,o)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(Ur||(Ur={}));var fo,ho,vo,go=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=mt.LIB_VERSION;var o=e.split("?");if(o.length>1){var i,a=k(o[1].split("&"));try{for(a.s();!(i=a.n()).done;){var s=i.value.split("=")[0];r[s]&&delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return Pt(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t})),o.join(r)}(r)},mo=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 o,i;return o=Array.isArray(t)||(i=t,"[object Uint8Array]"===Object.prototype.toString.call(i))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(o+="&compression="+t.compression),o},_o=function(e){var t=e.url,n=e.data,r=e.headers,o=e.options,i=e.captureMetrics,a=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(o.method||"GET",t,!0);var f=mo(n,o);i.incr("_send_request"),i.incr("_send_request_inflight"),Pt(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==o.method||o.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(i.incr("xhr-response"),i.incr("xhr-response-".concat(p.status)),i.decr("_send_request_inflight"),200===p.status){if(a){var e;try{e=JSON.parse(p.responseText)}catch(e){return void Ft.error(e)}a(e)}}else"function"==typeof c&&c(p),[401,403,404,500].indexOf(p.status)<0&&u.enqueue({url:t,data:n,options:o,headers:r,retriesPerformedSoFar:(s||0)+1,callback:a}),a&&a({status:0})},p.send(f)},yo=function(e){p(n,e);var t=m(n);function n(e,r){var o;return u(this,n),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=r,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return l(n,[{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.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.requestData;this._executeXhrRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=k(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,o=n.data,i=n.options;try{window.navigator.sendBeacon(r,mo(o,a(a({},i),{},{sendBeacon:!0})))}catch(e){mt.DEBUG&&console.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,o=e.headers,i=e.callback,a=e.retriesPerformedSoFar;_o({url:t,data:n||{},options:r||{},headers:o||{},retriesPerformedSoFar:a||0,callback:i,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(Sr),bo=18e5,wo=864e5,ko=function(){function e(t,n){u(this,e),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",this._canUseSessionStorage()){var o=xn.parse(this.window_id_storage_key),i=xn.parse(this.primary_window_exists_storage_key);o&&!i?this._windowId=o:xn.remove(this.window_id_storage_key),xn.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return l(e,[{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&xn.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&xn.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?xn.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(d({},An,[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[An];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:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&xn.remove(e.primary_window_exists_storage_key)}))}},{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)||(new Date).getTime(),n=_(this._getSessionId(),3),r=n[0],o=n[1],i=n[2],a=this._getWindowId(),s=i&&i>0&&Math.abs(t-i)>wo;!o||!e&&Math.abs(t-r)>bo||s?(o=Yt(),a=Yt(),i=t):a||(a=Yt());var u=0===r||!e||s?t:r,c=0===i?(new Date).getTime():i;return this._setWindowId(a),this._setSessionId(o,u,c),{sessionId:o,windowId:a}}}]),e}(),So=l((function e(t,n,r,o){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,a,s;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var u=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=u+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=u+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var c=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(a=c[0])||void 0===a?void 0:a.value,$sentry_exception_type:null===(s=c[0])||void 0===s?void 0:s.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),Co=function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},Io=function(){function e(){u(this,e),d(this,"_seenFirstPageView",!1)}return l(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=Yt()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=Yt()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(fo||(fo={}));var Oo=function(){},xo={},Eo="posthog",To=kt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Mo=!To&&-1===It.indexOf("MSIE")&&-1===It.indexOf("Mozilla"),Fo=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==Ct||null===(e=Ct.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:Oo,store_google:!0,custom_campaign_params:[],save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==kt||null===(n=kt.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,opt_in_site_apps:!1,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:Oo,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},Ro=function(e,t,n,r){var o,i=n!==Eo&&vo?n?vo[n]:void 0:vo,a={initComplete:!1,syncCode:!1},s=function(e){return function(t){a[e]||(a[e]=!0,a.initComplete&&a.syncCode&&(null==r||r(t)))}};if(i&&ho===fo.INIT_MODULE)o=i;else{if(i&&!Lt(i))return void console.error("You have already initialized "+n);o=new Po}if(o._init(e,t,n,s("initComplete")),o.toolbar.maybeLoadToolbar(),o.sessionRecording=new fr(o),o.sessionRecording.startRecordingIfEnabled(),o.webPerformance=new mr(o),o.webPerformance.startObservingIfEnabled(),o.__autocapture=o.get_config("autocapture"),Bn._setIsAutocaptureEnabled(o),Bn._isAutocaptureEnabled){o.__autocapture=o.get_config("autocapture");Bn.enabledForProject(o.get_config("token"),100,100)?Bn.isBrowserSupported()?Bn.init(o):(o.__autocapture=!1,Ft.log("Disabling Automatic Event Collection because this browser is not supported")):(o.__autocapture=!1,Ft.log("Not in active bucket: disabling Automatic Event Collection."))}return mt.DEBUG=mt.DEBUG||o.get_config("debug"),void 0!==i&&Lt(i)&&(o._execute_array.call(o.people,i.people),o._execute_array(i)),s("syncCode")(o),o},Po=function(){function e(){var t=this;u(this,e),this.config=Fo(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=So,this.segmentIntegration=function(){return Co(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new tr(this),this.featureFlags=new ar(this),this.feature_flags=this.featureFlags,this.toolbar=new kr(this),this.pageViewIdManager=new Io,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionPersistence=void 0,this.sessionManager=void 0}return l(e,[{key:"init",value:function(e,t,n){if(qt(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==Eo){var r=Ro(e,t,n,(function(e){vo[n]=e,e._loaded()}));return vo[n]=r,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,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var u,c={segmentRegister:!1,syncCode:!1},l=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==s||s(r)))}};(this.set_config(At({},Fo(),o,{name:i,token:e,callback_fn:(i===Eo?i:Eo+"."+i)+"._jsc"})),this._jsc=function(){},null!=kt&&null!==(t=kt.rrweb)&&void 0!==t&&t.record||null!=kt&&kt.rrwebRecord)&&(this.__loaded_recorder_version=null==kt||null===(u=kt.rrweb)||void 0===u?void 0:u.version);if(this._captureMetrics=new Ir(this.get_config("_capture_metrics")),this._requestQueue=new Cr(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new yo(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new qn(this.config),this.sessionManager=new ko(this.config,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new qn(a(a({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),o.segment?(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration()).then(l("segmentRegister"))):l("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var d,p,f=this.get_config("get_device_id")(Yt()),h=null!==(d=o.bootstrap)&&void 0!==d&&d.isIdentifiedID?f:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(p=o.bootstrap)&&void 0!==p&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var v,g,m=Object.keys((null===(v=o.bootstrap)||void 0===v?void 0:v.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),_=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlagPayloads)||{}).filter((function(e){return m[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(Yt());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}kt.addEventListener&&kt.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),l("syncCode")()}},{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 yr(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()||Nt(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(qt(e))return null;if(To)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&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.get_config("capture_pageleave")&&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||xo,Oo)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,i=function(e,t,n){return e===Ur.LZ64?[{data:gt.compressToBase64(t),compression:Ur.LZ64},n]:e===Ur.GZipJS?[lo(po(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:Ur.GZipJS}})]:[{data:Jt(t)},n]}((o=this.compression)[Ur.GZipJS]?Ur.GZipJS:o[Ur.LZ64]?Ur.LZ64:Ur.Base64,t,n),s=_(i,2),u=s[0],c=s[1];this._send_request(e,u,c,r)}},{key:"_send_request",value:function(e,t,n,r){if(Mo)this.__request_queue.push([e,t,n,r]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};n=At(o,n||{}),To||(n.method="GET");var i="sendBeacon"in kt.navigator&&"sendBeacon"===n.transport;if(e=go(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),jt(t)&&this.get_config("img")){var s=Ct.createElement("img");s.src=e,Ct.body.appendChild(s)}else if(i)try{kt.navigator.sendBeacon(e,mo(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(To)try{_o({url:e,data:t,headers:this.get_config("xhr_headers"),options:n,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var u,c=Ct.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=Ct.getElementsByTagName("script")[0];null===(u=l.parentNode)||void 0===u||u.insertBefore(c,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],o=[],i=[];Nt(e,(function(e){e&&(t=e[0],Lt(t)?i.push(e):"function"==typeof e?e.call(n):Lt(e)&&"alias"===t?r.push(e):Lt(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?i.push(e):o.push(e))}));var a=function(e,t){Nt(e,(function(e){if(Lt(e[0])){var n=t;Pt(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(o,this),a(i,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{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]:xo;if(this.__loaded&&!Yn(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||xo).transport;if(r&&(n.transport=r),qt(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!Kt(It)){this.sessionPersistence.update_search_keyword(),this.get_config("store_google")&&this.sessionPersistence.update_campaign_params(),this.get_config("save_referrer")&&this.sessionPersistence.update_referrer_info();var o={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=Qt(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&Ft.log("PostHog.js send",o);var i=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),s=n!==xo;return!this.get_config("request_batching")||s&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,i,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),Pt(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var n,r=this.persistence.remove_event_timer(e),o=a({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var i=a(a({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=i.distinct_id,o}var s=rn.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,l=u.windowId;o.$session_id=c,o.$window_id=l}if(null!==(n=this.webPerformance)&&void 0!==n&&n.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=At(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=s.$current_url,o}if(void 0!==r){var p=(new Date).getTime()-r;o.$duration=parseFloat((p/1e3).toFixed(3))}o=At({},rn.properties(),this.persistence.properties(),this.sessionPersistence.properties(),o);var f=this.get_config("property_blacklist");Lt(f)?Pt(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(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:"register_for_session",value:function(e){this.sessionPersistence.register(e)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"unregister_for_session",value:function(e){this.sessionPersistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return 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 o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Tn)&&(this.unregister(Tn),this.register({distinct_id:e}));var i="anonymous"===this.persistence.get_user_state();e!==r&&i?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,n){if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:a(a({},r),{},d({},e,t))}),n&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionPersistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(Yt());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(En)?(Ft.critical("Attempting to create alias for existing People user - aborting."),-2):(qt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Tn,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 t=a({},this.config);jt(e)&&(At(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),this.sessionPersistence&&this.sessionPersistence.update_config(this.config),kn.is_supported()&&"true"===kn.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(mt.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.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:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{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:"getSessionProperty",value:function(e){return this.sessionPersistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:Eo;return t!==Eo&&(t=Eo+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&kn.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")&&!bn.get("ph_optout")||(bn.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),this.get_config("disable_persistence")||this.sessionPersistence.disabled===t||this.sessionPersistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=At({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||{}),kn.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=At({enable_persistence:!0},e||{}),this._gdpr_call_func(Un,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=At({clear_persistence:!0},e||{});this._gdpr_call_func(Wn,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Vn,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(zn,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=At({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Gn,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(kt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(kt.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 gt.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Vt(e.prototype[t[n]])}(Po,["identify"]);var No={},Ao=function(){vo.init=function(e,t,n){if(n)return vo[n]||(vo[n]=No[n]=Ro(e||"",t||{},n,(function(e){vo[n]=No[n]=e,e._loaded()}))),vo[n];var r=vo;return No[Eo]?r=No[Eo]:e&&(r=Ro(e,t||{},Eo,(function(e){No[Eo]=e,e._loaded()})),No[Eo]=r),vo=r,ho===fo.INIT_SNIPPET&&(kt[Eo]=vo),Pt(No,(function(e,t){t!==Eo&&(vo[t]=e)})),r}},Lo=function(){function e(){e.done||(e.done=!0,Mo=!1,Pt(No,(function(e){e._dom_loaded()})))}Ct.addEventListener&&("complete"===Ct.readyState?e():Ct.addEventListener("DOMContentLoaded",e,!1)),nn(kt,"load",e,!0)};ho=fo.INIT_SNIPPET,qt(kt.posthog)&&(kt.posthog=[]),(vo=kt.posthog).__loaded||vo.config&&vo.persistence?console.error("PostHog library has already been downloaded at least once."):(Pt(vo._i,(function(e){e&&Lt(e)&&(No[e[2]]=Ro.apply(void 0,y(e)))})),Ao(),vo.init(),Pt(No,(function(e){e._loaded()})),Lo())}();
16
16
  //# sourceMappingURL=array.full.js.map