posthog-js 1.43.1 → 1.45.0
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.
- package/CHANGELOG.md +4 -0
- package/README.md +9 -0
- package/dist/array.full.js +16 -0
- package/dist/array.full.js.map +1 -0
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +26 -11
- package/dist/es.js.map +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.js +26 -11
- package/dist/module.js.map +1 -1
- package/dist/recorder.js +16 -0
- package/dist/recorder.js.map +1 -0
- package/lib/package.json +2 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -21,6 +21,15 @@ Testing on IE11 requires a bit more setup.
|
|
|
21
21
|
4. Export browserstack credentials: `export BROWSERSTACK_USERNAME=xxx BROWSERSTACK_ACCESS_KEY=xxx`.
|
|
22
22
|
5. Run tests: `npx testcafe "browserstack:ie" testcafe/e2e.spec.js`.
|
|
23
23
|
|
|
24
|
+
### Running local create react app example
|
|
25
|
+
|
|
26
|
+
You can use the create react app setup in `playground/nextjs` to test posthog-js as an npm module in a Nextjs application.
|
|
27
|
+
|
|
28
|
+
1. Run `posthog` locally on port 8000 (`DEBUG=1 TEST=1 ./bin/start`).
|
|
29
|
+
2. Run `python manage.py setup_dev --no-data` on posthog repo, which sets up a demo account.
|
|
30
|
+
3. Copy posthog token found in `http://localhost:8000/project/settings` and then
|
|
31
|
+
4. `cd playground/nextjs`and run `NEXT_PUBLIC_POSTHOG_KEY='<your-local-api-key>' yarn dev`
|
|
32
|
+
|
|
24
33
|
### Tiers of testing
|
|
25
34
|
|
|
26
35
|
1. Unit tests - this verifies the behavior of the library in bite-sized chunks. Keep this coverage close to 100%, test corner cases and internal behavior here
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
!function(){"use strict";
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */var e,t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)};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 _(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 m(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 x,O,E=1,T=new RegExp("[^a-z0-9-_:]");function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(F).join(""):null}catch(e){return null}}function F(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function N(e,t){return(e||"").replace(R,(function(e,n,r,o,i,a){var s,u=r||i||a,c=n||o||"";if(!u)return e;if(!P.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,L,$,j,q,B,U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function H(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 V(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?H(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=H(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=H(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?N(r,z()):"object"===t&&"data"===n&&r?H(e,r):r:H(e,r)}function G(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))||G(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,G(e.parentNode,t,n)}function Q(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,_=n.dataURLOptions,m=void 0===_?{}:_,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),F={},R=0,P=Array.from(t.attributes);R<P.length;R++){var A=P[R],D=A.name,L=A.value;F[D]=V(s,E,D,L)}if("link"===E&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=M($)),j&&(delete F.rel,delete F.href,F._cssText=N(j,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=M(t.sheet))&&(F._cssText=N(j,z()));if("input"===E||"textarea"===E||"select"===E){L=t.value;"radio"!==F.type&&"checkbox"!==F.type&&"submit"!==F.type&&"button"!==F.type&&L?F.value=C({type:F.type,tagName:E,value:L,maskInputOptions:h,maskInputFn:g}):t.checked&&(F.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?F.selected=!0:delete F.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.__rrweb_original__: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)||(F.rr_dataURL=t.toDataURL(m.type,m.quality));else if(!("__context"in t)){var q=t.toDataURL(m.type,m.quality),B=document.createElement("canvas");B.width=t.width,B.height=t.height,q!==B.toDataURL(m.type,m.quality)&&(F.rr_dataURL=q)}if("img"===E&&y){x||(x=s.createElement("canvas"),O=x.getContext("2d"));var U=t,W=U.crossOrigin;U.crossOrigin="anonymous";var H=function(){try{x.width=U.naturalWidth,x.height=U.naturalHeight,O.drawImage(U,0,0),F.rr_dataURL=x.toDataURL(m.type,m.quality)}catch(e){console.warn("Cannot inline img src="+U.currentSrc+"! Error: "+e)}W?F.crossOrigin=W:delete F.crossOrigin};U.complete&&0!==U.naturalWidth?H():U.onload=H}if("audio"!==E&&"video"!==E||(F.rr_mediaState=t.paused?"paused":"played",F.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(F.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(F.rr_scrollTop=t.scrollTop),S){var Q=t.getBoundingClientRect(),J=Q.width,X=Q.height;F={class:F.class,rr_width:J+"px",rr_height:X+"px"}}return"iframe"!==E||w(F.src)||(t.contentDocument||(F.rr_src=F.src),delete F.src),{type:e.Element,tagName:E,attributes:F,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=N(Y,z())}return ee&&(Y="SCRIPT_PLACEHOLDER"),!K&&!ee&&G(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 J(e){return void 0===e?"":e.toLowerCase()}function X(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,_=n.maskInputFn,m=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,x=n.onSerialize,O=n.onIframeLoad,T=n.iframeLoadTimeout,M=void 0===T?5e3:T,F=n.keepIframeSrcFn,R=void 0===F?function(){return!1}:F,P=n.preserveWhiteSpace,A=void 0===P||P,N=Q(t,{doc:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:R});if(!N)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&&(J(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(t.attributes.name)||"icon"===J(t.attributes.rel)||"apple-touch-icon"===J(t.attributes.rel)||"shortcut icon"===J(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&J(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(J(t.attributes.property).match(/^(og|twitter|fb):/)||J(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===J(t.attributes.name)||"googlebot"===J(t.attributes.name)||"bingbot"===J(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===J(t.attributes.name)||"generator"===J(t.attributes.name)||"framework"===J(t.attributes.name)||"publisher"===J(t.attributes.name)||"progid"===J(t.attributes.name)||J(t.attributes.property).match(/^article:/)||J(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===J(t.attributes.name)||"yandex-verification"===J(t.attributes.name)||"csrf-token"===J(t.attributes.name)||"p:domain_verify"===J(t.attributes.name)||"verify-v1"===J(t.attributes.name)||"verification"===J(t.attributes.name)||"shopify-checkout-api-token"===J(t.attributes.name)))return!0}}return!1}(N,m)&&(A||N.type!==e.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:-2;var D=Object.assign(N,{id:r});if(t.__sn=D,-2===r)return null;i[r]=t,x&&x(t);var L=!d;if(D.type===e.Element&&(L=L&&!D.needBlock,delete D.needBlock,t.shadowRoot&&(D.isShadowHost=!0)),(D.type===e.Document||D.type===e.Element)&&L){m.headWhitespace&&N.type===e.Element&&"head"===N.tagName&&(A=!1);for(var $={doc:o,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:x,onIframeLoad:O,iframeLoadTimeout:M,keepIframeSrcFn:R},j=0,q=Array.from(t.childNodes);j<q.length;j++){(W=X(q[j],$))&&D.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var B=0,U=Array.from(t.shadowRoot.childNodes);B<U.length;B++){var W;(W=X(U[B],$))&&(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&&O){var n=X(e,{doc:e,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:x,onIframeLoad:O,iframeLoadTimeout:M,keepIframeSrcFn:R});n&&O(t,n)}}),M),D}function Z(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"}(L||(L={})),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"}($||($={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(j||(j={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(q||(q={})),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"}(B||(B={}));var Y="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.",K={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};function ee(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 te(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 te(e,t,i||{},!0)}}function ne(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 re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ie(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||ie(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ie(e.parentNode,t)}function ae(e){return"__sn"in e&&-2===e.__sn.id}function se(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||se(e.parentNode,t))}function ue(e){return Boolean(e.changedTouches)}function ce(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function le(e){return Boolean(null==e?void 0:e.shadowRoot)}function de(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(K=new Proxy(K,{get:function(e,t,n){return"map"===t&&console.error(Y),Reflect.get(e,t,n)}}));var pe=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&&de(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&&de(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}(),fe=function(e,t){return"".concat(e,"@").concat(t)};function he(e){return"__sn"in e}var ve=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 pe,u=function(t){for(var n=t,r=-2;-2===r;)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=X(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){ce(n)&&e.iframeManager.addIframe(n),le(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;me(e.droppedSet,p)||_e(e.removes,p,e.mirror)?me(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 _=e.mirror.getId(v.value.parentNode),m=u(v.value);-1!==_&&-1!==m&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){_=e.mirror.getId(b.value.parentNode),m=u(b.value);if(-1!==_&&-1!==m){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(!ae(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ie(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:G(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})),ie(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 _=n(Array.from(l.style)),m=_.next();!m.done;m=_.next()){h=m.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=V(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);ie(t.target,e.blockClass)||ae(n)||(e.addedSet.has(n)?(ge(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||se(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[fe(r,o)]?ge(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||!ie(n,e.blockClass)){if(he(t)){if(ae(t))return;e.movedSet.add(t);var r=null;n&&he(n)&&(r=n.__sn.id),r&&(e.movedMap[fe(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ie(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 ge(e,t){e.delete(t),t.childNodes.forEach((function(t){return ge(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 me(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||me(e,n))}var ye=ve,be=[],we="undefined"!=typeof CSSGroupingRule,ke="undefined"!=typeof CSSMediaRule,Se="undefined"!=typeof CSSSupportsRule,Ce="undefined"!=typeof CSSConditionRule;function Ie(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 ye;be.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 Oe(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($).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=Ie(n);if(!ie(i,o)){var a=ue(n)?n.changedTouches[0]:n;if(a){var s=r.getId(i),u=a.clientX,c=a.clientY;t({type:$[e],id:s,x:u,y:c})}}}}(e);s.push(Z(i,a,n))})),function(){s.forEach((function(e){return e()}))}}function Ee(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return Z("scroll",ee((function(e){var i=Ie(e);if(i&&!ie(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 Te(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Fe=new WeakMap;function Re(e){return function(e,t){if(we&&e.parentRule instanceof CSSGroupingRule||ke&&e.parentRule instanceof CSSMediaRule||Se&&e.parentRule instanceof CSSSupportsRule||Ce&&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 Pe(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=ee((function(e){var n=Date.now()-i;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],i=null}),s),l=ee((function(e){var t=Ie(e),n=ue(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?L.Drag:e instanceof MouseEvent?L.MouseMove:L.TouchMove)}),a,{trailing:!1}),d=[Z("mousemove",l,r),Z("touchmove",l,r),Z("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Oe(e),p=Ee(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return Z("resize",ee((function(){var e=re(),o=oe();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=Ie(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ie(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,Te({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,Te({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var o=Fe.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Fe.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 Z(e,f,i)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),_=[[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(_.map((function(e){return te(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 ee((function(o){var i=Ie(o);if(i&&!ie(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=[Z("play",i(0)),Z("pause",i(1)),Z("seeked",i(2)),Z("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={};we?c.CSSGroupingRule=a.CSSGroupingRule:(ke&&(c.CSSMediaRule=a.CSSMediaRule),Ce&&(c.CSSConditionRule=a.CSSConditionRule),Se&&(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(Re(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(Re(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}),_=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:Re(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:Re(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),m=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=ne(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(){be.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}(),Ne=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(ne(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),Ee(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(ne(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+/",Le="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$e=0;$e<De.length;$e++)Le[De.charCodeAt($e)]=$e;var je=new Map;var qe=function(e,t,n){if(e&&(We(e,t)||"object"===s(e))){var r=function(e,t){var n=je.get(e);return n||(n=new Map,je.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 Be(e,t,n){if(e instanceof Array)return e.map((function(e){return Be(e,t,n)}));if(null===e)return e;if(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)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,o=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}(e);return{rr_type:r,base64:o}}return e instanceof DataView?{rr_type:e.constructor.name,args:[Be(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:[Be(e.data,t,n),e.width,e.height]}:We(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:qe(e,t,n)}:e}var Ue=function(e,t,n){return o([],r(e),!1).map((function(e){return Be(e,t,n)}))},We=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 He(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=ne(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(qe(p,u,e),!ie(this.canvas,a)){s.getId(this.canvas);var f=Ue(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=te(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 ze,Ve,Ge=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=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return ie(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=ne(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ie(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:j["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=te(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:j["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(He(t.WebGLRenderingContext.prototype,j.WebGL,e,n,i,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,o([],r(He(t.WebGL2RenderingContext.prototype,j.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 Qe(e){return t(t({},e),{timestamp:Date.now()})}var Je={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 Xe(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,_=e.inlineStylesheet,m=void 0===_||_,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,x=e.sampling,O=void 0===x?{}:x,E=e.mousemoveWait,T=e.recordCanvas,M=void 0!==T&&T,F=e.userTriggeredOnInput,R=void 0!==F&&F,P=e.collectFonts,A=void 0!==P&&P,N=e.inlineImages,$=void 0!==N&&N,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===O.mousemove&&(O.mousemove=E);var U,W=!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},H=!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 z=0;ze=function(e,t){var r;if(!(null===(r=be[0])||void 0===r?void 0:r.isFrozen())||e.type===D.FullSnapshot||e.type===D.IncrementalSnapshot&&e.data.source===L.Mutation||be.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)U=e,z=0;else if(e.type===D.IncrementalSnapshot){if(e.data.source===L.Mutation&&e.data.isAttachIframe)return;z++;var s=a&&z>=a,u=i&&e.timestamp-U.timestamp>i;(s||u)&&Ve(!0)}};var V=function(e){ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.Mutation},e)}))},G=function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.Scroll},e)}))},Q=function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.CanvasMutation},e)}))},J=new Ae({mutationCb:V}),Y=new Ge({recordCanvas:M,mutationCb:Q,win:window,blockClass:u,mirror:Je}),K=new Ne({mutationCb:V,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskInputOptions:W,maskTextFn:S,maskInputFn:k,recordCanvas:M,inlineImages:$,sampling:O,slimDOMOptions:H,iframeManager:J,canvasManager:Y},mirror:Je});Ve=function(e){var t,n,o,i;void 0===e&&(e=!1),ze(Qe({type:D.Meta,data:{href:window.location.href,width:oe(),height:re()}}),e),be.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,_=n.maskAllInputs,m=void 0!==_&&_,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,x=n.onIframeLoad,O=n.iframeLoadTimeout,E=n.keepIframeSrcFn,T={};return[X(e,{doc:e,map:T,blockClass:o,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===m?{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===m?{password:!0}:m,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:x,iframeLoadTimeout:O,keepIframeSrcFn:void 0===E?function(){return!1}:E}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskAllInputs:W,maskTextFn:S,slimDOM:H,recordCanvas:M,inlineImages:$,onSerialize:function(e){ce(e)&&J.addIframe(e),le(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");Je.map=c,ze(Qe({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}}})),be.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(Z("DOMContentLoaded",(function(){ze(Qe({type:D.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Pe({mutationCb:V,mousemoveCb:function(e,t){return ze(Qe({type:D.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.ViewportResize},e)}))},inputCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.Input},e)}))},mediaInteractionCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return ze(Qe({type:D.IncrementalSnapshot,data:t({source:L.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:W,inlineStylesheet:m,sampling:O,recordCanvas:M,inlineImages:$,userTriggeredOnInput:R,collectFonts:A,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:H,mirror:Je,iframeManager:J,shadowDomManager:K,canvasManager:Y,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 ze(Qe({type:D.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Ve(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(Z("load",(function(){ze(Qe({type:D.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Xe.addCustomEvent=function(e,t){if(!ze)throw new Error("please add custom event after start recording");ze(Qe({type:D.Custom,data:{tag:e,payload:t}}))},Xe.freezePage=function(){be.forEach((function(e){return e.freeze()}))},Xe.takeFullSnapshot=function(e){if(!Ve)throw new Error("please take full snapshot after start recording");Ve(e)},Xe.mirror=Je,("undefined"!=typeof window?window:{}).rrweb={record:Xe};var Ze=String.fromCharCode,Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",et={};function tt(e,t){if(!et[e]){et[e]={};for(var n=0;n<e.length;n++)et[e][e.charAt(n)]=n}return et[e][t]}var nt={compressToBase64:function(e){if(null==e)return"";var t=nt._compress(e,6,(function(e){return Ye.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:nt._decompress(e.length,32,(function(t){return tt(Ye,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":nt._compress(e,15,(function(e){return Ze(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:nt._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=nt.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 nt.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(Ze(e))})),nt.decompress(o.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":nt._compress(e,6,(function(e){return Ke.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),nt._decompress(e.length,32,(function(t){return tt(Ke,e.charAt(t))})))},compress:function(e){return nt._compress(e,16,(function(e){return Ze(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:nt._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=Ze(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=Ze(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++]=Ze(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++]=Ze(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++)}}},rt={DEBUG:!1,LIB_VERSION:"1.45.0"},ot=Array.prototype,it=Object.prototype,at=it.toString,st=it.hasOwnProperty,ut="undefined"!=typeof window?window:{},ct=ut.navigator||{userAgent:""},lt=ut.document||{},dt=ct.userAgent,pt=ot.forEach,ft=ot.indexOf,ht=Array.isArray,vt={},gt=function(){if(rt.DEBUG&&!Ot(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){wt(n,(function(t){e(t)}))}}},_t=function(){if(rt.DEBUG&&!Ot(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){wt(r,(function(e){o(e)}))}}},mt=function(){if(!Ot(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){wt(r,(function(e){o(e)}))}}},yt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function bt(e,t,n){if(null!=e)if(pt&&Array.isArray(e)&&e.forEach===pt)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)===vt)return}else for(var i in e)if(st.call(e,i)&&t.call(n,e[i],i)===vt)return}function wt(e,t,n){if(Array.isArray(e))if(pt&&e.forEach===pt)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)===vt)return}var kt=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 wt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},St=ht||function(e){return"[object Array]"===at.call(e)},Ct=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function It(e,t){return-1!==e.indexOf(t)}var xt=function(e){return e===Object(e)&&!St(e)},Ot=function(e){return void 0===e},Et=function(e){return"[object String]"==at.call(e)},Tt=function e(t){return bt(t,(function(n,r){!function(e){return"[object Date]"==at.call(e)}(n)?xt(n)&&(t[r]=e(n)):t[r]=Mt(n)})),t},Mt=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())},Ft=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){mt("Implementation error. Please turn on debug and contact support@posthog.com."),rt.DEBUG&&mt(e)}}},Rt=function(e){var t={};return bt(e,(function(e,n){Et(e)&&e.length>0&&(t[n]=e)})),t};var Pt=["$performance_raw"];function At(e,t){return n=e,r=function(e,n){return n&&Pt.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),St(t)?(i=[],wt(t,(function(t){i.push(e(t))}))):(i={},bt(t,(function(t,n){o.has(t)||(i[n]=e(t,n))}))),i);var i}(n);var n,r,o}function Nt(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Lt(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 Dt,Lt=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},$t=(Dt=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e=(window.screen.height*window.screen.width).toString(16);return Dt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=dt,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+"-"+Dt()}),jt=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)/i.test(e)},qt=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){_t("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Bt=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Ut=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;Ct(r)&&(i=r(o));var s=n.call(t,o);return!1!==i&&!1!==s||(a=!1),a}}}(t,r,s)}else _t("No valid element provided to register_event")}}(),Wt={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return bt(e,(function(e){var n=qt(lt.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=Wt.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var o=qt(e,n);o.length&&(r.ph_keyword=o)}return r},browser:function(e,t,n){return t=t||"",n||It(e," OPR/")?It(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":It(e,"IEMobile")||It(e,"WPDesktop")?"Internet Explorer Mobile":It(e,"SamsungBrowser/")?"Samsung Internet":It(e,"Edge")||It(e,"Edg/")?"Microsoft Edge":It(e,"FBIOS")?"Facebook Mobile":It(e,"Chrome")?"Chrome":It(e,"CriOS")?"Chrome iOS":It(e,"UCWEB")||It(e,"UCBrowser")?"UC Browser":It(e,"FxiOS")?"Firefox iOS":It(t,"Apple")?It(e,"Mobile")?"Mobile Safari":"Safari":It(e,"Android")?"Android Mobile":It(e,"Konqueror")?"Konqueror":It(e,"Firefox")?"Firefox":It(e,"MSIE")||It(e,"Trident/")?"Internet Explorer":It(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+)?)/}[Wt.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 ct.language||ct.userLanguage},os:function(){var e=dt;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return kt(Rt({$os:Wt.os(),$browser:Wt.browser(dt,ct.vendor,window.opera),$device:Wt.device(dt),$device_type:Wt.deviceType(dt)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:Wt.browserVersion(dt,ct.vendor,window.opera),$browser_language:Wt.browserLanguage(),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:rt.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 kt(Rt({$os:Wt.os(),$browser:Wt.browser(dt,ct.vendor,window.opera)}),{$browser_version:Wt.browserVersion(dt,ct.vendor,window.opera)})}};function Ht(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 zt(e){var t="";return Yt(e)&&!Kt(e)&&e.childNodes&&e.childNodes.length&&bt(e.childNodes,(function(e){Qt(e)&&e.textContent&&(t+=yt(e.textContent).split(/(\s+)/).filter(en).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),yt(t)}function Vt(e){return!!e&&1===e.nodeType}function Gt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Qt(e){return!!e&&3===e.nodeType}function Jt(e){return!!e&&11===e.nodeType}var Xt=["a","button","form","input","select","textarea","label"];function Zt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||Gt(e,"html")||!Vt(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&&!Gt(d,"body");)if(Jt(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(Xt.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&&(Xt.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Yt(e){for(var t=e;t.parentNode&&!Gt(t,"body");t=t.parentNode){var n=Ht(t).split(" ");if(It(n,"ph-sensitive")||It(n,"ph-no-capture"))return!1}if(It(Ht(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 Kt(e){return!!(Gt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Gt(e,"select")||Gt(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function en(e){if(null===e||Ot(e))return!1;if("string"==typeof e){e=yt(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 tn(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)}var nn=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}(),rn={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Vt(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};Xt.indexOf(r)>-1&&!n&&(o.$el_text=zt(e));var i=Ht(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),bt(e.attributes,(function(n){var r;Kt(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&en(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 bt(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),en(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return bt(this._customProperties,(function(r){bt(r.event_selectors,(function(o){bt(document.querySelectorAll(o),(function(o){It(e,o)&&Yt(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);(Qt(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&&Zt(i,e,this.config)){for(var a=[i],s=i;s.parentNode&&!Gt(s,"body");)Jt(s.parentNode)?(a.push(s.parentNode.host),s=s.parentNode.host):(a.push(s.parentNode),s=s.parentNode);var u,c=[],l=!1;if(bt(a,(function(e){var n=Yt(e);"a"===e.tagName.toLowerCase()&&(u=e.getAttribute("href"),u=n&&en(u)&&u),It(Ht(e).split(" "),"ph-no-capture")&&(l=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")))})),t.get_config("mask_all_text")||(c[0].$el_text=zt(i)),u&&(c[0].attr__href=u),l)return!1;var d=kt(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(a));return t.capture(o,d),!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)};Ut(document,"submit",n,!1,!0),Ut(document,"change",n,!1,!0),Ut(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 nn(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?gt('autocapture already initialized for token "'+n+'"'):(this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&t.get_config("autocapture")?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Ot(t)?10:t,n=Ot(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return Ct(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(rn),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Ft(e[t]))}(rn);var on=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,an={is_supported:function(){return!0},error:function(e){_t("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(an.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(on),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+"; path=/"+i+s;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{an.set(e,"",-1,t)}catch(e){return}}},sn=null,un={is_supported:function(){if(null!==sn)return sn;var e=!0;if(window)try{var t="__mplssupport__";un.set(t,"xyz"),'"xyz"'!==un.get(t)&&(e=!1),un.remove(t)}catch(t){e=!1}else e=!1;return e||_t("localStorage unsupported; falling back to cookie store"),sn=e,e},error:function(e){_t("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){un.error(e)}return null},parse:function(e){try{return JSON.parse(un.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){un.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){un.error(e)}}},cn=a(a({},un),{},{parse:function(e){try{var t={};try{(t=an.parse(e)||{}).distinct_id&&an.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=kt(t,JSON.parse(un.get(e)||"{}"));return un.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{un.set(e,t),t.distinct_id&&an.set(e,{distinct_id:t.distinct_id},n,r,o)}catch(e){un.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),an.remove(e,t)}catch(e){un.error(e)}}}),ln={},dn={is_supported:function(){return!0},error:function(e){_t("memoryStorage error: "+e)},get:function(e){return ln[e]||null},parse:function(e){return ln[e]||null},set:function(e,t){ln[e]=t},remove:function(e){delete ln[e]}},pn=null,fn={is_supported:function(){if(null!==pn)return pn;if(pn=!0,window)try{var e="__support__";fn.set(e,"xyz"),'"xyz"'!==fn.get(e)&&(pn=!1),fn.remove(e)}catch(e){pn=!1}else pn=!1;return pn},error:function(e){rt.DEBUG&&_t("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){fn.error(e)}return null},parse:function(e){try{return JSON.parse(fn.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){fn.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){fn.error(e)}}};function hn(e,t){kn(!0,e,t)}function vn(e,t){kn(!1,e,t)}function gn(e,t){return"1"===wn(e,t)}function _n(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||ut,n=t.navigator||{},r=!1;return bt([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){It([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===wn(e,t)}function mn(e,t){yn(t=t||{}).remove(bn(e,t),!!t.crossSubdomainCookie)}function yn(e){return"localStorage"===(e=e||{}).persistenceType?un:"localStorage+cookie"===e.persistenceType?cn:an}function bn(e,t){return((t=t||{}).persistencePrefix||"__ph_opt_in_out_")+e}function wn(e,t){return yn(t).get(bn(e,t))}function kn(e,t,n){var r;Et(t)&&t.length?(yn(n=n||{}).set(bn(t,n),e?1:0,(r=n.cookieExpiration,"[object Number]"==at.call(r)?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 Sn(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=_n(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 Cn(e,t,n){return function(){for(var r=Sn(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 In="$set",xn=function(){function e(t){var n=this;u(this,e),this._posthog=t,this.set=Cn(t,(function(e,t,r){var o=n.set_action(e,t);return xt(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),o.$set=kt({},Wt.people_properties(),n._posthog.persistence.get_referrer_info(),o.$set),n._send_request(o,r)})),this.set_once=Cn(t,(function(e,t,r){var o=n.set_once_action(e,t);return xt(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=Tt(e),a=At(i,this._get_config("properties_string_max_length")),s=Nt(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(In,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 xt(t)?bt(t,(function(e,t){r._is_reserved_property(t)||(i[t]=e)})):i[t]=n,o[e]=i,o}}]),e}(),On="$active_feature_flags",En="$enabled_feature_flags",Tn="$override_feature_flags",Mn="$feature_flag_payloads",Fn=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(En),t=this.instance.get_property(Tn);if(!t)return e||{};for(var n=kt({},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(Mn)||{}}},{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=Nt(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:"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={},On,o),d(s,En,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={},On,Object.keys(p||{})),d(l,En,p||{}),d(l,Mn,f||{}),l))}else t&&(t.unregister(On),t.unregister(En),t.unregister(Mn))}(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(Tn);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},Tn,t))}else this.instance.persistence.register(d({},Tn,e))}},{key:"onFeatureFlags",value:function(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var t=this._prepareFeatureFlagsForCallbacks();e(t.flags,t.flagVariants)}}},{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}(),Rn="$people_distinct_id",Pn="__alias",An="__timers",Nn="$session_recording_enabled_server_side",Dn="$console_log_recording_enabled_server_side",Ln="$sesid",$n="$enabled_feature_flags",jn="$user_state",qn=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Rn,Pn,"__cmpns",An,Nn,Ln,$n,jn],Bn=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,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(mt("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&un.is_supported()?this.storage=un:"localstorage+cookie"===r&&cn.is_supported()?this.storage=cn:this.storage="memory"===r?dn:an,this.user_state=void 0,this.load(),this.update_config(t),this.save()}return l(e,[{key:"properties",value:function(){var e={};return bt(this.props,(function(t,n){if(n===$n&&"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=qn)?u:ft&&i.indexOf===ft?-1!=i.indexOf(a):(bt(i,(function(e){if(u||(u=e===a))return vt})),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=kt({},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(xt(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var o=!1;if(bt(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(xt(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(bt(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(Wt.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(Wt.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:Wt.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return Rt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return bt(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.__timers||{};n[e]=t,this.props.__timers=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props.__timers||{})[e];return Ot(t)||(delete this.props.__timers[e],this.save()),t}},{key:"get_user_state",value:function(){return this.props.$user_state}},{key:"set_user_state",value:function(e){this.props.$user_state=e,this.save()}}]),e}(),Un=2,Wn=4;var Hn=function(){function e(t){u(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",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(Nn),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Dn),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"afterDecideResponse",value:function(e){var t,n,r,o;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((d(r={},Nn,!!e.sessionRecording),d(r,Dn,null===(n=e.sessionRecording)||void 0===n?void 0:n.consoleLogRecordingEnabled),r));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(o=e.sessionRecording)||void 0===o?void 0:o.endpoint);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(){void 0!==Object.assign&&(this.captureStarted||this.instance.get_config("disable_session_recording")||(this.captureStarted=!0,this.instance.__loaded_recorder||tn(this.instance.get_config("api_host")+"/static/recorder.js?v="+rt.LIB_VERSION,this._onScriptLoaded.bind(this)),this._onScriptLoaded()))}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n,r=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),o=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,e.timestamp),i=o.windowId,a=o.sessionId;this.windowId===i&&this.sessionId===a||-1!==[Un,Wn].indexOf(e.type)||(null===(n=this.rrwebRecord)||void 0===n||n.takeFullSnapshot());this.windowId=i,this.sessionId=a}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={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 r=this.instance.get_config("session_recording"),o=0,i=Object.entries(r||{});o<i.length;o++){var u=m(i[o],2),c=u[0],l=u[1];c in n&&(n[c]=l)}this.stopRrweb=null===(e=this.rrwebRecord)||void 0===e?void 0:e.call(this,a({emit:function(e){e=function(e){if(e&&"object"===s(e)&&6===e.type&&"object"===s(e.data)&&"rrweb/console@1"===e.data.plugin){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],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),t._updateWindowAndSessionIds(e);var n={$snapshot_data:e,$session_id:t.sessionId,$window_id:t.windowId};t.instance._captureMetrics.incr("rrweb-record"),t.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),t.emit?t._captureSnapshot(n):t.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook((function(e){var n;"$pageview"===e&&(null===(n=t.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===Un}})}}]),e}(),zn={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},Vn=["first-input","navigation","paint","resource"],Gn=["/s/","/e/"],Qn=function(){function e(t){u(this,e),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)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))}));var t=PerformanceObserver.supportedEntryTypes.filter((function(e){return Vn.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()}}},{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(Gn.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[zn.timeOrigin]=o,r[zn.timestamp]=Math.floor(o+e.startTime),zn)void 0!==n[i]&&(r[zn[i]]=n[i]);if(this.capturePerformanceEvent(r),Jn(e)){var a,s=k(e.serverTiming);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;this.capturePerformanceEvent((d(u={},zn.timeOrigin,o),d(u,zn.timestamp,Math.floor(o+e.startTime)),d(u,zn.name,c.name),d(u,zn.duration,c.duration),d(u,zn.entryType,"serverTiming"),u))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),Jn=function(e){return"navigation"===e.entryType||"resource"===e.entryType},Xn=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=Nt(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),rn.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}(),Zn=["https://app.posthog.com","https://eu.posthog.com"],Yn=["source"],Kn=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=Bt(e.hash,"__posthog")||Bt(e.hash,"state"),i=o?JSON.parse(decodeURIComponent(o)):null,a=i&&"ph_authorize"===i.action;return a?((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=!Zn.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,Yn);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),tn(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(s,t.instance)})),Ut(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}(),er=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}(),tr=function(e){p(n,e);var t=_(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;bt(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 bt(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}(er),nr=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}(),rr=Uint8Array,or=Uint16Array,ir=Uint32Array,ar=new rr([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]),sr=new rr([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]),ur=new rr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cr=function(e,t){for(var n=new or(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new ir(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]},lr=cr(ar,2),dr=lr[0],pr=lr[1];dr[28]=258,pr[258]=28;for(var fr=cr(sr,0)[1],hr=new or(32768),vr=0;vr<32768;++vr){var gr=(43690&vr)>>>1|(21845&vr)<<1;gr=(61680&(gr=(52428&gr)>>>2|(13107&gr)<<2))>>>4|(3855&gr)<<4,hr[vr]=((65280&gr)>>>8|(255&gr)<<8)>>>1}var _r=function(e,t,n){for(var r=e.length,o=0,i=new or(t);o<r;++o)++i[e[o]-1];var a,s=new or(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new or(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[hr[d]>>>u]=c}else for(a=new or(r),o=0;o<r;++o)a[o]=hr[s[e[o]-1]++]>>>15-e[o];return a},mr=new rr(288);for(vr=0;vr<144;++vr)mr[vr]=8;for(vr=144;vr<256;++vr)mr[vr]=9;for(vr=256;vr<280;++vr)mr[vr]=7;for(vr=280;vr<288;++vr)mr[vr]=8;var yr=new rr(32);for(vr=0;vr<32;++vr)yr[vr]=5;var br,wr=_r(mr,9,0),kr=_r(yr,5,0),Sr=function(e){return(e/8>>0)+(7&e&&1)},Cr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof or?or:e instanceof ir?ir:rr)(n-t);return r.set(e.subarray(t,n)),r},Ir=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},xr=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},Or=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 rr(0),0];if(1==o){var a=new rr(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 or(p+1),h=Er(n[l-1],f,0);if(h>t){r=0;var v=0,g=h-t,_=1<<g;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var m=i[r].s;if(!(f[m]>t))break;v+=_-(1<<h-f[m]),f[m]=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 rr(f),h]},Er=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},Tr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new or(++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]},Mr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Fr=function(e,t,n){var r=n.length,o=Sr(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)},Rr=function(e,t,n,r,o,i,a,s,u,c,l){Ir(t,l++,n),++o[256];for(var d=Or(o,15),p=d[0],f=d[1],h=Or(i,15),v=h[0],g=h[1],_=Tr(p),m=_[0],y=_[1],b=Tr(v),w=b[0],k=b[1],S=new or(19),C=0;C<m.length;++C)S[31&m[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var I=Or(S,7),x=I[0],O=I[1],E=19;E>4&&!x[ur[E-1]];--E);var T,M,F,R,P=c+5<<3,A=Mr(o,mr)+Mr(i,yr)+a,N=Mr(o,p)+Mr(i,v)+a+14+3*E+Mr(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(P<=A&&P<=N)return Fr(t,l,e.subarray(u,u+c));if(Ir(t,l,1+(N<A)),l+=2,N<A){T=_r(p,f,0),M=p,F=_r(v,g,0),R=v;var D=_r(x,O,0);Ir(t,l,y-257),Ir(t,l+5,k-1),Ir(t,l+10,E-4),l+=14;for(C=0;C<E;++C)Ir(t,l+3*C,x[ur[C]]);l+=3*E;for(var L=[m,w],$=0;$<2;++$){var j=L[$];for(C=0;C<j.length;++C){var q=31&j[C];Ir(t,l,D[q]),l+=x[q],q>15&&(Ir(t,l,j[C]>>>5&127),l+=j[C]>>>12)}}}else T=wr,M=mr,F=kr,R=yr;for(C=0;C<s;++C)if(r[C]>255){q=r[C]>>>18&31;xr(t,l,T[q+257]),l+=M[q+257],q>7&&(Ir(t,l,r[C]>>>23&31),l+=ar[q]);var B=31&r[C];xr(t,l,F[B]),l+=R[B],B>3&&(xr(t,l,r[C]>>>5&8191),l+=sr[B])}else xr(t,l,T[r[C]]),l+=M[r[C]];return xr(t,l,T[256]),l+M[256]},Pr=new ir([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ar=new rr(0),Nr=function(){for(var e=new ir(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Dr=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new rr(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=Fr(u,c,e.subarray(l,d)):(u[l]=i,c=Fr(u,c,e.subarray(l,a)))}else{for(var p=Pr[t-1],f=p>>>13,h=8191&p,v=(1<<n)-1,g=new or(32768),_=new or(v+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&v},w=new ir(25e3),k=new or(288),S=new or(32),C=0,I=0,x=(l=0,0),O=0,E=0;l<a;++l){var T=b(l),M=32767&l,F=_[T];if(g[M]=F,_[T]=M,O<=l){var R=a-l;if((C>7e3||x>24576)&&R>423){c=Rr(e,u,0,w,k,S,I,x,E,l-E,c),x=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 A=2,N=0,D=h,L=M-F&32767;if(R>2&&T==b(l-L))for(var $=Math.min(f,R)-1,j=Math.min(32767,l),q=Math.min(258,R);L<=j&&--D&&M!=F;){if(e[l+A]==e[l+A-L]){for(var B=0;B<q&&e[l+B]==e[l+B-L];++B);if(B>A){if(A=B,N=L,B>$)break;var U=Math.min(L,B-2),W=0;for(P=0;P<U;++P){var H=l-L+P+32768&32767,z=H-g[H]+32768&32767;z>W&&(W=z,F=H)}}}L+=(M=F)-(F=g[M])+32768&32767}if(N){w[x++]=268435456|pr[A]<<18|fr[N];var V=31&pr[A],G=31&fr[N];I+=ar[V]+sr[G],++k[257+V],++S[G],O=l+A,++C}else w[x++]=e[l],++k[e[l]]}}c=Rr(e,u,i,w,k,S,I,x,E,l-E,c),i||(c=Fr(u,c,Ar))}return Cr(s,0,r+Sr(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)},Lr=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function $r(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Nr[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var o,i=Dr(e,t,10+((o=t).filename&&o.filename.length+1||0),8),a=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Lr(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)}}(i,t),Lr(i,a-8,n.d()),Lr(i,a-4,r),i}function jr(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new rr(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 rr(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 Cr(r,0,o)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(br||(br={}));var qr,Br,Ur,Wr=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=rt.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 bt(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t})),o.join(r)}(r)},Hr=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},zr=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=Hr(n,o);i.incr("_send_request"),i.incr("_send_request_inflight"),bt(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 _t(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)},Vr=function(e){p(n,e);var t=_(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,"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,Hr(o,a(a({},i),{},{sendBeacon:!0})))}catch(e){rt.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;zr({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}(er),Gr=18e5,Qr=864e5,Jr=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&&fn.is_supported()){var o=fn.parse(this.window_id_storage_key),i=fn.parse(this.primary_window_exists_storage_key);o&&!i?this._windowId=o:fn.remove(this.window_id_storage_key),fn.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&&fn.is_supported()&&fn.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&fn.is_supported()?fn.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({},Ln,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props.$sesid;return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&fn.is_supported()&&fn.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,n=t||(new Date).getTime(),r=this._getSessionId(),o=m(r,3),i=o[0],a=o[1],s=o[2],u=this._getWindowId(),c=s&&s>0&&Math.abs(n-s)>Qr;!a||!e&&Math.abs(n-i)>Gr||c?(a=$t(),u=$t(),s=n):u||(u=$t());var l=0===i||!e||c?n:i,d=0===s?(new Date).getTime():s;return this._setWindowId(u),this._setSessionId(a,l,d),{sessionId:a,windowId:u}}}]),e}(),Xr=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}))}})),Zr=function(){function e(){u(this,e),d(this,"_seenFirstPageView",!1)}return l(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=$t()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=$t()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(qr||(qr={}));var Yr=function(){},Kr={},eo="posthog",to=ut.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,no=!to&&-1===dt.indexOf("MSIE")&&-1===dt.indexOf("Mozilla"),ro=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==lt||null===(e=lt.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:Yr,store_google:!0,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==ut||null===(n=ut.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:Yr,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},oo=function(e,t,n){var r,o=n!==eo&&Ur?n?Ur[n]:void 0:Ur;if(o&&Br===qr.INIT_MODULE)r=o;else{if(o&&!St(o))return void console.error("You have already initialized "+n);r=new io}if(r._init(e,t,n),r.toolbar.maybeLoadToolbar(),r.sessionRecording=new Hn(r),r.sessionRecording.startRecordingIfEnabled(),r.webPerformance=new Qn(r),r.webPerformance.startObservingIfEnabled(),r.__autocapture=r.get_config("autocapture"),r.get_config("autocapture")){r.__autocapture=r.get_config("autocapture");rn.enabledForProject(r.get_config("token"),100,100)?rn.isBrowserSupported()?rn.init(r):(r.__autocapture=!1,gt("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture=!1,gt("Not in active bucket: disabling Automatic Event Collection."))}return rt.DEBUG=rt.DEBUG||r.get_config("debug"),void 0!==o&&St(o)&&(r._execute_array.call(r.people,o.people),r._execute_array(o)),r},io=function(){function e(){var t=this;u(this,e),this.config=ro(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Xr,this.segmentIntegration=function(){return e=t,n=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},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return n(e,e.event.event)},page:function(e){return n(e,"$pageview")},identify:function(e){return n(e,"$identify")},screen:function(e){return n(e,"$screen")}};var e,n},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder=!1,this.__autocapture=void 0,this._jsc=function(){},this.people=new xn(this),this.featureFlags=new Fn(this),this.feature_flags=this.featureFlags,this.toolbar=new Kn(this),this.pageViewIdManager=new Zr,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return l(e,[{key:"init",value:function(e,t,n){if(Ot(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==eo){var r=oo(e,t,n);return Ur[n]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(kt({},ro(),r,{name:o,token:e,callback_fn:(o===eo?o:"posthog."+o)+"._jsc"})),this._jsc=function(){},(null!=ut&&null!==(t=ut.rrweb)&&void 0!==t&&t.record||null!=ut&&ut.rrwebRecord)&&(this.__loaded_recorder=!0),this._captureMetrics=new nr(this.get_config("_capture_metrics")),this._requestQueue=new tr(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new Vr(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new Bn(this.config),this.sessionManager=new Jr(this.config,this.persistence),this._gdpr_init(),r.segment&&(this.config.get_device_id=function(){return r.segment.user().anonymousId()},r.segment.user().id()&&(this.register({distinct_id:r.segment.user().id()}),this.persistence.set_user_state("identified")),r.segment.register(this.segmentIntegration())),void 0!==(null===(n=r.bootstrap)||void 0===n?void 0:n.distinctID)){var i,a,s=this.get_config("get_device_id")($t()),u=null!==(i=r.bootstrap)&&void 0!==i&&i.isIdentifiedID?s:r.bootstrap.distinctID;this.persistence.set_user_state(null!==(a=r.bootstrap)&&void 0!==a&&a.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var c,l,d=Object.keys((null===(c=r.bootstrap)||void 0===c?void 0:c.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=r.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,o;return e[t]=(null===(n=r.bootstrap)||void 0===n||null===(o=n.featureFlags)||void 0===o?void 0:o[t])||!1,e}),{}),p=Object.keys((null===(l=r.bootstrap)||void 0===l?void 0:l.featureFlagPayloads)||{}).filter((function(e){return d[e]})).reduce((function(e,t){var n,o,i,a;null!==(n=r.bootstrap)&&void 0!==n&&null!==(o=n.featureFlagPayloads)&&void 0!==o&&o[t]&&(e[t]=null===(i=r.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:d,featureFlagPayloads:p})}if(!this.get_distinct_id()){var f=this.get_config("get_device_id")($t());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_user_state("anonymous")}ut.addEventListener&&ut.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this))}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new Xn(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()||wt(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(Ot(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||Kr,Yr)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,i=function(e,t,n){return e===br.LZ64?[{data:nt.compressToBase64(t),compression:br.LZ64},n]:e===br.GZipJS?[$r(jr(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:br.GZipJS}})]:[{data:Nt(t)},n]}((o=this.compression)[br.GZipJS]?br.GZipJS:o[br.LZ64]?br.LZ64:br.Base64,t,n),s=m(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(no)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=kt(o,n||{}),to||(n.method="GET");var i="sendBeacon"in ut.navigator&&"sendBeacon"===n.transport;if(e=Wr(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),xt(t)&&this.get_config("img")){var s=lt.createElement("img");s.src=e,lt.body.appendChild(s)}else if(i)try{ut.navigator.sendBeacon(e,Hr(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(to)try{zr({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=lt.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=lt.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=[];wt(e,(function(e){e&&(t=e[0],St(t)?i.push(e):"function"==typeof e?e.call(n):St(e)&&"alias"===t?r.push(e):St(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?i.push(e):o.push(e))}));var a=function(e,t){wt(e,(function(e){if(St(e[0])){var n=t;bt(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]:Kr;if(this.__loaded&&!Sn(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||Kr).transport;if(r&&(n.transport=r),Ot(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!jt(dt)){this.persistence.update_search_keyword(lt.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(lt.referrer);var o={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=At(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&>("PostHog.js send",o);var i=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),s=n!==Kr;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),bt(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=this.persistence.properties();return o.distinct_id=i.distinct_id,o}var s=Wt.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=kt(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=kt({},s,this.persistence.properties(),o);var f=this.get_config("property_blacklist");St(f)?bt(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:"unregister",value:function(e){this.persistence.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(Pn)&&(this.unregister(Pn),this.register({distinct_id:e}));var i=!this.get_property("$device_id"),a="anonymous"===this.persistence.get_user_state();e!==r&&(a||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.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")($t());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(Rn)?(mt("Attempting to create alias for existing People user - aborting."),-2):(Ot(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Pn,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);xt(e)&&(kt(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),un.is_supported()&&"true"===un.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(rt.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:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:eo;return t!==eo&&(t="posthog."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&un.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")&&!an.get("ph_optout")||(an.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=kt({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||{}),un.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=kt({enable_persistence:!0},e||{}),this._gdpr_call_func(hn,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=kt({clear_persistence:!0},e||{});this._gdpr_call_func(vn,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(gn,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(_n,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=kt({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(mn,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(ut.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(ut.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 nt.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Ft(e.prototype[t[n]])}(io,["identify"]);var ao={},so=function(){Ur.init=function(e,t,n){if(n)return Ur[n]||(Ur[n]=ao[n]=oo(e||"",t||{},n),Ur[n]._loaded()),Ur[n];var r=Ur;return ao.posthog?r=ao.posthog:e&&((r=oo(e,t||{},eo))._loaded(),ao.posthog=r),Ur=r,Br===qr.INIT_SNIPPET&&(ut.posthog=Ur),bt(ao,(function(e,t){t!==eo&&(Ur[t]=e)})),r}};Br=qr.INIT_SNIPPET,Ot(ut.posthog)&&(ut.posthog=[]),(Ur=ut.posthog).__loaded||Ur.config&&Ur.persistence?console.error("PostHog library has already been downloaded at least once."):(bt(Ur._i,(function(e){e&&St(e)&&(ao[e[2]]=oo.apply(void 0,y(e)))})),so(),Ur.init(),bt(ao,(function(e){e._loaded()})),function(){function e(){e.done||(e.done=!0,no=!1,bt(ao,(function(e){e._dom_loaded()})))}lt.addEventListener&&("complete"===lt.readyState?e():lt.addEventListener("DOMContentLoaded",e,!1)),Ut(ut,"load",e,!0)}())}();
|
|
16
|
+
//# sourceMappingURL=array.full.js.map
|