posthog-js 1.136.1 → 1.136.2

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.
@@ -1,4 +1,4 @@
1
- !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function f(){}function h(){}function p(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==t&&r.call(m,o)&&(g=m);var y=p.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function I(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=p,u(y,"constructor",p),u(p,"constructor",h),h.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},_(b.prototype),u(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(y),u(y,s,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e){return r="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},r(e)}function i(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(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,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||h(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 f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(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 h(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function p(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 g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,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,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var v;function m(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t,b).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function b(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=_(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!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"}(v||(v={}));var I=function(){function e(){a(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return u(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function k(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,s=o||"",u=i&&w(i);return(n[r.toLowerCase()]||u&&n[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function w(e){return e.toLowerCase()}var C="__rrweb_original__";function S(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?w(t):null}function A(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==i?void 0:i[1])&&void 0!==n?n:null}var E,R,M=1,T=new RegExp("[^a-z0-9-_:]"),F=-2;function x(){return M++}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function P(e,t){return(e||"").replace(O,(function(e,n,r,i,o,a){var s,u=r||o||a,l=n||i||"";if(!u)return e;if(N.test(u)||L.test(u))return"url(".concat(l).concat(u).concat(l,")");if(D.test(u))return"url(".concat(l).concat(u).concat(l,")");if("/"===u[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(l,")");var c=t.split("/"),d=u.split("/");c.pop();var f,h=g(d);try{for(h.s();!(f=h.n()).done;){var p=f.value;"."!==p&&(".."===p?c.pop():c.push(p))}}catch(e){h.e(e)}finally{h.f()}return"url(".concat(l).concat(c.join("/")).concat(l,")")}))}var B=/^[^ \t\n\r\u000c]+/,q=/^[, \t\n\r\u000c]+/;function W(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(){var e=document.createElement("a");return e.href="",e.href}function H(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?W(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(q),!(n>=t.length);){var o=r(B);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=W(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n?P(r,U()):"object"===t&&"data"===n?W(e,r):r:W(e,r):r}function V(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function $(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&$(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&$(e.parentNode,t,n)}function j(e,t,n,r){try{var i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===i)return!1;if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if($(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function Z(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.needsMask,s=t.inlineStylesheet,u=t.maskInputOptions,l=void 0===u?{}:u,c=t.maskTextFn,d=t.maskInputFn,f=t.dataURLOptions,h=void 0===f?{}:f,p=t.inlineImages,g=t.recordCanvas,m=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:v.Document,childNodes:[],compatMode:e.compatMode}:{type:v.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,i=t.blockClass,o=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,c=t.dataURLOptions,d=void 0===c?{}:c,f=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,g=t.newlyAddedElement,m=void 0!==g&&g,y=t.rootId,b=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=w(e.tagName);return T.test(t)?"div":t}(e),A={},M=e.attributes.length,F=0;F<M;F++){var x=e.attributes[F];V(I,x.name,x.value)||(A[x.name]=H(r,I,w(x.name),x.value))}if("link"===I&&a){var O=Array.from(r.styleSheets).find((function(t){return t.href===e.href})),N=null;O&&(N=_(O)),N&&(delete A.rel,delete A.href,A._cssText=P(N,O.href))}if("style"===I&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=_(e.sheet);L&&(A._cssText=P(L,U()))}if("input"===I||"textarea"===I||"select"===I){var D=e.value,B=e.checked;"radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&D?A.value=k({element:e,type:S(e),tagName:I,value:D,maskInputOptions:u,maskInputFn:l}):B&&(A.checked=B)}"option"===I&&(e.selected&&!u.select?A.selected=!0:delete A.selected);if("canvas"===I&&h)if("2d"===e.__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 i=t.getImageData,o=C in i?i[C]:i;if(new Uint32Array(o.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})(e)||(A.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var q=e.toDataURL(d.type,d.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height,q!==W.toDataURL(d.type,d.quality)&&(A.rr_dataURL=q)}if("img"===I&&f){E||(E=r.createElement("canvas"),R=E.getContext("2d"));var $=e,j=$.crossOrigin;$.crossOrigin="anonymous";var Z=function e(){$.removeEventListener("load",e);try{E.width=$.naturalWidth,E.height=$.naturalHeight,R.drawImage($,0,0),A.rr_dataURL=E.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat($.currentSrc,"! Error: ").concat(e))}j?A.crossOrigin=j:$.removeAttribute("crossorigin")};$.complete&&0!==$.naturalWidth?Z():$.addEventListener("load",Z)}if("audio"===I||"video"===I){var K=A;K.rr_mediaState=e.paused?"paused":"played",K.rr_mediaCurrentTime=e.currentTime,K.rr_mediaPlaybackRate=e.playbackRate,K.rr_mediaMuted=e.muted,K.rr_mediaLoop=e.loop,K.rr_mediaVolume=e.volume}m||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop));if(b){var z=e.getBoundingClientRect(),Y=z.width,J=z.height;A={class:A.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==I||p(A.src)||(e.contentDocument||(A.rr_src=A.src),delete A.src);try{customElements.get(I)&&(n=!0)}catch(e){}return{type:v.Element,tagName:I,attributes:A,childNodes:[],isSVG:G(e)||void 0,needBlock:b,rootId:y,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:I});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,i=t.maskTextFn,o=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=_(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=P(s,U())}l&&(s="SCRIPT_PLACEHOLDER");!u&&!l&&s&&r&&(s=i?i(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:v.Text,textContent:s||"",isStyle:u,rootId:o}}(e,{needsMask:a,maskTextFn:c,rootId:I});case e.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:v.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function K(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,c=t.inlineStylesheet,d=void 0===c||c,f=t.maskInputOptions,h=void 0===f?{}:f,p=t.maskTextFn,g=t.maskInputFn,_=t.slimDOMOptions,b=t.dataURLOptions,I=void 0===b?{}:b,k=t.inlineImages,w=void 0!==k&&k,C=t.recordCanvas,S=void 0!==C&&C,E=t.onSerialize,R=t.onIframeLoad,M=t.iframeLoadTimeout,T=void 0===M?5e3:M,O=t.onStylesheetLoad,N=t.stylesheetLoadTimeout,L=void 0===N?5e3:N,D=t.keepIframeSrcFn,P=void 0===D?function(){return!1}:D,B=t.newlyAddedElement,q=void 0!==B&&B,W=t.needsMask,G=t.preserveWhiteSpace,U=void 0===G||G;!W&&e.childNodes&&(W=j(e,a,s,void 0===W));var H,V=Z(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,dataURLOptions:I,inlineImages:w,recordCanvas:S,keepIframeSrcFn:P,newlyAddedElement:q});if(!V)return console.warn(e,"not serialized"),null;H=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===v.Comment)return!0;if(e.type===v.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===A(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(K(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===K(e.attributes.name)||"icon"===K(e.attributes.rel)||"apple-touch-icon"===K(e.attributes.rel)||"shortcut icon"===K(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&K(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(K(e.attributes.property).match(/^(og|twitter|fb):/)||K(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===K(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===K(e.attributes.name)||"googlebot"===K(e.attributes.name)||"bingbot"===K(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===K(e.attributes.name)||"generator"===K(e.attributes.name)||"framework"===K(e.attributes.name)||"publisher"===K(e.attributes.name)||"progid"===K(e.attributes.name)||K(e.attributes.property).match(/^article:/)||K(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===K(e.attributes.name)||"yandex-verification"===K(e.attributes.name)||"csrf-token"===K(e.attributes.name)||"p:domain_verify"===K(e.attributes.name)||"verify-v1"===K(e.attributes.name)||"verification"===K(e.attributes.name)||"shopify-checkout-api-token"===K(e.attributes.name)))return!0}}return!1}(V,_)&&(U||V.type!==v.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?x():F;var $=Object.assign(V,{id:H});if(r.add(e,$),H===F)return null;E&&E(e);var Y=!l;if($.type===v.Element){Y=Y&&!$.needBlock,delete $.needBlock;var J=e.shadowRoot;J&&y(J)&&($.isShadowHost=!0)}if(($.type===v.Document||$.type===v.Element)&&Y){_.headWhitespace&&$.type===v.Element&&"head"===$.tagName&&(U=!1);var Q={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P};if($.type===v.Element&&"textarea"===$.tagName&&void 0!==$.attributes.value);else for(var X=0,ee=Array.from(e.childNodes);X<ee.length;X++){var te=z(ee[X],Q);te&&$.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var ie=z(re[ne],Q);ie&&(y(e.shadowRoot)&&(ie.isShadow=!0),$.childNodes.push(ie))}}return e.parentNode&&m(e.parentNode)&&y(e.parentNode)&&($.isShadow=!0),$.type===v.Element&&"iframe"===$.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&R){var n=z(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});n&&R(e,n)}}),T),$.type===v.Element&&"link"===$.tagName&&"string"==typeof $.attributes.rel&&("stylesheet"===$.attributes.rel||"preload"===$.attributes.rel&&"string"==typeof $.attributes.href&&"css"===A($.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),i=!0,t()}))}}(e,(function(){if(O){var t=z(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});t&&O(e,t)}}),L),$}function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var J="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.",Q={map:{},getId:function(){return console.error(J),-1},getNode:function(){return console.error(J),null},removeNodeFromMap:function(){console.error(J)},has:function(){return console.error(J),!1},reset:function(){console.error(J)}};function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==n.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),i=u,e.apply(c,a)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(c,a)}),l))}}function ee(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ee(e,t,o||{},!0)}}function te(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Q=new Proxy(Q,{get:function(e,t,n){return"map"===t&&console.error(J),Reflect.get(e,t,n)}}));var ne=Date.now;function re(e){var t,n,r,i,o,a,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(o=null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function ie(){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 ae(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function se(e,t,n,r){if(!e)return!1;var i=ae(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if($(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function ue(e,t){return t.getId(e)===F}function le(e,t){if(m(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||le(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function de(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function he(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ne=function(){return(new Date).getTime()});var pe=function(){function e(){a(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return u(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function ge(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=ge(n);)n=t;return n}(e);return t.contains(n)}function me(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var ye=function(e){return 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",e}(ye||{}),_e=function(e){return 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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(_e||{}),be=function(e){return 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",e}(be||{}),Ie=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Ie||{}),ke=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ke||{});function we(e){return"__ln"in e}var Ce,Se=function(){function e(){a(this,e),this.length=0,this.head=null,this.tail=null}return u(e,[{key:"get",value: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}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&we(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&&we(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),Ae=function(e,t){return"".concat(e,"@").concat(t)},Ee=function(){function e(){var t=this;a(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new Se,i=function(e){for(var n=e,r=F;r===F;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},o=function(o){if(o.parentNode&&me(o)&&"TEXTAREA"!==o.parentNode.tagName){var a=m(o.parentNode)?t.mirror.getId(ge(o)):t.mirror.getId(o.parentNode),s=i(o);if(-1===a||-1===s)return r.addNode(o);var u=z(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){de(e,t.mirror)&&t.iframeManager.addIframe(e),fe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),he(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});u&&(e.push({parentId:a,nextId:s,node:u}),n.add(u.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var a,s=g(t.movedSet);try{for(s.s();!(a=s.n()).done;){var u=a.value;Me(t.removes,u,t.mirror)&&!t.movedSet.has(u.parentNode)||o(u)}}catch(e){s.e(e)}finally{s.f()}var l,c=g(t.addedSet);try{for(c.s();!(l=c.n()).done;){var d=l.value;Fe(t.droppedSet,d)||Me(t.removes,d,t.mirror)?Fe(t.movedSet,d)?o(d):t.droppedSet.add(d):o(d)}}catch(e){c.e(e)}finally{c.f()}for(var f=null;r.length;){var h=null;if(f){var p=t.mirror.getId(f.value.parentNode),v=i(f.value);-1!==p&&-1!==v&&(h=f)}if(!h)for(var y=r.tail;y;){var _=y;if(y=y.previous,_){var b=t.mirror.getId(_.value.parentNode);if(-1===i(_.value))continue;if(-1!==b){h=_;break}var I=_.value;if(I.parentNode&&I.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var k=I.parentNode.host;if(-1!==t.mirror.getId(k)){h=_;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}f=h.previous,r.removeNode(h.value),o(h.value)}var w={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+i).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(w))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ue(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;se(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:j(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,ae(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,o=e.target.getAttribute(i);if("value"===i){var a=S(r);o=k({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(se(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!t.keepIframeSrcFn(o)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!V(r.tagName,i)&&(s.attributes[i]=H(t.doc,w(r.tagName),w(i),o),"style"===i)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var l=0,c=Array.from(r.style);l<c.length;l++){var d=c[l],f=r.style.getPropertyValue(d),h=r.style.getPropertyPriority(d);f!==u.style.getPropertyValue(d)||h!==u.style.getPropertyPriority(d)?s.styleDiff[d]=""===h?f:[f,h]:s._unchangedStyles[d]=[f,h]}for(var p=0,g=Array.from(u.style);p<g.length;p++){var v=g[p];""===r.style.getPropertyValue(v)&&(s.styleDiff[v]=!1)}}break;case"childList":if(se(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),i=m(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);se(e.target,t.blockClass,t.blockSelector,!1)||ue(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Re(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||le(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[Ae(r,i)]?Re(t.movedSet,n):t.removes.push({parentId:i,id:r,isShadow:!(!m(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ue(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[Ae(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);se(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),he(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return u(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Re(e,t){e.delete(t),t.childNodes.forEach((function(t){return Re(e,t)}))}function Me(e,t,n){return 0!==e.length&&Te(e,t,n)}function Te(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||Te(e,r,n)}function Fe(e,t){return 0!==e.size&&xe(e,t)}function xe(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||xe(e,n))}function Oe(e){Ce=e}function Ne(){Ce=void 0}var Le=function(e){if(!Ce)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(Ce&&!0===Ce(e))return;throw e}}},De=[];function Pe(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]}catch(e){}return e&&e.target}function Be(e,t){var n,r,i=new Ee;De.push(i),i.init(e);var o=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]&&(o=window[a]);var s=new o(Le(i.processMutations.bind(i)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function qe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],l=null;return Object.keys(be).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var a=w(e),s=function(e){return function(n){var a=Pe(n);if(!se(a,i,o,!0)){var s=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Ie.Mouse;break;case"touch":s=Ie.Touch;break;case"pen":s=Ie.Pen}s===Ie.Touch?be[e]===be.MouseDown?u="TouchStart":be[e]===be.MouseUp&&(u="TouchEnd"):Ie.Pen}else ce(n)&&(s=Ie.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===Ie.Touch||u.startsWith("Mouse")&&s===Ie.Mouse)&&(s=null)):be[e]===be.Click&&(s=l,l=null);var c=ce(n)?n.changedTouches[0]:n;if(c){var d=r.getId(a),f=c.clientX,h=c.clientY;Le(t)(Object.assign({type:be[u],id:d,x:f,y:h},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(be[e]){case be.MouseDown:case be.MouseUp:a=a.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}u.push(Y(a,s,n))})),Le((function(){u.forEach((function(e){return e()}))}))}function We(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;return Y("scroll",Le(X(Le((function(e){var a=Pe(e);if(a&&!se(a,i,o,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var u=re(n.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),n)}var Ge=["INPUT","TEXTAREA","SELECT"],Ue=new WeakMap;function He(e){return function(e,t){if(Ze("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ze("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ze("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ze("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ve(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function $e(e,t){var n,r,i,o=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(t.host);var u="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(i=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=l.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return n}}),Le((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):function(){}}function je(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,c=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb,h=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),i.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),o.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),a.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),l.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),c.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),f.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),h.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),p.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Be(e,e.doc));var i=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],l=X(Le((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null})),s),c=Le(X(Le((function(e){var t=Pe(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=ne()),u.push({x:r,y:a,id:i.getId(t),timeOffset:ne()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_e.Drag:e instanceof MouseEvent?_e.MouseMove:_e.TouchMove)})),a,{trailing:!1})),d=[Y("mousemove",c,r),Y("touchmove",c,r),Y("drag",c,r)];return Le((function(){d.forEach((function(e){return e()}))}))}(e),o=qe(e),a=We(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,i=-1,o=-1;return Y("resize",Le(X(Le((function(){var e=ie(),t=oe();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:r}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=Pe(e),r=e.isTrusted,c=t&&t.tagName;if(t&&"OPTION"===c&&(t=t.parentElement),t&&c&&!(Ge.indexOf(c)<0)&&!se(t,i,o,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var f=t.value,h=!1,g=S(t)||"";"radio"===g||"checkbox"===g?h=t.checked:(u[c.toLowerCase()]||u[g])&&(f=k({element:t,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:l})),p(t,d?{text:f,isChecked:h,userTriggered:r}:{text:f,isChecked:h});var v=t.name;"radio"===g&&v&&h&&n.querySelectorAll('input[type="radio"][name="'.concat(v,'"]')).forEach((function(e){if(e!==t){var n=e.value;p(e,d?{text:n,isChecked:!h,userTriggered:!1}:{text:n,isChecked:!h})}}))}}function p(e,n){var i=Ue.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Ue.set(e,n);var o=r.getId(e);Le(t)(Object.assign(Object.assign({},n),{id:o}))}}var g=("last"===c.input?["change"]:["input","change"]).map((function(e){return Y(e,Le(h),n)})),v=n.defaultView;if(!v)return function(){g.forEach((function(e){return e()}))};var m=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push.apply(g,f(y.map((function(e){return ee(e[0],e[1],{set:function(){Le(h)({target:this,isTrusted:!1})}},!1,v)})))),Le((function(){g.forEach((function(e){return e()}))}))}(e),l=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,i=e.mirror,o=e.sampling,a=e.doc,s=Le((function(e){return X(Le((function(o){var a=Pe(o);if(a&&!se(a,n,r,!0)){var s=a.currentTime,u=a.volume,l=a.muted,c=a.playbackRate,d=a.loop;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500)})),u=[Y("play",s(0),a),Y("pause",s(1),a),Y("seeked",s(2),a),Y("volumechange",s(3),a),Y("ratechange",s(4),a)];return Le((function(){u.forEach((function(e){return e()}))}))}(e),c=function(){},h=function(){},p=function(){},v=function(){};e.recordDOM&&(c=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Le((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],l=Ve(t,r,i.styleMirror),c=l.id,f=l.styleId;return(c&&-1!==c||f&&-1!==f)&&n({id:c,styleId:f,adds:[{rule:s,index:u}]}),e.apply(t,o)}))});var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,replaceSync:a}),e.apply(t,o)}))}));var c={};Ke("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(Ke("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),Ke("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),Ke("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var h={};return Object.entries(c).forEach((function(e){var t=d(e,2),o=t[0],a=t[1];h[o]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(h[o].insertRule,{apply:Le((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],l=Ve(t.parentStyleSheet,r,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&n({id:c,styleId:h,adds:[{rule:s,index:[].concat(f(He(t)),[u||0])}]}),e.apply(t,o)}))}),a.prototype.deleteRule=new Proxy(h[o].deleteRule,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t.parentStyleSheet,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,removes:[{index:[].concat(f(He(t)),[a])}]}),e.apply(t,o)}))})})),Le((function(){o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=h[n].insertRule,r.prototype.deleteRule=h[n].deleteRule}))}))}(e,{win:r}),h=$e(e,e.doc),p=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=e.ignoreCSSAttributes,o=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Le((function(e,t,a){var u,l=d(a,3),c=l[0],f=l[1],h=l[2];if(i.has(c))return s.apply(t,[c,f,h]);var p=Ve(null===(u=t.parentRule)||void 0===u?void 0:u.parentStyleSheet,r,o.styleMirror),g=p.id,v=p.styleId;return(g&&-1!==g||v&&-1!==v)&&n({id:g,styleId:v,set:{property:c,value:f,priority:h},index:He(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Le((function(e,t,a){var s,l=d(a,1)[0];if(i.has(l))return u.apply(t,[l]);var c=Ve(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,o.styleMirror),f=c.id,h=c.styleId;return(f&&-1!==f||h&&-1!==h)&&n({id:f,styleId:h,remove:{property:l},index:He(t.parentRule)}),e.apply(t,a)}))}),Le((function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:r}),e.collectFonts&&(v=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return o.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=te(n.fonts,"add",(function(e){return function(n){return setTimeout(Le((function(){var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),Le((function(){i.forEach((function(e){return e()}))}))}(e)));var m,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,i=e.blockSelector,o=e.selectionCb,a=!0,s=Le((function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),d=c.startContainer,f=c.startOffset,h=c.endContainer,p=c.endOffset;se(d,r,i,!0)||se(h,r,i,!0)||s.push({start:n.getId(d),startOffset:f,end:n.getId(h),endOffset:p})}o({ranges:s})}}));return s(),Y("selectionchange",s)}(e),_=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?te(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,i])}})):function(){}}(e),b=[],I=g(e.plugins);try{for(I.s();!(m=I.n()).done;){var w=m.value;b.push(w.observer(w.callback,r,w.options))}}catch(e){I.e(e)}finally{I.f()}return Le((function(){De.forEach((function(e){return e.reset()})),null==t||t.disconnect(),i(),o(),a(),s(),u(),l(),c(),h(),p(),v(),y(),_(),b.forEach((function(e){return e()}))}))}function Ze(e){return void 0!==window[e]}function Ke(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){a(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return u(e,[{key:"getId",value:function(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,i)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Ye=function(){function e(t){a(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(x),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return u(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ye.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:ye.IncrementalSnapshot,data:{source:_e.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ye.Meta:case ye.Load:case ye.DomContentLoaded:return!1;case ye.Plugin:return t;case ye.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ye.IncrementalSnapshot:switch(t.data.source){case _e.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case _e.Drag:case _e.TouchMove:case _e.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case _e.ViewportResize:return!1;case _e.MediaInteraction:case _e.MouseInteraction:case _e.Scroll:case _e.CanvasMutation:case _e.Input:return this.replaceIds(t.data,e,["id"]),t;case _e.StyleSheetRule:case _e.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _e.Font:return t;case _e.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case _e.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=g(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===v.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Je=function(){function e(t){a(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return u(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Be(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(We(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push($e({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(te(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r);return this.shadowRoot&&me(this)&&n.addShadowRoot(this.shadowRoot,t),i}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Qe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tt=0;tt<64;tt++)et[Xe.charCodeAt(tt)]=tt;var nt=new Map;var rt=function(e,t,n){if(e&&(at(e,t)||"object"===r(e))){var i=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=i.indexOf(e);return-1===o&&(o=i.length,i.push(e)),o}};function it(e,t,n){if(e instanceof Array)return e.map((function(e){return it(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 i=e.constructor.name,o=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Xe[n[t]>>2],i+=Xe[(3&n[t])<<4|n[t+1]>>4],i+=Xe[(15&n[t+1])<<2|n[t+2]>>6],i+=Xe[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[it(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[it(e.data,t,n),e.width,e.height]}:at(e,t)||"object"===r(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var ot=function(e,t,n){return e.map((function(e){return it(e,t,n)}))},at=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 st(e,t,n,i){var o=[];try{var a=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];if(!se(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"===r(s[0])){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o].concat(s))}}));o.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){o.forEach((function(e){return e()}))}}function ut(e,t,n,r,i,o,a){var s,u=[],l=g(Object.getOwnPropertyNames(e));try{var c=function(){var o=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))return"continue";try{if("function"!=typeof e[o])return"continue";var l=te(e,o,(function(e){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var c=e.apply(this,u);if(rt(c,a,this),"tagName"in this.canvas&&!se(this.canvas,r,i,!0)){var d=ot(u,a,this),f={type:t,property:o,args:d};n(this.canvas,f)}return c}}));u.push(l)}catch(r){var c=ee(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});u.push(c)}};for(l.s();!(s=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}return u}function lt(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),o=i.indexOf("\n",10)+1,a=i.substring(o)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var ct,dt,ft,ht,pt,gt,vt,mt=(ct="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,ft=!1,function(e){return ht=ht||lt(ct,dt,ft),new Worker(ht,e)}),yt=function(){function e(t){var n=this;a(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,i=void 0===r?"all":r,o=t.win,s=t.blockClass,u=t.blockSelector,l=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&"all"===i&&this.initCanvasMutationObserver(o,s,u),l&&"number"==typeof i&&this.initCanvasFPSObserver(i,o,s,u,{dataURLOptions:c})}return u(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,r,i,o){var a=this,s=st(t,r,i,!0),u=new Map,l=new mt;l.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,i=n.type,o=n.width,s=n.height;a.mutationCb({id:t,type:ke["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,d=1e3/e,f=0;c=requestAnimationFrame((function e(s){var h;f&&s-f<d?c=requestAnimationFrame(e):(f=s,(h=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){se(e,r,i,!0)||h.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),h).forEach((function(e){return Qe(a,void 0,void 0,n().mark((function t(){var r,i,a,s,c,d;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.mirror.getId(e),!u.get(i)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return u.set(i,!0),["webgl","webgl2"].includes(e.__context)&&(a=e.getContext(e.__context),!1===(null===(r=null==a?void 0:a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)),s=e.clientWidth||client.width,c=e.clientHeight||client.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:c});case 11:d=t.sent,l.postMessage({id:i,bitmap:d,width:s,height:c,dataURLOptions:o.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),c=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(c)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),i=function(e,t,n,r){var i,o=[],a=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var a=i.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])return"continue";var s=te(t.CanvasRenderingContext2D.prototype,a,(function(i){return function(){for(var o=this,s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];return se(this.canvas,n,r,!0)||setTimeout((function(){var n=ot(u,t,o);e(o.canvas,{type:ke["2D"],property:a,args:n})}),0),i.apply(this,u)}}));o.push(s)}catch(n){var u=ee(t.CanvasRenderingContext2D.prototype,a,{set:function(t){e(this.canvas,{type:ke["2D"],property:a,args:[t],setter:!0})}});o.push(u)}};for(a.s();!(i=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r,i){var o=[];return o.push.apply(o,f(ut(t.WebGLRenderingContext.prototype,ke.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&o.push.apply(o,f(ut(t.WebGL2RenderingContext.prototype,ke.WebGL2,e,n,r,0,t))),function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),i(),o()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value: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()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
1
+ !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function f(){}function h(){}function p(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==t&&r.call(m,o)&&(g=m);var y=p.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function I(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=p,u(y,"constructor",p),u(p,"constructor",h),h.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},_(b.prototype),u(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(y),u(y,s,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e){return r="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},r(e)}function i(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(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,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||h(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 f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(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 h(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function p(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 g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,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,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var v;function m(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t,b).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function b(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=_(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!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"}(v||(v={}));var I=function(){function e(){a(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return u(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function k(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,s=o||"",u=i&&w(i);return(n[r.toLowerCase()]||u&&n[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function w(e){return e.toLowerCase()}var C="__rrweb_original__";function S(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?w(t):null}function A(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==i?void 0:i[1])&&void 0!==n?n:null}var E,R,M=1,T=new RegExp("[^a-z0-9-_:]"),F=-2;function x(){return M++}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function P(e,t){return(e||"").replace(O,(function(e,n,r,i,o,a){var s,u=r||o||a,l=n||i||"";if(!u)return e;if(N.test(u)||L.test(u))return"url(".concat(l).concat(u).concat(l,")");if(D.test(u))return"url(".concat(l).concat(u).concat(l,")");if("/"===u[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(l,")");var c=t.split("/"),d=u.split("/");c.pop();var f,h=g(d);try{for(h.s();!(f=h.n()).done;){var p=f.value;"."!==p&&(".."===p?c.pop():c.push(p))}}catch(e){h.e(e)}finally{h.f()}return"url(".concat(l).concat(c.join("/")).concat(l,")")}))}var B=/^[^ \t\n\r\u000c]+/,q=/^[, \t\n\r\u000c]+/;function W(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(){var e=document.createElement("a");return e.href="",e.href}function H(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?W(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(q),!(n>=t.length);){var o=r(B);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=W(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n?P(r,U()):"object"===t&&"data"===n?W(e,r):r:W(e,r):r}function V(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function $(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&$(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&$(e.parentNode,t,n)}function j(e,t,n,r){try{var i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===i)return!1;if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if($(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function Z(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.needsMask,s=t.inlineStylesheet,u=t.maskInputOptions,l=void 0===u?{}:u,c=t.maskTextFn,d=t.maskInputFn,f=t.dataURLOptions,h=void 0===f?{}:f,p=t.inlineImages,g=t.recordCanvas,m=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:v.Document,childNodes:[],compatMode:e.compatMode}:{type:v.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,i=t.blockClass,o=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,c=t.dataURLOptions,d=void 0===c?{}:c,f=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,g=t.newlyAddedElement,m=void 0!==g&&g,y=t.rootId,b=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=w(e.tagName);return T.test(t)?"div":t}(e),A={},M=e.attributes.length,F=0;F<M;F++){var x=e.attributes[F];V(I,x.name,x.value)||(A[x.name]=H(r,I,w(x.name),x.value))}if("link"===I&&a){var O=Array.from(r.styleSheets).find((function(t){return t.href===e.href})),N=null;O&&(N=_(O)),N&&(delete A.rel,delete A.href,A._cssText=P(N,O.href))}if("style"===I&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=_(e.sheet);L&&(A._cssText=P(L,U()))}if("input"===I||"textarea"===I||"select"===I){var D=e.value,B=e.checked;"radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&D?A.value=k({element:e,type:S(e),tagName:I,value:D,maskInputOptions:u,maskInputFn:l}):B&&(A.checked=B)}"option"===I&&(e.selected&&!u.select?A.selected=!0:delete A.selected);if("canvas"===I&&h)if("2d"===e.__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 i=t.getImageData,o=C in i?i[C]:i;if(new Uint32Array(o.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})(e)||(A.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var q=e.toDataURL(d.type,d.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height,q!==W.toDataURL(d.type,d.quality)&&(A.rr_dataURL=q)}if("img"===I&&f){E||(E=r.createElement("canvas"),R=E.getContext("2d"));var $=e,j=$.crossOrigin;$.crossOrigin="anonymous";var Z=function e(){$.removeEventListener("load",e);try{E.width=$.naturalWidth,E.height=$.naturalHeight,R.drawImage($,0,0),A.rr_dataURL=E.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat($.currentSrc,"! Error: ").concat(e))}j?A.crossOrigin=j:$.removeAttribute("crossorigin")};$.complete&&0!==$.naturalWidth?Z():$.addEventListener("load",Z)}if("audio"===I||"video"===I){var K=A;K.rr_mediaState=e.paused?"paused":"played",K.rr_mediaCurrentTime=e.currentTime,K.rr_mediaPlaybackRate=e.playbackRate,K.rr_mediaMuted=e.muted,K.rr_mediaLoop=e.loop,K.rr_mediaVolume=e.volume}m||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop));if(b){var z=e.getBoundingClientRect(),Y=z.width,J=z.height;A={class:A.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==I||p(A.src)||(e.contentDocument||(A.rr_src=A.src),delete A.src);try{customElements.get(I)&&(n=!0)}catch(e){}return{type:v.Element,tagName:I,attributes:A,childNodes:[],isSVG:G(e)||void 0,needBlock:b,rootId:y,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:I});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,i=t.maskTextFn,o=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=_(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=P(s,U())}l&&(s="SCRIPT_PLACEHOLDER");!u&&!l&&s&&r&&(s=i?i(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:v.Text,textContent:s||"",isStyle:u,rootId:o}}(e,{needsMask:a,maskTextFn:c,rootId:I});case e.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:v.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function K(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,c=t.inlineStylesheet,d=void 0===c||c,f=t.maskInputOptions,h=void 0===f?{}:f,p=t.maskTextFn,g=t.maskInputFn,_=t.slimDOMOptions,b=t.dataURLOptions,I=void 0===b?{}:b,k=t.inlineImages,w=void 0!==k&&k,C=t.recordCanvas,S=void 0!==C&&C,E=t.onSerialize,R=t.onIframeLoad,M=t.iframeLoadTimeout,T=void 0===M?5e3:M,O=t.onStylesheetLoad,N=t.stylesheetLoadTimeout,L=void 0===N?5e3:N,D=t.keepIframeSrcFn,P=void 0===D?function(){return!1}:D,B=t.newlyAddedElement,q=void 0!==B&&B,W=t.needsMask,G=t.preserveWhiteSpace,U=void 0===G||G;!W&&e.childNodes&&(W=j(e,a,s,void 0===W));var H,V=Z(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,dataURLOptions:I,inlineImages:w,recordCanvas:S,keepIframeSrcFn:P,newlyAddedElement:q});if(!V)return console.warn(e,"not serialized"),null;H=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===v.Comment)return!0;if(e.type===v.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===A(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(K(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===K(e.attributes.name)||"icon"===K(e.attributes.rel)||"apple-touch-icon"===K(e.attributes.rel)||"shortcut icon"===K(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&K(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(K(e.attributes.property).match(/^(og|twitter|fb):/)||K(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===K(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===K(e.attributes.name)||"googlebot"===K(e.attributes.name)||"bingbot"===K(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===K(e.attributes.name)||"generator"===K(e.attributes.name)||"framework"===K(e.attributes.name)||"publisher"===K(e.attributes.name)||"progid"===K(e.attributes.name)||K(e.attributes.property).match(/^article:/)||K(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===K(e.attributes.name)||"yandex-verification"===K(e.attributes.name)||"csrf-token"===K(e.attributes.name)||"p:domain_verify"===K(e.attributes.name)||"verify-v1"===K(e.attributes.name)||"verification"===K(e.attributes.name)||"shopify-checkout-api-token"===K(e.attributes.name)))return!0}}return!1}(V,_)&&(U||V.type!==v.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?x():F;var $=Object.assign(V,{id:H});if(r.add(e,$),H===F)return null;E&&E(e);var Y=!l;if($.type===v.Element){Y=Y&&!$.needBlock,delete $.needBlock;var J=e.shadowRoot;J&&y(J)&&($.isShadowHost=!0)}if(($.type===v.Document||$.type===v.Element)&&Y){_.headWhitespace&&$.type===v.Element&&"head"===$.tagName&&(U=!1);var Q={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P};if($.type===v.Element&&"textarea"===$.tagName&&void 0!==$.attributes.value);else for(var X=0,ee=Array.from(e.childNodes);X<ee.length;X++){var te=z(ee[X],Q);te&&$.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var ie=z(re[ne],Q);ie&&(y(e.shadowRoot)&&(ie.isShadow=!0),$.childNodes.push(ie))}}return e.parentNode&&m(e.parentNode)&&y(e.parentNode)&&($.isShadow=!0),$.type===v.Element&&"iframe"===$.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&R){var n=z(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});n&&R(e,n)}}),T),$.type===v.Element&&"link"===$.tagName&&"string"==typeof $.attributes.rel&&("stylesheet"===$.attributes.rel||"preload"===$.attributes.rel&&"string"==typeof $.attributes.href&&"css"===A($.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),i=!0,t()}))}}(e,(function(){if(O){var t=z(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:W,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:g,slimDOMOptions:_,dataURLOptions:I,inlineImages:w,recordCanvas:S,preserveWhiteSpace:U,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:T,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});t&&O(e,t)}}),L),$}function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var J="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.",Q={map:{},getId:function(){return console.error(J),-1},getNode:function(){return console.error(J),null},removeNodeFromMap:function(){console.error(J)},has:function(){return console.error(J),!1},reset:function(){console.error(J)}};function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==n.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),i=u,e.apply(c,a)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(c,a)}),l))}}function ee(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ee(e,t,o||{},!0)}}function te(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Q=new Proxy(Q,{get:function(e,t,n){return"map"===t&&console.error(J),Reflect.get(e,t,n)}}));var ne=Date.now;function re(e){var t,n,r,i,o,a,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(o=null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function ie(){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 ae(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function se(e,t,n,r){if(!e)return!1;var i=ae(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if($(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function ue(e,t){return t.getId(e)===F}function le(e,t){if(m(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||le(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function de(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function he(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ne=function(){return(new Date).getTime()});var pe=function(){function e(){a(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return u(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function ge(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=ge(n);)n=t;return n}(e);return t.contains(n)}function me(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var ye=function(e){return 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",e}(ye||{}),_e=function(e){return 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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(_e||{}),be=function(e){return 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",e}(be||{}),Ie=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Ie||{}),ke=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ke||{});function we(e){return"__ln"in e}var Ce,Se=function(){function e(){a(this,e),this.length=0,this.head=null,this.tail=null}return u(e,[{key:"get",value: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}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&we(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&&we(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),Ae=function(e,t){return"".concat(e,"@").concat(t)},Ee=function(){function e(){var t=this;a(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new Se,i=function(e){for(var n=e,r=F;r===F;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},o=function(o){if(o.parentNode&&me(o)&&"TEXTAREA"!==o.parentNode.tagName){var a=m(o.parentNode)?t.mirror.getId(ge(o)):t.mirror.getId(o.parentNode),s=i(o);if(-1===a||-1===s)return r.addNode(o);var u=z(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){de(e,t.mirror)&&t.iframeManager.addIframe(e),fe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),he(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});u&&(e.push({parentId:a,nextId:s,node:u}),n.add(u.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var a,s=g(t.movedSet);try{for(s.s();!(a=s.n()).done;){var u=a.value;Me(t.removes,u,t.mirror)&&!t.movedSet.has(u.parentNode)||o(u)}}catch(e){s.e(e)}finally{s.f()}var l,c=g(t.addedSet);try{for(c.s();!(l=c.n()).done;){var d=l.value;Fe(t.droppedSet,d)||Me(t.removes,d,t.mirror)?Fe(t.movedSet,d)?o(d):t.droppedSet.add(d):o(d)}}catch(e){c.e(e)}finally{c.f()}for(var f=null;r.length;){var h=null;if(f){var p=t.mirror.getId(f.value.parentNode),v=i(f.value);-1!==p&&-1!==v&&(h=f)}if(!h)for(var y=r.tail;y;){var _=y;if(y=y.previous,_){var b=t.mirror.getId(_.value.parentNode);if(-1===i(_.value))continue;if(-1!==b){h=_;break}var I=_.value;if(I.parentNode&&I.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var k=I.parentNode.host;if(-1!==t.mirror.getId(k)){h=_;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}f=h.previous,r.removeNode(h.value),o(h.value)}var w={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+i).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(w))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ue(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;se(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:j(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,ae(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,o=e.target.getAttribute(i);if("value"===i){var a=S(r);o=k({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(se(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!t.keepIframeSrcFn(o)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!V(r.tagName,i)&&(s.attributes[i]=H(t.doc,w(r.tagName),w(i),o),"style"===i)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var l=0,c=Array.from(r.style);l<c.length;l++){var d=c[l],f=r.style.getPropertyValue(d),h=r.style.getPropertyPriority(d);f!==u.style.getPropertyValue(d)||h!==u.style.getPropertyPriority(d)?s.styleDiff[d]=""===h?f:[f,h]:s._unchangedStyles[d]=[f,h]}for(var p=0,g=Array.from(u.style);p<g.length;p++){var v=g[p];""===r.style.getPropertyValue(v)&&(s.styleDiff[v]=!1)}}break;case"childList":if(se(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),i=m(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);se(e.target,t.blockClass,t.blockSelector,!1)||ue(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Re(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||le(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[Ae(r,i)]?Re(t.movedSet,n):t.removes.push({parentId:i,id:r,isShadow:!(!m(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ue(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[Ae(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);se(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),he(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return u(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Re(e,t){e.delete(t),t.childNodes.forEach((function(t){return Re(e,t)}))}function Me(e,t,n){return 0!==e.length&&Te(e,t,n)}function Te(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||Te(e,r,n)}function Fe(e,t){return 0!==e.size&&xe(e,t)}function xe(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||xe(e,n))}function Oe(e){Ce=e}function Ne(){Ce=void 0}var Le=function(e){if(!Ce)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(Ce&&!0===Ce(e))return;throw e}}},De=[];function Pe(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]}catch(e){}return e&&e.target}function Be(e,t){var n,r,i=new Ee;De.push(i),i.init(e);var o=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]&&(o=window[a]);var s=new o(Le(i.processMutations.bind(i)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function qe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],l=null;return Object.keys(be).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var a=w(e),s=function(e){return function(n){var a=Pe(n);if(!se(a,i,o,!0)){var s=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Ie.Mouse;break;case"touch":s=Ie.Touch;break;case"pen":s=Ie.Pen}s===Ie.Touch?be[e]===be.MouseDown?u="TouchStart":be[e]===be.MouseUp&&(u="TouchEnd"):Ie.Pen}else ce(n)&&(s=Ie.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===Ie.Touch||u.startsWith("Mouse")&&s===Ie.Mouse)&&(s=null)):be[e]===be.Click&&(s=l,l=null);var c=ce(n)?n.changedTouches[0]:n;if(c){var d=r.getId(a),f=c.clientX,h=c.clientY;Le(t)(Object.assign({type:be[u],id:d,x:f,y:h},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(be[e]){case be.MouseDown:case be.MouseUp:a=a.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}u.push(Y(a,s,n))})),Le((function(){u.forEach((function(e){return e()}))}))}function We(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;return Y("scroll",Le(X(Le((function(e){var a=Pe(e);if(a&&!se(a,i,o,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var u=re(n.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),n)}var Ge=["INPUT","TEXTAREA","SELECT"],Ue=new WeakMap;function He(e){return function(e,t){if(Ze("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ze("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ze("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ze("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ve(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function $e(e,t){var n,r,i,o=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(t.host);var u="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(i=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=l.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return n}}),Le((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):function(){}}function je(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,c=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb,h=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),i.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),o.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),a.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),l.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),c.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),f.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),h.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),p.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Be(e,e.doc));var i=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],l=X(Le((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null})),s),c=Le(X(Le((function(e){var t=Pe(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=ne()),u.push({x:r,y:a,id:i.getId(t),timeOffset:ne()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_e.Drag:e instanceof MouseEvent?_e.MouseMove:_e.TouchMove)})),a,{trailing:!1})),d=[Y("mousemove",c,r),Y("touchmove",c,r),Y("drag",c,r)];return Le((function(){d.forEach((function(e){return e()}))}))}(e),o=qe(e),a=We(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,i=-1,o=-1;return Y("resize",Le(X(Le((function(){var e=ie(),t=oe();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:r}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=Pe(e),r=e.isTrusted,c=t&&t.tagName;if(t&&"OPTION"===c&&(t=t.parentElement),t&&c&&!(Ge.indexOf(c)<0)&&!se(t,i,o,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var f=t.value,h=!1,g=S(t)||"";"radio"===g||"checkbox"===g?h=t.checked:(u[c.toLowerCase()]||u[g])&&(f=k({element:t,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:l})),p(t,d?{text:f,isChecked:h,userTriggered:r}:{text:f,isChecked:h});var v=t.name;"radio"===g&&v&&h&&n.querySelectorAll('input[type="radio"][name="'.concat(v,'"]')).forEach((function(e){if(e!==t){var n=e.value;p(e,d?{text:n,isChecked:!h,userTriggered:!1}:{text:n,isChecked:!h})}}))}}function p(e,n){var i=Ue.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Ue.set(e,n);var o=r.getId(e);Le(t)(Object.assign(Object.assign({},n),{id:o}))}}var g=("last"===c.input?["change"]:["input","change"]).map((function(e){return Y(e,Le(h),n)})),v=n.defaultView;if(!v)return function(){g.forEach((function(e){return e()}))};var m=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push.apply(g,f(y.map((function(e){return ee(e[0],e[1],{set:function(){Le(h)({target:this,isTrusted:!1})}},!1,v)})))),Le((function(){g.forEach((function(e){return e()}))}))}(e),l=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,i=e.mirror,o=e.sampling,a=e.doc,s=Le((function(e){return X(Le((function(o){var a=Pe(o);if(a&&!se(a,n,r,!0)){var s=a.currentTime,u=a.volume,l=a.muted,c=a.playbackRate,d=a.loop;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500)})),u=[Y("play",s(0),a),Y("pause",s(1),a),Y("seeked",s(2),a),Y("volumechange",s(3),a),Y("ratechange",s(4),a)];return Le((function(){u.forEach((function(e){return e()}))}))}(e),c=function(){},h=function(){},p=function(){},v=function(){};e.recordDOM&&(c=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Le((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],l=Ve(t,r,i.styleMirror),c=l.id,f=l.styleId;return(c&&-1!==c||f&&-1!==f)&&n({id:c,styleId:f,adds:[{rule:s,index:u}]}),e.apply(t,o)}))});var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,replaceSync:a}),e.apply(t,o)}))}));var c={};Ke("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(Ke("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),Ke("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),Ke("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var h={};return Object.entries(c).forEach((function(e){var t=d(e,2),o=t[0],a=t[1];h[o]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(h[o].insertRule,{apply:Le((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],l=Ve(t.parentStyleSheet,r,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&n({id:c,styleId:h,adds:[{rule:s,index:[].concat(f(He(t)),[u||0])}]}),e.apply(t,o)}))}),a.prototype.deleteRule=new Proxy(h[o].deleteRule,{apply:Le((function(e,t,o){var a=d(o,1)[0],s=Ve(t.parentStyleSheet,r,i.styleMirror),u=s.id,l=s.styleId;return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,removes:[{index:[].concat(f(He(t)),[a])}]}),e.apply(t,o)}))})})),Le((function(){o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=h[n].insertRule,r.prototype.deleteRule=h[n].deleteRule}))}))}(e,{win:r}),h=$e(e,e.doc),p=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=e.ignoreCSSAttributes,o=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Le((function(e,t,a){var u,l=d(a,3),c=l[0],f=l[1],h=l[2];if(i.has(c))return s.apply(t,[c,f,h]);var p=Ve(null===(u=t.parentRule)||void 0===u?void 0:u.parentStyleSheet,r,o.styleMirror),g=p.id,v=p.styleId;return(g&&-1!==g||v&&-1!==v)&&n({id:g,styleId:v,set:{property:c,value:f,priority:h},index:He(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Le((function(e,t,a){var s,l=d(a,1)[0];if(i.has(l))return u.apply(t,[l]);var c=Ve(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,o.styleMirror),f=c.id,h=c.styleId;return(f&&-1!==f||h&&-1!==h)&&n({id:f,styleId:h,remove:{property:l},index:He(t.parentRule)}),e.apply(t,a)}))}),Le((function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:r}),e.collectFonts&&(v=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return o.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=te(n.fonts,"add",(function(e){return function(n){return setTimeout(Le((function(){var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),Le((function(){i.forEach((function(e){return e()}))}))}(e)));var m,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,i=e.blockSelector,o=e.selectionCb,a=!0,s=Le((function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),d=c.startContainer,f=c.startOffset,h=c.endContainer,p=c.endOffset;se(d,r,i,!0)||se(h,r,i,!0)||s.push({start:n.getId(d),startOffset:f,end:n.getId(h),endOffset:p})}o({ranges:s})}}));return s(),Y("selectionchange",s)}(e),_=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?te(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,i])}})):function(){}}(e),b=[],I=g(e.plugins);try{for(I.s();!(m=I.n()).done;){var w=m.value;b.push(w.observer(w.callback,r,w.options))}}catch(e){I.e(e)}finally{I.f()}return Le((function(){De.forEach((function(e){return e.reset()})),null==t||t.disconnect(),i(),o(),a(),s(),u(),l(),c(),h(),p(),v(),y(),_(),b.forEach((function(e){return e()}))}))}function Ze(e){return void 0!==window[e]}function Ke(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){a(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return u(e,[{key:"getId",value:function(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,i)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Ye=function(){function e(t){a(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(x),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return u(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ye.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:ye.IncrementalSnapshot,data:{source:_e.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ye.Meta:case ye.Load:case ye.DomContentLoaded:return!1;case ye.Plugin:return t;case ye.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ye.IncrementalSnapshot:switch(t.data.source){case _e.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case _e.Drag:case _e.TouchMove:case _e.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case _e.ViewportResize:return!1;case _e.MediaInteraction:case _e.MouseInteraction:case _e.Scroll:case _e.CanvasMutation:case _e.Input:return this.replaceIds(t.data,e,["id"]),t;case _e.StyleSheetRule:case _e.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _e.Font:return t;case _e.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case _e.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=g(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===v.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Je=function(){function e(t){a(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return u(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Be(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(We(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push($e({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(te(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r);return this.shadowRoot&&me(this)&&n.addShadowRoot(this.shadowRoot,t),i}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Qe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tt=0;tt<64;tt++)et[Xe.charCodeAt(tt)]=tt;var nt=new Map;var rt=function(e,t,n){if(e&&(at(e,t)||"object"===r(e))){var i=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=i.indexOf(e);return-1===o&&(o=i.length,i.push(e)),o}};function it(e,t,n){if(e instanceof Array)return e.map((function(e){return it(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 i=e.constructor.name,o=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Xe[n[t]>>2],i+=Xe[(3&n[t])<<4|n[t+1]>>4],i+=Xe[(15&n[t+1])<<2|n[t+2]>>6],i+=Xe[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[it(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[it(e.data,t,n),e.width,e.height]}:at(e,t)||"object"===r(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var ot=function(e,t,n){return e.map((function(e){return it(e,t,n)}))},at=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 st(e,t,n,i){var o=[];try{var a=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];if(!se(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"===r(s[0])){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o].concat(s))}}));o.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){o.forEach((function(e){return e()}))}}function ut(e,t,n,r,i,o,a){var s,u=[],l=g(Object.getOwnPropertyNames(e));try{var c=function(){var o=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))return"continue";try{if("function"!=typeof e[o])return"continue";var l=te(e,o,(function(e){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var c=e.apply(this,u);if(rt(c,a,this),"tagName"in this.canvas&&!se(this.canvas,r,i,!0)){var d=ot(u,a,this),f={type:t,property:o,args:d};n(this.canvas,f)}return c}}));u.push(l)}catch(r){var c=ee(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});u.push(c)}};for(l.s();!(s=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}return u}function lt(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),o=i.indexOf("\n",10)+1,a=i.substring(o)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var ct,dt,ft,ht,pt,gt,vt,mt=(ct="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,ft=!1,function(e){return ht=ht||lt(ct,dt,ft),new Worker(ht,e)}),yt=function(){function e(t){var n=this;a(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,i=void 0===r?"all":r,o=t.win,s=t.blockClass,u=t.blockSelector,l=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&"all"===i&&this.initCanvasMutationObserver(o,s,u),l&&"number"==typeof i&&this.initCanvasFPSObserver(i,o,s,u,{dataURLOptions:c})}return u(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,r,i,o){var a=this,s=st(t,r,i,!0),u=new Map,l=new mt;l.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,i=n.type,o=n.width,s=n.height;a.mutationCb({id:t,type:ke["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,d=1e3/e,f=0;c=requestAnimationFrame((function e(s){var h;f&&s-f<d?c=requestAnimationFrame(e):(f=s,(h=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){se(e,r,i,!0)||h.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),h).forEach((function(e){return Qe(a,void 0,void 0,n().mark((function t(){var r,i,a,s,c,d;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.mirror.getId(e),!u.get(i)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return u.set(i,!0),["webgl","webgl2"].includes(e.__context)&&(a=e.getContext(e.__context),!1===(null===(r=null==a?void 0:a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)),s=e.clientWidth||e.width,c=e.clientHeight||e.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:c});case 11:d=t.sent,l.postMessage({id:i,bitmap:d,width:s,height:c,dataURLOptions:o.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),c=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(c)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),i=function(e,t,n,r){var i,o=[],a=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var a=i.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])return"continue";var s=te(t.CanvasRenderingContext2D.prototype,a,(function(i){return function(){for(var o=this,s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];return se(this.canvas,n,r,!0)||setTimeout((function(){var n=ot(u,t,o);e(o.canvas,{type:ke["2D"],property:a,args:n})}),0),i.apply(this,u)}}));o.push(s)}catch(n){var u=ee(t.CanvasRenderingContext2D.prototype,a,{set:function(t){e(this.canvas,{type:ke["2D"],property:a,args:[t],setter:!0})}});o.push(u)}};for(a.s();!(i=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r,i){var o=[];return o.push.apply(o,f(ut(t.WebGLRenderingContext.prototype,ke.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&o.push.apply(o,f(ut(t.WebGL2RenderingContext.prototype,ke.WebGL2,e,n,r,0,t))),function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),i(),o()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value: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()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,5 +13,5 @@
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- 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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),_t=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new pe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=g(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),i.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:b(e),index:t}}))})),r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),bt=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function It(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var kt=!1,wt=new I;function Ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,l=void 0===u?"rr-ignore":u,c=e.ignoreSelector,d=void 0===c?null:c,f=e.maskTextClass,h=void 0===f?"rr-mask":f,p=e.maskTextSelector,v=void 0===p?null:p,m=e.inlineStylesheet,y=void 0===m||m,_=e.maskAllInputs,b=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,C=e.maskTextFn,S=e.hooks,A=e.packFn,E=e.sampling,R=void 0===E?{}:E,M=e.dataURLOptions,T=void 0===M?{}:M,F=e.mousemoveWait,x=e.recordDOM,O=void 0===x||x,N=e.recordCanvas,L=void 0!==N&&N,D=e.recordCrossOriginIframes,P=void 0!==D&&D,B=e.recordAfter,q=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,W=e.userTriggeredOnInput,G=void 0!==W&&W,U=e.collectFonts,H=void 0!==U&&U,V=e.inlineImages,$=void 0!==V&&V,j=e.plugins,Z=e.keepIframeSrcFn,K=void 0===Z?function(){return!1}:Z,J=e.ignoreCSSAttributes,Q=void 0===J?new Set([]):J;Oe(e.errorHandler);var X=!P||window.parent===window,ee=!1;if(!X)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if(X&&!t)throw new Error("emit function is required");void 0!==F&&void 0===R.mousemove&&(R.mousemove=F),wt.reset();var te,ne=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},ae=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var se=0,ue=function(e){var t,n=g(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!ee&&(e=A(e)),e};pt=function(e,i){var o;if(!(null===(o=De[0])||void 0===o?void 0:o.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===_e.Mutation||De.forEach((function(e){return e.unfreeze()})),X)null==t||t(ue(e),i);else if(ee){var a={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===_e.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&&gt(!0)}};var le,ce=function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Mutation},e)}))},pe=function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Scroll},e)}))},ge=function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.CanvasMutation},e)}))},ve=new _t({mutationCb:ce,adoptedStyleSheetCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.AdoptedStyleSheet},e)}))}}),me=new Ye({mirror:wt,mutationCb:ce,stylesheetManager:ve,recordCrossOriginIframes:P,wrappedEmit:pt}),be=g(j||[]);try{for(be.s();!(le=be.n()).done;){var Ie=le.value;Ie.getMirror&&Ie.getMirror({nodeMirror:wt,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){be.e(e)}finally{be.f()}var ke=new bt;vt=new yt({recordCanvas:L,mutationCb:ge,win:window,blockClass:o,blockSelector:s,mirror:wt,sampling:R.canvas,dataURLOptions:T});var we=new Je({mutationCb:ce,scrollCb:pe,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:h,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:T,maskTextFn:C,maskInputFn:w,recordCanvas:L,inlineImages:$,sampling:R,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ve,canvasManager:vt,keepIframeSrcFn:K,processedNodeManager:ke},mirror:wt});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(O){pt(It({type:ye.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ve.reset(),we.init(),De.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new I:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,l=n.maskTextClass,c=void 0===l?"rr-mask":l,d=n.maskTextSelector,f=void 0===d?null:d,h=n.inlineStylesheet,p=void 0===h||h,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,_=n.maskAllInputs,b=void 0!==_&&_,k=n.maskTextFn,w=n.maskInputFn,C=n.slimDOM,S=void 0!==C&&C,A=n.dataURLOptions,E=n.preserveWhiteSpace,R=n.onSerialize,M=n.onIframeLoad,T=n.iframeLoadTimeout,F=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return z(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:k,maskInputFn:w,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:T,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:wt,blockClass:o,blockSelector:s,maskTextClass:h,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:C,slimDOM:ae,dataURLOptions:T,recordCanvas:L,inlineImages:$,onSerialize:function(e){de(e,wt)&&me.addIframe(e),fe(e,wt)&&ve.trackLinkElement(e),he(e)&&we.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),we.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ve.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!t)return console.warn("Failed to snapshot the document");pt(It({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),De.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ve.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))}};try{var Ce=[],Se=function(e){var t;return Le(je)({mutationCb:ce,mousemoveCb:function(e,t){return pt(It({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.MouseInteraction},e)}))},scrollCb:pe,viewportResizeCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.ViewportResize},e)}))},inputCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Input},e)}))},mediaInteractionCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Font},e)}))},selectionCb:function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Selection},e)}))},customElementCb:function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.CustomElement},e)}))},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:h,maskTextSelector:v,maskInputOptions:ne,inlineStylesheet:y,sampling:R,recordDOM:O,recordCanvas:L,inlineImages:$,userTriggeredOnInput:G,collectFonts:H,doc:e,maskInputFn:w,maskTextFn:C,keepIframeSrcFn:K,blockSelector:s,slimDOMOptions:ae,dataURLOptions:T,mirror:wt,iframeManager:me,stylesheetManager:ve,shadowDomManager:we,processedNodeManager:ke,canvasManager:vt,ignoreCSSAttributes:Q,plugins:(null===(t=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return pt(It({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};me.addLoadListener((function(e){try{Ce.push(Se(e.contentDocument))}catch(e){console.warn(e)}}));var Ae=function(){gt(),Ce.push(Se(document)),kt=!0};return"interactive"===document.readyState||"complete"===document.readyState?Ae():(Ce.push(Y("DOMContentLoaded",(function(){pt(It({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===q&&Ae()}))),Ce.push(Y("load",(function(){pt(It({type:ye.Load,data:{}})),"load"===q&&Ae()}),window))),function(){Ce.forEach((function(e){return e()})),ke.destroy(),kt=!1,Ne()}}catch(e){console.warn(e)}}Ct.addCustomEvent=function(e,t){if(!kt)throw new Error("please add custom event after start recording");pt(It({type:ye.Custom,data:{tag:e,payload:t}}))},Ct.freezePage=function(){De.forEach((function(e){return e.freeze()}))},Ct.takeFullSnapshot=function(e){if(!kt)throw new Error("please take full snapshot after start recording");gt(e)},Ct.mirror=wt;var St=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),At=/(^|@)\S+:\d+/,Et=/^\s*at .*(\S+:\d+|\(native\))/m,Rt=/^(eval@)?(\[native code])?$/,Mt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Et)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Et)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new St({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new St({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new St({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new St({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Tt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Ft(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Ft(e[i])&&xt(e[i],t-1))return!0}return!1}function Ot(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ft(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ft(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Tt(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Nt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Lt(e,t,n){var r,i=n?Object.assign({},Nt,n):Nt,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=Mt.parse(r).map((function(e){return e.toString()})),a=[Ot(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((function(){t.removeEventListener("error",l)}));var c=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Ot("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Ot("Uncaught (in promise)",i.stringifyOptions),Ot(t.reason,i.stringifyOptions)]);var o=Mt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",c),u.push((function(){t.removeEventListener("unhandledrejection",c)}))}var d,f=g(i.level);try{for(f.s();!(d=f.n()).done;){var h=d.value;u.push(p(r,h))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function p(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(r,u),!s){s=!0;try{var c=Mt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Ot(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Ot("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Dt=Array.isArray,Pt=Object.prototype,Bt=Pt.hasOwnProperty,qt=Pt.toString,Wt=Dt||function(e){return"[object Array]"===qt.call(e)},Gt=function(e){return"function"==typeof e},Ut=function(e){return e===Object(e)&&!Wt(e)},Ht=function(e){if(Ut(e)){for(var t in e)if(Bt.call(e,t))return!1;return!0}return!1},Vt=function(e){return void 0===e},$t=function(e){return"[object String]"==qt.call(e)},jt=function(e){return null===e},Zt=function(e){return Vt(e)||jt(e)},Kt=function(e){return"[object Number]"==qt.call(e)},zt=function(e){return"[object Boolean]"===qt.call(e)},Yt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},Qt={DEBUG:!1,LIB_VERSION:"1.136.1"},Xt="undefined"!=typeof window?window:void 0,en="undefined"!=typeof globalThis?globalThis:Xt,tn=Array.prototype,nn=tn.forEach,rn=tn.indexOf,on=null==en?void 0:en.navigator,an=null==en?void 0:en.document,sn=null==en?void 0:en.location,un=null==en?void 0:en.fetch,ln=null!=en&&en.XMLHttpRequest&&"withCredentials"in new en.XMLHttpRequest?en.XMLHttpRequest:void 0,cn=null==en?void 0:en.AbortController,dn=null==on?void 0:on.userAgent,fn=null!=Xt?Xt:{},hn="[PostHog.js]",pn={_log:function(e){if(Xt&&(Qt.DEBUG||fn.POSTHOG_DEBUG)&&!Vt(Xt.console)&&Xt.console){for(var t=("__rrweb_original__"in Xt.console[e]?Xt.console[e].__rrweb_original__:Xt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[hn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[hn].concat(n))},uninitializedWarning:function(e){pn.error("You must initialize PostHog before calling ".concat(e))}},gn={},vn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function mn(e,t,n){if(Wt(e))if(nn&&e.forEach===nn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===gn)return}function yn(e,t,n){if(!Zt(e)){if(Wt(e))return mn(e,t,n);if(Jt(e)){var r,i=g(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===gn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(Bt.call(e,a)&&t.call(n,e[a],a)===gn)return}}var _n=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 mn(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function bn(e,t){return-1!==e.indexOf(t)}function In(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var kn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},wn=function(e){try{return e()}catch(e){return}},Cn=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){pn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),pn.critical(e)}}},Sn=function(e){var t={};return yn(e,(function(e,n){$t(e)&&e.length>0&&(t[n]=e)})),t};function An(e,t){return n=e,r=function(e){return $t(e)&&!jt(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),Wt(t)?(o=[],mn(t,(function(t){o.push(e(t))}))):(o={},yn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var En=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),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),jt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Rn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==Xt?void 0:Xt.event)){var o,a=!0;Gt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else pn.error("No valid element provided to register_event")}}();function Mn(e,t){var n=function(){if(!an)return t("document not found");var n=an.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=an.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):an.body.appendChild(n)};null!=an&&an.body?n():null==an||an.addEventListener("DOMContentLoaded",n)}function Tn(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Fn=["localhost","127.0.0.1"],xn=function(e){var t=null==an?void 0:an.createElement("a");return Vt(t)?null:(t.href=e,t)},On=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},Nn=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return yn(e,(function(e,r){Vt(e)||Vt(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Ln=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!Wt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){pn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Dn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Pn(e){return e?vn(e).split(/\s+/):[]}function Bn(e){var t="";switch(r(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Pn(t)}function qn(e){return Zt(e)?null:vn(e).split(/(\s+)/).filter((function(e){return nr(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wn(e){var t="";return Kn(e)&&!zn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;Hn(e)&&e.textContent&&(t+=null!==(n=qn(e.textContent))&&void 0!==n?n:"")})),vn(t)}function Gn(e){return!!e&&1===e.nodeType}function Un(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Hn(e){return!!e&&3===e.nodeType}function Vn(e){return!!e&&11===e.nodeType}var $n=["a","button","form","input","select","textarea","label"];function jn(e){var t=e.parentNode;return!(!t||!Gn(t))&&t}function Zn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!Xt||!e||Un(e,"html")||!Gn(e))return!1;if(null!=n&&n.url_allowlist){var a=Xt.location.href,s=n.url_allowlist;if(s&&!s.some((function(e){return a.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var l=!1,c=[e],d=!0,f=e;f.parentNode&&!Un(f,"body");)if(Vn(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=jn(f)))break;if(i||$n.indexOf(d.tagName.toLowerCase())>-1)l=!0;else{var h=Xt.getComputedStyle(d);h&&"pointer"===h.getPropertyValue("cursor")&&(l=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Vt(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(c,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Vt(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(c,n))return!1;var p=Xt.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return l?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&($n.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function Kn(e){for(var t=e;t.parentNode&&!Un(t,"body");t=t.parentNode){var n=Bn(t);if(bn(n,"ph-sensitive")||bn(n,"ph-no-capture"))return!1}if(bn(Bn(e),"ph-include"))return!0;var r=e.type||"";if($t(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if($t(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function zn(e){return!!(Un(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Un(e,"select")||Un(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Yn="(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})",Jn=new RegExp("^(?:".concat(Yn,")$")),Qn=new RegExp(Yn),Xn="\\d{3}-?\\d{2}-?\\d{4}",er=new RegExp("^(".concat(Xn,")$")),tr=new RegExp("(".concat(Xn,")"));function nr(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zt(e))return!1;if($t(e)){if(e=vn(e),(t?Jn:Qn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?er:tr).test(e))return!1}return!0}function rr(e){var t=Wn(e);return nr(t="".concat(t," ").concat(ir(e)).trim())?t:""}function ir(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Wn(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ir(e)).trim())}catch(e){pn.error(e)}})),t}function or(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=g(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return In(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return l[ar(n.toString())]=ar(r.toString())})),i+=":",i+=In(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:sr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return In(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function ar(e){return e.replace(/"|\\"/g,'\\"')}function sr(e){var t=e.attr__class;return t?Wt(t)?t:Pn(t):void 0}var ur="[SessionRecording]",lr="redacted",cr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},dr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],fr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],hr=["/s/","/e/","/i/"];function pr(e,t,n,r){if(Zt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return $t(i)&&(i=parseInt(i)),i>n?ur+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function gr(e,t){if(Zt(e))return e;var n=e;return nr(n,!1)||(n=ur+" "+t+" body "+lr),yn(fr,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=ur+" "+t+" body "+lr+" as might contain: "+e)})),n}var vr=function(e,n){var r,i,o,a={payloadSizeLimitBytes:cr.payloadSizeLimitBytes,performanceEntryTypeToObserve:f(cr.performanceEntryTypeToObserve)},s=!1!==e.session_recording.recordHeaders&&n.recordHeaders,u=!1!==e.session_recording.recordBody&&n.recordBody,l=!1!==e.capture_performance&&n.recordPerformance,c=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=pr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=pr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return c(function(e){var t=xn(e.name);if(!(t&&t.pathname&&hr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((n=(t=e).requestHeaders,Zt(n)||yn(Object.keys(null!=n?n:{}),(function(e){dr.includes(e.toLowerCase())&&(n[e]=lr)})),t)));var t,n},h=Gt(e.session_recording.maskNetworkRequestFn);return h&&Gt(e.session_recording.maskCapturedNetworkRequestFn)&&pn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=Gt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!Vt(e))return e.requestBody=gr(e.requestBody,"Request"),e.responseBody=gr(e.responseBody,"Response"),e}(d(e))},t(t(t({},cr),a),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})},mr=function(e){return"navigation"===e.entryType},yr=function(e){return"resource"===e.entryType};function _r(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return Gt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r},__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function br(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function Ir(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return mr(e)||yr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return mr(e)||yr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function kr(e,t){return!!t&&(zt(t)||t[e])}function wr(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(zt(t))return!0;if(Wt(t))return r(t);var i=t[e];return zt(i)?i:r(i)}function Cr(e,t,n,r,i){return Sr.apply(this,arguments)}function Sr(){return Sr=o(n().mark((function e(t,r,i,o,a){var s,u,l,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=c.length>5&&void 0!==c[5]?c[5]:0)>10)){e.next=4;break}return pn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),l=br(u,(function(e){return yr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",Cr(t,r,i,o,a,s+1));case 10:return e.abrupt("return",l);case 11:case"end":return e.stop()}}),e)}))),Sr.apply(this,arguments)}function Ar(e){if(Zt(e))return null;if($t(e))return e;if(Yt(e))return e.textContent;if(Jt(e))return Nn(e);if(Ut(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Er=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Rr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(Er(e)){var l,c=g(e.serverTiming||[]);try{for(c.s();!(l=c.n()).done;){var d=l.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){c.e(e)}finally{c.f()}}return u}var Mr=["video/","audio/"];function Tr(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Mr.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Fr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function xr(e){return Or.apply(this,arguments)}function Or(){return(Or=o(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Tr(t),jt(r)){e.next=3;break}return e.abrupt("return",Promise.resolve(r));case 3:return e.abrupt("return",Fr(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nr(e,r,i){if(!("performance"in r))return function(){};var a=i?Object.assign({},cr,i):cr,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=Ir(s,r,a),l=function(){},c=function(){};return(a.recordHeaders||a.recordBody)&&(l=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=kr("request",n.recordHeaders),i=kr("response",n.recordHeaders),o=_r(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,h=this,p=new Request(s),g={},v={},m=h.setRequestHeader.bind(h);h.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=h.send.bind(h);h.send=function(e){return wr("request",n.recordBody,v)&&(Vt(e)||jt(e)?g.requestBody=null:g.requestBody=Ar(e)),u=t.performance.now(),y(e)},h.addEventListener("readystatechange",(function(){if(h.readyState===h.DONE){l=t.performance.now();var r={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),wr("response",n.recordBody,r)&&(Zt(h.response)?g.responseBody=null:g.responseBody=Ar(h.response)),Cr(t,"xmlhttprequest",p.url,u,l).then((function(t){if(!jt(t)){var n=Rr(t,p.method,null==h?void 0:h.status,g);e({requests:n})}})).catch((function(){}))}})),o.call(h,a,s,c,d,f)}}));return function(){o()}}(s,r,a),c=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=kr("request",r.recordHeaders),a=kr("response",r.recordHeaders),s=_r(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,l){var c,d,f,h,p,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=new Request(u,l),f={},n.prev=2,g={},c.headers.forEach((function(e,t){g[t]=e})),i&&(f.requestHeaders=g),!wr("request",r.recordBody,g)){n.next=10;break}return n.next=9,Fr(c);case 9:f.requestBody=n.sent;case 10:return h=t.performance.now(),n.next=13,s(c);case 13:if(d=n.sent,p=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(f.responseHeaders=v),!wr("response",r.recordBody,v)){n.next=22;break}return n.next=21,xr(d);case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Cr(t,"fetch",c.url,h,p).then((function(t){var n;if(!jt(t)){var r=Rr(t,c.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),function(){u(),l(),c()}}var Lr;Xt&&(Xt.rrweb={record:Ct,version:"v2",rrwebVersion:"2.0.0-alpha.13"},Xt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Lt,options:e}}},Xt.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Nr,options:e}}),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Lr||(Lr={}));var Dr="$people_distinct_id",Pr="__alias",Br="__timers",qr="$autocapture_disabled_server_side",Wr="$heatmaps_enabled_server_side",Gr="$session_recording_enabled_server_side",Ur="$console_log_recording_enabled_server_side",Hr="$session_recording_network_payload_capture",Vr="$session_recording_canvas_recording",$r="$replay_sample_rate",jr="$replay_minimum_duration",Zr="$sesid",Kr="$session_is_sampled",zr="$enabled_feature_flags",Yr="$early_access_features",Jr="$stored_person_properties",Qr="$stored_group_properties",Xr="$surveys",ei="$flag_call_reported",ti="$user_state",ni="$client_session_props",ri="$capture_rate_limit",ii="$initial_campaign_params",oi="$initial_referrer_info",ai="$epp",si="__POSTHOG_TOOLBAR__",ui=[Dr,Pr,"__cmpns",Br,Gr,Wr,Zr,zr,ti,Yr,Qr,Jr,Xr,ei,ni,ri,ii,oi,ai],li="$active_feature_flags",ci="$override_feature_flags",di="$feature_flag_payloads",fi=function(e){var t,n={},r=g(In(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},hi=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(zr),t=this.instance.get_property(ci);if(!t)return e||{};for(var n=_n({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(pn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(di)||{}}},{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;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Jr),r=this.instance.get_property(Qr),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:Lr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(ei)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Wt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(l({},ei,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}pn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{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]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);pn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(Wt(a)){var u,c={};if(a)for(var d=0;d<a.length;d++)c[a[d]]=!0;n&&n.register((l(u={},li,a),l(u,zr,c),u))}else{var f=a,h=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),h=t(t({},o),h)),n&&n.register((l(r={},li,Object.keys(fi(f))),l(r,zr,f||{}),l(r,di,h||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return pn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ci);else if(Wt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(l({},ci,t))}else this.instance.persistence.register(l({},ci,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=l({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},l({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((l(i={},li,Object.keys(fi(a))),l(i,zr,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Yr);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Yr,i)),e(i)}}})}},{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}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Jr)||{};this.instance.register(l({},Jr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Jr)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Qr)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(l({},Qr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(Qr)||{};this.instance.register(l({},Qr,t(t({},n),{},l({},e,{}))))}else this.instance.unregister(Qr)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Kt(e)&&isFinite(e)&&Math.floor(e)===e});var pi="0123456789abcdef",gi=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+pi.charAt(this.bytes[t]>>>4)+pi.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),vi=function(){function e(){a(this,e),l(this,"timestamp",0),l(this,"counter",0),l(this,"random",new _i)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Vt(e)){this.timestamp=0;var t=this.generateOrAbort();if(Vt(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return gi.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),mi=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Xt&&!Vt(Xt.crypto)&&crypto.getRandomValues&&(mi=function(e){return crypto.getRandomValues(e)});var yi,_i=function(){function e(){a(this,e),l(this,"buffer",new Uint32Array(8)),l(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(mi(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),bi=function(){return Ii().toString()},Ii=function(){return(yi||(yi=new vi)).generate()},ki="Thu, 01 Jan 1970 00:00:00 GMT",wi="";var Ci=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Si(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:an;if(wi)return wi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+bi(),o=new RegExp("(^|;)\\s*"+i+"=1");!wi&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+ki,wi=a)}return wi}(e);if(!n){var r=function(e){var t=e.match(Ci);return t?t[0]:""}(e);r!==n&&pn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ai,Ei={is_supported:function(){return!!an},error:function(e){pn.error("cookieStore error: "+e)},get:function(e){if(an){try{for(var t=e+"=",n=an.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(Ei.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(an)try{var o="",a="",s=Si(an.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&pn.warn("cookieStore warning: large cookie, len="+l.length),an.cookie=l,l}catch(e){return}},remove:function(e,t){try{Ei.set(e,"",-1,t)}catch(e){return}}},Ri=null,Mi={is_supported:function(){if(!jt(Ri))return Ri;var e=!0;if(Vt(Xt))e=!1;else try{var t="__mplssupport__";Mi.set(t,"xyz"),'"xyz"'!==Mi.get(t)&&(e=!1),Mi.remove(t)}catch(t){e=!1}return e||pn.error("localStorage unsupported; falling back to cookie store"),Ri=e,e},error:function(e){pn.error("localStorage error: "+e)},get:function(e){try{return null==Xt?void 0:Xt.localStorage.getItem(e)}catch(e){Mi.error(e)}return null},parse:function(e){try{return JSON.parse(Mi.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Xt||Xt.localStorage.setItem(e,JSON.stringify(t))}catch(e){Mi.error(e)}},remove:function(e){try{null==Xt||Xt.localStorage.removeItem(e)}catch(e){Mi.error(e)}}},Ti=["distinct_id",Zr,Kr,ai],Fi=t(t({},Mi),{},{parse:function(e){try{var t={};try{t=Ei.parse(e)||{}}catch(e){}var n=_n(t,JSON.parse(Mi.get(e)||"{}"));return Mi.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{Mi.set(e,t);var o={};Ti.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Ei.set(e,o,n,r,i)}catch(e){Mi.error(e)}},remove:function(e,t){try{null==Xt||Xt.localStorage.removeItem(e),Ei.remove(e,t)}catch(e){Mi.error(e)}}}),xi={},Oi={is_supported:function(){return!0},error:function(e){pn.error("memoryStorage error: "+e)},get:function(e){return xi[e]||null},parse:function(e){return xi[e]||null},set:function(e,t){xi[e]=t},remove:function(e){delete xi[e]}},Ni=null,Li={is_supported:function(){if(!jt(Ni))return Ni;if(Ni=!0,Vt(Xt))Ni=!1;else try{var e="__support__";Li.set(e,"xyz"),'"xyz"'!==Li.get(e)&&(Ni=!1),Li.remove(e)}catch(e){Ni=!1}return Ni},error:function(e){pn.error("sessionStorage error: ",e)},get:function(e){try{return null==Xt?void 0:Xt.sessionStorage.getItem(e)}catch(e){Li.error(e)}return null},parse:function(e){try{return JSON.parse(Li.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Xt||Xt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Li.error(e)}},remove:function(e){try{null==Xt||Xt.sessionStorage.removeItem(e)}catch(e){Li.error(e)}}},Di="Mobile",Pi="iOS",Bi="Android",qi="Tablet",Wi=Bi+" "+qi,Gi="iPad",Ui="Apple",Hi=Ui+" Watch",Vi="Safari",$i="BlackBerry",ji="Samsung",Zi=ji+"Browser",Ki=ji+" Internet",zi="Chrome",Yi=zi+" OS",Ji=zi+" "+Pi,Qi="Internet Explorer",Xi=Qi+" "+Di,eo="Opera",to=eo+" Mini",no="Edge",ro="Microsoft "+no,io="Firefox",oo=io+" "+Pi,ao="Nintendo",so="PlayStation",uo="Xbox",lo=Bi+" "+Di,co=Di+" "+Vi,fo="Windows",ho=fo+" Phone",po="Nokia",go="Ouya",vo="Generic",mo=vo+" "+Di.toLowerCase(),yo=vo+" "+qi.toLowerCase(),_o="Konqueror",bo="(\\d+(\\.\\d+)?)",Io=new RegExp("Version/"+bo),ko=new RegExp(uo,"i"),wo=new RegExp(so+" \\w+","i"),Co=new RegExp(ao+" \\w+","i"),So=new RegExp($i+"|PlayBook|BB10","i"),Ao={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Eo=function(e,t){return t&&bn(t,Ui)||function(e){return bn(e,Vi)&&!bn(e,zi)&&!bn(e,Bi)}(e)},Ro=function(e,t){return t=t||"",bn(e," OPR/")&&bn(e,"Mini")?to:bn(e," OPR/")?eo:So.test(e)?$i:bn(e,"IE"+Di)||bn(e,"WPDesktop")?Xi:bn(e,Zi)?Ki:bn(e,no)||bn(e,"Edg/")?ro:bn(e,"FBIOS")?"Facebook "+Di:bn(e,"UCWEB")||bn(e,"UCBrowser")?"UC Browser":bn(e,"CriOS")?Ji:bn(e,"CrMo")?zi:bn(e,Bi)&&bn(e,Vi)?lo:bn(e,zi)?zi:bn(e,"FxiOS")?oo:bn(e.toLowerCase(),_o.toLowerCase())?_o:Eo(e,t)?bn(e,Di)?co:Vi:bn(e,io)?io:bn(e,"MSIE")||bn(e,"Trident/")?Qi:bn(e,"Gecko")?io:""},Mo=(l(Ai={},Xi,[new RegExp("rv:"+bo)]),l(Ai,ro,[new RegExp(no+"?\\/"+bo)]),l(Ai,zi,[new RegExp("("+zi+"|CrMo)\\/"+bo)]),l(Ai,Ji,[new RegExp("CriOS\\/"+bo)]),l(Ai,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+bo)]),l(Ai,Vi,[Io]),l(Ai,co,[Io]),l(Ai,eo,[new RegExp("(Opera|OPR)\\/"+bo)]),l(Ai,io,[new RegExp(io+"\\/"+bo)]),l(Ai,oo,[new RegExp("FxiOS\\/"+bo)]),l(Ai,_o,[new RegExp("Konqueror[:/]?"+bo,"i")]),l(Ai,$i,[new RegExp($i+" "+bo),Io]),l(Ai,lo,[new RegExp("android\\s"+bo,"i")]),l(Ai,Ki,[new RegExp(Zi+"\\/"+bo)]),l(Ai,Qi,[new RegExp("(rv:|MSIE )"+bo)]),l(Ai,"Mozilla",[new RegExp("rv:"+bo)]),Ai),To=[[new RegExp(uo+"; "+uo+" (.*?)[);]","i"),function(e){return[uo,e&&e[1]||""]}],[new RegExp(ao,"i"),[ao,""]],[new RegExp(so,"i"),[so,""]],[So,[$i,""]],[new RegExp(fo,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[ho,""];if(new RegExp(Di).test(t)&&!/IEMobile\b/.test(t))return[fo+" "+Di,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Ao[r]||"";return/arm/i.test(t)&&(i="RT"),[fo,i]}return[fo,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Pi,t.join(".")]}return[Pi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Vt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Bi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Bi+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Bi,t.join(".")]}return[Bi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Yi,""]],[/Linux|debian/i,["Linux",""]]],Fo=function(e){return Co.test(e)?ao:wo.test(e)?so:ko.test(e)?uo:new RegExp(go,"i").test(e)?go:new RegExp("("+ho+"|WPDesktop)","i").test(e)?ho:/iPad/.test(e)?Gi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Hi:So.test(e)?$i:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(po,"i").test(e)?po:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Di).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Bi:Wi:Bi:new RegExp("(pda|"+Di+")","i").test(e)?mo:new RegExp(qi,"i").test(e)&&!new RegExp(qi+" pc","i").test(e)?yo:""},xo="https?://(.*)",Oo=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],No={campaignParams:function(e){var t=Oo.concat(e||[]),n={};return yn(t,(function(e){var t=an?Ln(an.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==an?void 0:an.referrer;return e?0===e.search(xo+"google.([^/?]*)")?"google":0===e.search(xo+"bing.com")?"bing":0===e.search(xo+"yahoo.com")?"yahoo":0===e.search(xo+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=No.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!jt(e)){n.$search_engine=e;var r=an?Ln(an.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:Ro,browserVersion:function(e,t){var n=Ro(e,t),r=Mo[n];if(Vt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<To.length;t++){var n=d(To[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(Gt(i)?i(o,e):i);if(a)return a}return["",""]},device:Fo,deviceType:function(e){var t=Fo(e);return t===Gi||t===Wi||"Kobo"===t||"Kindle Fire"===t||t===yo?qi:t===ao||t===uo||t===so||t===go?"Console":t===Hi?"Wearable":t?Di:"Desktop"},referrer:function(){return(null==an?void 0:an.referrer)||"$direct"},referringDomain:function(){var e;return null!=an&&an.referrer&&(null===(e=xn(an.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},properties:function(){if(!dn)return{};var e=d(No.os(dn),2),t=e[0],n=e[1];return _n(Sn({$os:t,$os_version:n,$browser:No.browser(dn,navigator.vendor),$device:No.device(dn),$device_type:No.deviceType(dn)}),{$current_url:null==sn?void 0:sn.href,$host:null==sn?void 0:sn.host,$pathname:null==sn?void 0:sn.pathname,$raw_user_agent:dn.length>1e3?dn.substring(0,997)+"...":dn,$browser_version:No.browserVersion(dn,navigator.vendor),$browser_language:No.browserLanguage(),$screen_height:null==Xt?void 0:Xt.screen.height,$screen_width:null==Xt?void 0:Xt.screen.width,$viewport_height:null==Xt?void 0:Xt.innerHeight,$viewport_width:null==Xt?void 0:Xt.innerWidth,$lib:"web",$lib_version:Qt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:kn()/1e3})},people_properties:function(){if(!dn)return{};var e=d(No.os(dn),2),t=e[0],n=e[1];return _n(Sn({$os:t,$os_version:n,$browser:No.browser(dn,navigator.vendor)}),{$browser_version:No.browserVersion(dn,navigator.vendor)})}},Lo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Do=function(){function e(t){a(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===Lo.indexOf(e.persistence.toLowerCase())&&(pn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Mi.is_supported()?Mi:"localstorage+cookie"===t&&Fi.is_supported()?Fi:"sessionstorage"===t&&Li.is_supported()?Li:"memory"===t?Oi:"cookie"===t?Ei:Fi.is_supported()?Fi:Ei}},{key:"properties",value:function(){var e={};return yn(this.props,(function(t,n){if(n===zr&&Ut(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(jt(o=ui)?s:rn&&o.indexOf===rn?-1!=o.indexOf(a):(yn(o,(function(e){if(s||(s=e===a))return gn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=_n({},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(Ut(e)){Vt(t)&&(t="None"),this.expire_days=Vt(n)?this.default_expiry:n;var i=!1;if(yn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Ut(e)){this.expire_days=Vt(t)?this.default_expiry:t;var r=!1;if(yn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=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(No.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"set_initial_campaign_params",value:function(){this.register_once(l({},ii,No.campaignParams(this.config.custom_campaign_params)),void 0)}},{key:"update_search_keyword",value:function(){this.register(No.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(No.referrerInfo())}},{key:"set_initial_referrer_info",value:function(){this.register_once(l({},oi,No.referrerInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Sn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};return yn([oi,ii],(function(n){var r=e.props[n];r&&yn(r,(function(e,n){var r;t["$initial_"+(r=n,r.replace(/^\$/,""))]=e}))})),t}},{key:"safe_merge",value:function(e){return yn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(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),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{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[Br]||{};n[e]=t,this.props[Br]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Br]||{})[e];return Vt(t)||(delete this.props[Br][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}(),Po=2,Bo=4;var qo,Wo=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),l(this,"bucketSize",100),l(this,"refillRate",10),l(this,"mutationBuckets",{}),l(this,"loggedTracker",{}),l(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),l(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),l(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),l(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Go=function(e){return 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",e}(Go||{}),Uo=3e5,Ho=Uo;!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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(qo||(qo={}));var Vo,$o=[qo.MouseMove,qo.MouseInteraction,qo.Scroll,qo.ViewportResize,qo.Input,qo.TouchMove,qo.MediaInteraction,qo.Drag],jo=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},Zo="[SessionRecording]",Ko=function(){function e(t){var n=this;if(a(this,e),l(this,"queuedRRWebEvents",[]),l(this,"isIdle",!1),l(this,"_linkedFlagSeen",!1),l(this,"_lastActivityTimestamp",Date.now()),l(this,"windowId",null),l(this,"sessionId",null),l(this,"_linkedFlag",null),l(this,"_forceAllowLocalhostNetworkCapture",!1),l(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==Xt||Xt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==Xt||Xt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==Xt||Xt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==Xt||Xt.addEventListener("visibilitychange",(function(){if(null!=an&&an.visibilityState){var e="window "+an.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw pn.error(Zo+" started without valid sessionManager"),new Error(Zo+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer(),this._setupSampling()}return u(e,[{key:"rrwebRecord",get:function(){var e;return null==fn||null===(e=fn.rrweb)||void 0===e?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw pn.error(Zo+" started without valid sessionManager"),new Error(Zo+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){var e=this.instance.get_property(Kr);return zt(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Gr),t=!this.instance.config.disable_session_recording;return Xt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ur),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(Vr);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Hr),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property($r);return Kt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(jr);return Kt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Zt(this._linkedFlag)||this._linkedFlagSeen?zt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),pn.info(Zo+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,pn.info(Zo+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Kt(r)){var i,o=this.isSampled,a=n||!zt(o);if(a)i=Math.random()<r;else i=o;!i&&a&&pn.warn(Zo+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),null===(t=this.instance.persistence)||void 0===t||t.register(l({},Kr,i))}else{var s;null===(s=this.instance.persistence)||void 0===s||s.register(l({},Kr,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i=this;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!Zt(this._linkedFlag)){var o=$t(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=$t(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=Ut(t)&&o in t,r=a?t[o]===a:n;if(r){var s={linkedFlag:o,linkedVariant:a},u="linked flag matched";pn.info(Zo+" "+u,s),i._tryAddCustomEvent(u,s)}i._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Kt(this.sampleRate)&&jt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var n=this.instance.persistence,r=function(){var r,i,o,a,s,u,c,d,f=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,h=Zt(f)?null:parseFloat(f),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register((l(d={},Gr,!!e.sessionRecording),l(d,Ur,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),l(d,Hr,t({capturePerformance:e.capturePerformance},null===(a=e.sessionRecording)||void 0===a?void 0:a.networkPayloadCapture)),l(d,Vr,{enabled:null===(s=e.sessionRecording)||void 0===s?void 0:s.recordCanvas,fps:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),l(d,$r,h),l(d,jr,Vt(p)?null:p),d))};r(),this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:kn()})}},{key:"_startCapture",value:function(){var e=this;Vt(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():Mn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(Qt.LIB_VERSION)),(function(t){if(t)return pn.error(Zo+" could not load recorder.js",t);e._onScriptLoaded()})))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==$o.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>Ho&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:Ho}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Po,Bo].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):pn.warn(Zo+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(jo((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(jo((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],l=s[1];u in r&&(r[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Wo(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");pn.info(r,{node:t}),n.log(Zo+" "+r,"warn")}}),this._scheduleFullSnapshot();var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:c},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=Xt?n._maskUrl(Xt.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t}),n._tryTakeFullSnapshot()}}catch(e){pn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:c.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else pn.error(Zo+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),Uo)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(fn.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(fn.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Gt(fn.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(fn.getRecordNetworkPlugin(vr(this.instance.config,this.networkPayloadCapture))):pn.info(Zo+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Ut(e)){if(e.type===Go.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Go.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Ut(t)&&6===t.type&&Ut(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Go.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&Xt){var e=this._maskUrl(Xt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=Kt(n)&&n>=0,i=Kt(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),jt(this.buffer.sessionId)&&!jt(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),e}(),zo=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Jr),group_properties:this.instance.get_property(Qr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:Lr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)pn.error("Failed to fetch feature flags from PostHog.");else{if(!an||!an.body)return pn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){t.parseDecideResponse(e)}),500);this.instance._afterDecideResponse(e);var r=null==Xt?void 0:Xt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Vt(r)&&Mn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(n){if(n)return pn.error("Could not load exception autocapture script",n);Xt.extendPostHogWithExceptionAutocapture(t.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var i,o=g(e.siteApps);try{var a=function(){var e=i.value,n=e.id,r=e.url,o=t.instance.requestRouter.endpointFor("api",r);fn["__$$ph_site_app_".concat(n)]=t.instance,Mn(o,(function(e){e&&pn.error("Error while initializing PostHog app with config id ".concat(n),e)}))};for(o.s();!(i=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}else e.siteApps.length>0&&pn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),Yo=null!=Xt&&Xt.location?Dn(Xt.location.hash,"__posthog")||Dn(location.hash,"state"):null,Jo="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Vo||(Vo={}));var Qo=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"setToolbarState",value:function(e){fn.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=fn.ph_toolbar_state)&&void 0!==e?e:Vo.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Xt||!an)return!1;n=null!==(e=n)&&void 0!==e?e:Xt.location,i=null!==(t=i)&&void 0!==t?t:Xt.history;try{if(!r){try{Xt.localStorage.setItem("test","test"),Xt.localStorage.removeItem("test")}catch(e){return!1}r=null==Xt?void 0:Xt.localStorage}var o,a=Yo||Dn(n.hash,"__posthog")||Dn(n.hash,"state"),s=a?wn((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||wn((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(Jo)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){(fn.ph_load_toolbar||fn.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var n=this,r=!(null==an||!an.getElementById(si));if(!Xt||r)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Xt.localStorage.setItem(Jo,JSON.stringify(t(t({},o),{},{source:void 0}))),this.getToolbarState()===Vo.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===Vo.UNINITIALIZED){this.setToolbarState(Vo.LOADING);var a=3e5,s=Math.floor(Date.now()/a)*a;Mn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(s)),(function(e){if(e)return pn.error("Failed to load toolbar",e),void n.setToolbarState(Vo.UNINITIALIZED);n.setToolbarState(Vo.LOADED),n._callLoadToolbar(o)})),Rn(Xt,"turbolinks:load",(function(){n.setToolbarState(Vo.UNINITIALIZED),n.loadToolbar(o)}))}return!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]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Xo=function(){function e(t){a(this,e),l(this,"isPaused",!0),l(this,"queue",[]),l(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&Wt(r.data)&&yn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return yn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Vt(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),ea=Uint8Array,ta=Uint16Array,na=Uint32Array,ra=new ea([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]),ia=new ea([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]),oa=new ea([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aa=function(e,t){for(var n=new ta(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new na(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},sa=aa(ra,2),ua=sa[0],la=sa[1];ua[28]=258,la[258]=28;for(var ca=aa(ia,0)[1],da=new ta(32768),fa=0;fa<32768;++fa){var ha=(43690&fa)>>>1|(21845&fa)<<1;ha=(61680&(ha=(52428&ha)>>>2|(13107&ha)<<2))>>>4|(3855&ha)<<4,da[fa]=((65280&ha)>>>8|(255&ha)<<8)>>>1}var pa=function(e,t,n){for(var r=e.length,i=0,o=new ta(t);i<r;++i)++o[e[i]-1];var a,s=new ta(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ta(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[da[d]>>>u]=l}else for(a=new ta(r),i=0;i<r;++i)a[i]=da[s[e[i]-1]++]>>>15-e[i];return a},ga=new ea(288);for(fa=0;fa<144;++fa)ga[fa]=8;for(fa=144;fa<256;++fa)ga[fa]=9;for(fa=256;fa<280;++fa)ga[fa]=7;for(fa=280;fa<288;++fa)ga[fa]=8;var va=new ea(32);for(fa=0;fa<32;++fa)va[fa]=5;var ma=pa(ga,9,0),ya=pa(va,5,0),_a=function(e){return(e/8>>0)+(7&e&&1)},ba=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ta?ta:e instanceof na?na:ea)(n-t);return r.set(e.subarray(t,n)),r},Ia=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},ka=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},wa=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new ea(0),0];if(1==i){var a=new ea(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],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var h=new ta(f+1),p=Ca(n[c-1],h,0);if(p>t){r=0;var g=0,v=p-t,m=1<<v;for(o.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(h[y]>t))break;g+=m-(1<<p-h[y]),h[y]=t}for(g>>>=v;g>0;){var _=o[r].s;h[_]<t?g-=1<<t-h[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;h[b]==t&&(--h[b],++g)}p=t}return[new ea(h),p]},Ca=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},Sa=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ta(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Aa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ea=function(e,t,n){var r=n.length,i=_a(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ra=function(e,t,n,r,i,o,a,s,u,l,c){Ia(t,c++,n),++i[256];for(var d=wa(i,15),f=d[0],h=d[1],p=wa(o,15),g=p[0],v=p[1],m=Sa(f),y=m[0],_=m[1],b=Sa(g),I=b[0],k=b[1],w=new ta(19),C=0;C<y.length;++C)w[31&y[C]]++;for(C=0;C<I.length;++C)w[31&I[C]]++;for(var S=wa(w,7),A=S[0],E=S[1],R=19;R>4&&!A[oa[R-1]];--R);var M,T,F,x,O=l+5<<3,N=Aa(i,ga)+Aa(o,va)+a,L=Aa(i,f)+Aa(o,g)+a+14+3*R+Aa(w,A)+(2*w[16]+3*w[17]+7*w[18]);if(O<=N&&O<=L)return Ea(t,c,e.subarray(u,u+l));if(Ia(t,c,1+(L<N)),c+=2,L<N){M=pa(f,h,0),T=f,F=pa(g,v,0),x=g;var D=pa(A,E,0);Ia(t,c,_-257),Ia(t,c+5,k-1),Ia(t,c+10,R-4),c+=14;for(C=0;C<R;++C)Ia(t,c+3*C,A[oa[C]]);c+=3*R;for(var P=[y,I],B=0;B<2;++B){var q=P[B];for(C=0;C<q.length;++C){var W=31&q[C];Ia(t,c,D[W]),c+=A[W],W>15&&(Ia(t,c,q[C]>>>5&127),c+=q[C]>>>12)}}}else M=ma,T=ga,F=ya,x=va;for(C=0;C<s;++C)if(r[C]>255){W=r[C]>>>18&31;ka(t,c,M[W+257]),c+=T[W+257],W>7&&(Ia(t,c,r[C]>>>23&31),c+=ra[W]);var G=31&r[C];ka(t,c,F[G]),c+=x[G],G>3&&(ka(t,c,r[C]>>>5&8191),c+=ia[G])}else ka(t,c,M[r[C]]),c+=T[r[C]];return ka(t,c,M[256]),c+T[256]},Ma=new na([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ta=new ea(0),Fa=function(){for(var e=new na(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),xa=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new ea(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=Ea(u,l,e.subarray(c,d)):(u[c]=o,l=Ea(u,l,e.subarray(c,a)))}else{for(var f=Ma[t-1],h=f>>>13,p=8191&f,g=(1<<n)-1,v=new ta(32768),m=new ta(g+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&g},I=new na(25e3),k=new ta(288),w=new ta(32),C=0,S=0,A=(c=0,0),E=0,R=0;c<a;++c){var M=b(c),T=32767&c,F=m[M];if(v[T]=F,m[M]=T,E<=c){var x=a-c;if((C>7e3||A>24576)&&x>423){l=Ra(e,u,0,I,k,w,S,A,R,c-R,l),A=C=S=0,R=c;for(var O=0;O<286;++O)k[O]=0;for(O=0;O<30;++O)w[O]=0}var N=2,L=0,D=p,P=T-F&32767;if(x>2&&M==b(c-P))for(var B=Math.min(h,x)-1,q=Math.min(32767,c),W=Math.min(258,x);P<=q&&--D&&T!=F;){if(e[c+N]==e[c+N-P]){for(var G=0;G<W&&e[c+G]==e[c+G-P];++G);if(G>N){if(N=G,L=P,G>B)break;var U=Math.min(P,G-2),H=0;for(O=0;O<U;++O){var V=c-P+O+32768&32767,$=V-v[V]+32768&32767;$>H&&(H=$,F=V)}}}P+=(T=F)-(F=v[T])+32768&32767}if(L){I[A++]=268435456|la[N]<<18|ca[L];var j=31&la[N],Z=31&ca[L];S+=ra[j]+ia[Z],++k[257+j],++w[Z],E=c+N,++C}else I[A++]=e[c],++k[e[c]]}}l=Ra(e,u,o,I,k,w,S,A,R,c-R,l),o||(l=Ea(u,l,Ta))}return ba(s,0,r+_a(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Oa=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Na(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=Fa[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=xa(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Oa(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),Oa(o,a-8,n.d()),Oa(o,a-4,r),o}var La=!!ln||!!un,Da="text/plain",Pa=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=Nn(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},Ba=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},qa=function(e){var t=e.data,n=e.compression;if(t){if(n===Lr.GZipJS){var r=Na(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ea(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new ea(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return ba(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:Da,body:new Blob([r],{type:Da})}}if(n===Lr.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=En(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Ba(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},Wa=[];ln&&Wa.push({transport:"XHR",method:function(e){var t,n=new ln;n.open(e.method||"GET",e.url,!0);var r=null!==(t=qa(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;yn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)}}),un&&Wa.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=qa(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;yn(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(cn){var l=new cn;u={signal:l.signal,timeout:setTimeout((function(){return l.abort()}),e.timeout)}}un(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){pn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;pn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))}}),null!=on&&on.sendBeacon&&Wa.push({transport:"sendBeacon",method:function(e){var t=Pa(e.url,{beacon:"1"});try{var n,r=null!==(n=qa(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;on.sendBeacon(t,a)}catch(e){}}});var Ga=["retriesPerformedSoFar"];var Ua,Ha=function(){function e(t){var n=this;a(this,e),l(this,"isPolling",!1),l(this,"pollIntervalMs",3e3),l(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Vt(Xt)&&"onLine"in Xt.navigator&&(this.areWeOnline=Xt.navigator.onLine,Xt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),Xt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=c(e,Ga);Kt(r)&&r>0&&(i.url=Pa(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({retriesPerformedSoFar:r},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),pn.warn(i),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.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=g(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){pn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),Va=1800,$a=function(){function e(t,n,r,i){a(this,e),l(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||bi,this._windowIdGenerator=i||bi;var o=t.persistence_name||t.token,s=t.session_idle_timeout_seconds||Va;if(Kt(s)?s>Va?pn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):s<60&&pn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(pn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=Va),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),Va),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Li.parse(this._window_id_storage_key),c=Li.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:Li.remove(this._window_id_storage_key),Li.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Vt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Li.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Li.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Li.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(l({},Zr,[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[Zr];return Wt(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;null==Xt||Xt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Li.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),pn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,h=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,h),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:h}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Ua||(Ua={}));var ja="i.posthog.com",Za=function(){function e(t){a(this,e),l(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ua.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ua.EU:this._regionCache[this.apiHost]=Ua.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost.replace(".".concat(ja),".posthog.com"))+t;if(this.region===Ua.CUSTOM)return this.apiHost+t;var n=ja+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),Ka=u((function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["error"];a(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var a,s,u,l,c;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var d=t.requestRouter.endpointFor("ui","/project/".concat(t.config.token,"/person/").concat(t.get_distinct_id()));e.tags["PostHog Person URL"]=d,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null===(a=e.exception)||void 0===a?void 0:a.values)||[],h={$exception_message:(null===(s=f[0])||void 0===s?void 0:s.value)||e.message,$exception_type:null===(u=f[0])||void 0===u?void 0:u.type,$exception_personURL:d,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null===(l=f[0])||void 0===l?void 0:l.value)||e.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags,$level:e.level};return n&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",h),e}))}}));function za(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||bi()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(ti,"identified")),t()},i=n.user();"then"in i&&Gt(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||pn.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var r;if(!n)return t;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 i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{});return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var Ya=function(){function e(t){a(this,e),this._instance=t}return u(e,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=null!==(e=null==Xt?void 0:Xt.location.pathname)&&void 0!==e?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var n=t.maxScrollHeight,r=t.lastScrollY,i=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,s=t.maxContentY;return Vt(n)||Vt(r)||Vt(i)||Vt(o)||Vt(a)||Vt(s)?{}:(n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),s=Math.ceil(s),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:n<=1?1:Ja(r/n,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:n<=1?1:Ja(i/n,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Ja(a/o,0,1),$prev_pageview_max_content:s,$prev_pageview_max_content_percentage:o<=1?1:Ja(s/o,0,1)})}}]),e}();function Ja(e,t,n){return Math.max(t,Math.min(e,n))}var Qa={icontains:function(e){return!!Xt&&Xt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!Xt&&On(Xt.location.href,e)},exact:function(e){return(null==Xt?void 0:Xt.location.href)===e}},Xa=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=null==fn?void 0:fn.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||Mn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(t){if(t)return pn.error("Could not load surveys script",t);fn.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);var r=this.instance.get_property(Xr);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Xr,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Qa[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==an?void 0:an.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),i=!e.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return n&&r&&i}));return e(r)}),n)}}]),e}(),es=function(){function e(t){var n,r,i=this;a(this,e),l(this,"serverLimits",{}),l(this,"lastEventRateLimited",!1),l(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){pn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),i.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void pn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return u(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(ri))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null===(n=this.instance.persistence)||void 0===n||n.set_property(ri,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ts=function(){return t({initialPathName:(null==sn?void 0:sn.pathname)||"",referringDomain:No.referringDomain()},No.campaignParams())},ns=function(){function e(t,n,r){var i=this;a(this,e),l(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(l({},ni,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ts,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[ni]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),rs=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],is=function(e,t){if(!e)return!1;var n=e.toLowerCase();return rs.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},os=function(){function e(){a(this,e),this.clicks=[]}return u(e,[{key:"isRageClick",value:function(e,t,n){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}();function as(e){var t;return e.id===si||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+si))}var ss=function(){function e(t){var n;a(this,e),l(this,"rageclicks",new os),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Wr])}return u(e,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(pn.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return Vt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(l({},Wr,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;Xt&&an&&(Rn(an,"click",(function(t){return e._onClick(t||(null==Xt?void 0:Xt.event))}),!1,!0),Rn(an,"mousemove",(function(t){return e._onMouseMove(t||(null==Xt?void 0:Xt.event))}),!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&!Un(r,"body");){if(r===n)return!1;if(bn(t,null==Xt?void 0:Xt.getComputedStyle(r).position))return!0;r=jn(r)}return!1}(e.target,["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var n;if(!as(e.target)){var r=this._getProperties(e,"click");null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},r),{},{type:"rageclick"})),this._capture(r)}}},{key:"_onMouseMove",value:function(e){var t=this;as(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(Xt){var t=Xt.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),e}(),us=function(){function e(t){var n=this;a(this,e),l(this,"_updateScrollData",(function(){var e,t,r,i;n.context||(n.context={});var o=n.scrollElement(),a=n.scrollY(),s=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(a),n.context.maxScrollY=Math.max(a,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(s,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(r=n.context.maxContentY)&&void 0!==r?r:0),n.context.maxContentHeight=Math.max(l,null!==(i=n.context.maxContentHeight)&&void 0!==i?i:0)})),this.instance=t}return u(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){null==Xt||Xt.addEventListener("scroll",this._updateScrollData,!0),null==Xt||Xt.addEventListener("scrollend",this._updateScrollData,!0),null==Xt||Xt.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==Xt?void 0:Xt.document.documentElement;var e,t=g(Wt(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==Xt?void 0:Xt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Xt&&(Xt.scrollY||Xt.pageYOffset||Xt.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Xt&&(Xt.scrollX||Xt.pageXOffset||Xt.document.documentElement.scrollLeft)||0}}]),e}(),ls=function(){function e(){a(this,e),l(this,"events",{}),this.events={}}return u(e,[{key:"on",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter((function(e){return e!==t}))}}},{key:"emit",value:function(e,t){var n,r=g(this.events[e]||[]);try{for(r.s();!(n=r.n()).done;){(0,n.value)(t)}}catch(e){r.e(e)}finally{r.f()}var i,o=g(this.events["*"]||[]);try{for(o.s();!(i=o.n()).done;){(0,i.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),cs="$copy_autocapture";function ds(e,t){return t.length>e?t.slice(0,e)+"...":t}var fs,hs=function(){function e(t){a(this,e),l(this,"_initialized",!1),l(this,"_isDisabledServerSide",null),l(this,"rageclicks",new os),l(this,"_elementsChainAsString",!1),this.instance=t}return u(e,[{key:"config",get:function(){var e,t=Ut(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=null===(e=t.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(Xt&&an){var t=function(t){t=t||(null==Xt?void 0:Xt.event);try{e._captureEvent(t)}catch(e){pn.error("Failed to capture event",e)}},n=function(t){t=t||(null==Xt?void 0:Xt.event),e._captureEvent(t,cs)};Rn(an,"submit",t,!1,!0),Rn(an,"change",t,!1,!0),Rn(an,"click",t,!1,!0),this.config.capture_copied_text&&(Rn(an,"copy",n,!1,!0),Rn(an,"cut",n,!1,!0))}}else pn.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(l({},qr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[qr],r=this._isDisabledServerSide;if(jt(r)&&!zt(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Gn(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Kn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&nr(r)&&(t[n]=r)}})),t}},{key:"_getPropertiesFromElement",value:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};$n.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=ds(1024,rr(e)):o.$el_text=ds(1024,Wn(e)));var a=Bn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;yn(e.attributes,(function(n){var r;if((!zn(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&nr(n.value)&&(r=n.name,!$t(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Pn(i).join(" ")),o["attr__"+n.name]=ds(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return Vt(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=this._getEventTarget(e);if(Hn(i)&&(i=i.parentNode||null),"$autocapture"===n&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var o=n===cs;if(i&&Zn(i,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,s,u=[i],l=i;l.parentNode&&!Un(l,"body");)Vn(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d=[],f={},h=!1;if(yn(u,(function(e){var n=Kn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&nr(c)&&c),bn(Bn(e),"ph-no-capture")&&(h=!0),d.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var r=t._getAugmentPropertiesFromElement(e);_n(f,r)})),this.instance.config.mask_all_text||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?d[0].$el_text=rr(i):d[0].$el_text=Wn(i)),c&&(d[0].attr__href=c),h)return!1;var p=_n(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:or(d)}:{$elements:d},null!==(a=d[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=d[0])||void 0===s?void 0:s.$el_text}:{},f);if(n===cs){var g,v=qn(null==Xt||null===(g=Xt.getSelection())||void 0===g?void 0:g.toString()),m=e.type||"clipboard";if(!v)return!1;p.$selected_content=v,p.$copy_type=m}return this.instance.capture(n,p),!0}}}},{key:"isBrowserSupported",value:function(){return Gt(null==an?void 0:an.querySelectorAll)}}]),e}();!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(fs||(fs={}));var ps=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?fs.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===fs.DENIED||this.consent===fs.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?fs.GRANTED:"0"===e?fs.DENIED:fs.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Mi:Ei;var t="localStorage"===e?Ei:Mi;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Tn([null==on?void 0:on.doNotTrack,null==on?void 0:on.msDoNotTrack,fn.doNotTrack],(function(e){return bn([!0,1,"1","yes"],e)}))}}]),e}(),gs={},vs=function(){},ms="posthog",ys=!La&&-1===(null==dn?void 0:dn.indexOf("MSIE"))&&-1===(null==dn?void 0:dn.indexOf("Mozilla")),_s=function(){var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==an?void 0:an.location,n=null==t?void 0:t.hostname,!!$t(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",loaded:vs,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:sn&&$t(null==sn?void 0:sn.search)&&-1!==sn.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Xt||null===(e=Xt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;pn.error(t)},get_device_id:function(e){return e},_onCapture:vs,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always"}},bs=function(e){var t={};Vt(e.process_person)||(t.person_profiles=e.process_person),Vt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Vt(e.cookie_name)||(t.persistence_name=e.cookie_name),Vt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=_n({},t,e);return Wt(e.property_blacklist)&&(Vt(e.property_denylist)?n.property_denylist=e.property_blacklist:Wt(e.property_denylist)?n.property_denylist=[].concat(f(e.property_blacklist),f(e.property_denylist)):pn.error("Invalid value for property_denylist config: "+e.property_denylist)),n},Is=function(){function e(){a(this,e),l(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){pn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),ks=function(){function e(){var t=this;a(this,e),l(this,"webPerformance",new Is),l(this,"_debugEventEmitter",new ls),this.config=_s(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ka,this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new hi(this),this.toolbar=new Qo(this),this.scrollManager=new us(this),this.pageViewManager=new Ya(this),this.surveys=new Xa(this),this.rateLimiter=new es(this),this.requestRouter=new Za(this),this.consent=new ps(this),this.people={set:function(e,n,r){var i=$t(e)?l({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=$t(e)?l({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(function(e){return pn.info("send",e)}))}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==ms){var i,o=null!==(i=gs[r])&&void 0!==i?i:new e;return o._init(t,n,r),gs[r]=o,gs[ms][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(Vt(e)||function(e){return $t(e)&&0===e.trim().length}(e))return pn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return pn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(_n({},_s(),bs(o),{name:a,token:e})),this.compression=o.disable_compression?void 0:Lr.Base64,this.persistence=new Do(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Do(t(t({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Xo((function(e){return i._send_retriable_request(e)})),this._retryQueue=new Ha(this),this.__request_queue=[],this.sessionManager=new $a(this.config,this.persistence),this.sessionPropsManager=new ns(this.sessionManager,this.persistence),this.sessionRecording=new Ko(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new hs(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ss(this),this.heatmaps.startIfEnabled(),Qt.DEBUG=Qt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var s,u,l=this.config.get_device_id(bi()),c=null!==(s=o.bootstrap)&&void 0!==s&&s.isIdentifiedID?l:o.bootstrap.distinctID;this.persistence.set_property(ti,null!==(u=o.bootstrap)&&void 0!==u&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var d,f,h=Object.keys((null===(d=o.bootstrap)||void 0===d?void 0:d.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),p=Object.keys((null===(f=o.bootstrap)||void 0===f?void 0:f.featureFlagPayloads)||{}).filter((function(e){return h[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:p})}if(!this.get_distinct_id()){var g=this.config.get_device_id(bi());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(ti,"anonymous")}return null==Xt||null===(r=Xt.addEventListener)||void 0===r||r.call(Xt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?za(this,(function(){return i._loaded()})):this._loaded(),Gt(this.config._onCapture)&&this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)})),this}},{key:"_afterDecideResponse",value:function(e){var t,n,r,i,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=bn(e.supportedCompression,Lr.GZipJS)?Lr.GZipJS:bn(e.supportedCompression,Lr.Base64)?Lr.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){pn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){an&&e.capture("$pageview",{title:an.title},{send_instantly:!0})}),1),t||(new zo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||mn(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ys?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Pa(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Pa(o.url,{_:(new Date).getTime().toString(),ver:Qt.LIB_VERSION,compression:o.compression});var a=null!==(n=o.transport)&&void 0!==n?n:"XHR",s=null!==(r=null===(i=Tn(Wa,(function(e){return e.transport===a})))||void 0===i?void 0:i.method)&&void 0!==r?r:Wa[0].method;if(!s)throw new Error("No available transport method");s(o)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];mn(e,(function(e){e&&(t=e[0],Wt(t)?o.push(e):Gt(e)?e.call(n):Wt(e)&&"alias"===t?r.push(e):Wt(e)&&-1!==t.indexOf("capture")&&Gt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){mn(e,(function(e){if(Wt(e[0])){var n=t;yn(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(i,this),a(o,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,n,r){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return pn.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!Vt(e)&&$t(e)){if(!dn||this.config.opt_out_useragent_filter||!is(dn,this.config.custom_blocked_useragents)){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&(this.sessionPersistence.update_campaign_params(),this.persistence.set_initial_campaign_params()),this.config.save_referrer&&(this.sessionPersistence.update_referrer_info(),this.persistence.set_initial_referrer_info());var a={uuid:bi(),event:e,properties:this._calculate_event_properties(e,n||{})};if(null==r||!r._noHeatmaps){var s,u=null===(s=this.heatmaps)||void 0===s?void 0:s.getAndClearBuffer();u&&(a.properties.$heatmap_data=u)}o&&(a.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(a.$set=null==r?void 0:r.$set);var l=this._calculate_set_once_properties(null==r?void 0:r.$set_once);l&&(a.$set_once=l),(a=An(a,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==r?void 0:r.timestamp)||new Date,Vt(null==r?void 0:r.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=new Date);var c=t(t({},a.properties.$set),a.$set);Ht(c)||this.setPersonPropertiesForFlags(c),this._debugEventEmitter.emit("eventCaptured",a);var d={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),a}pn.critical("This capture call is ignored due to client rate limiting.")}}else pn.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",(function(t){return e(t.event)}))}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=t({},n);if(i.token=this.config.token,"$snapshot"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var a=No.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,l=s.windowId;i.$session_id=u,i.$window_id=l}if(this.requestRouter.region===Ua.CUSTOM&&(i.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();i=_n(i,c)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=_n(i,d)}if("$pageview"===e&&an&&(i.title=an.title),!Vt(r)){var f=(new Date).getTime()-r;i.$duration=parseFloat((f/1e3).toFixed(3))}dn&&this.config.opt_out_useragent_filter&&(i.$browser_type=is(dn,this.config.custom_blocked_useragents)?"bot":"browser"),(i=_n({},a,this.persistence.properties(),this.sessionPersistence.properties(),i)).$is_identified=this._isIdentified(),Wt(this.config.property_denylist)?yn(this.config.property_denylist,(function(e){delete i[e]})):pn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;return h&&(i=h(i,e)),i.$process_person_profile=this._hasPersonProcessing(),i}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=_n({},this.persistence.get_initial_props(),e||{});return Ht(t)?void 0:t}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},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:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return pn.uninitializedWarning("posthog.identify");if(Kt(e)&&(e=e.toString(),pn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))pn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Pr)&&(this.unregister(Pr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(ti)||"anonymous");e!==r&&o?(this.persistence.set_property(ti,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(ei))}}else pn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},l({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(l({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}}else pn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return pn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(ti,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(bi());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(Dr)?(pn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Vt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Pr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(pn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var n,r,i,o,a=t({},this.config);Ut(e)&&(_n(this.config,bs(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Do(t(t({},this.config),{},{persistence:"sessionStorage"})),Mi.is_supported()&&"true"===Mi.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Qt.DEBUG=!0),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(null!=e&&e.sampling){var t,n,r=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId();null===(n=this.persistence)||void 0===n||n.register(l({},Kr,!0)),pn.info("Session recording started with sampling override for session: ",null==r?void 0:r.sessionId)}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_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ms;return t!==ms&&(t=ms+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(ti))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(ti))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Ht(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Pr])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[ai]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(pn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ai,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==a&&(null===(n=this.persistence)||void 0===n||n.set_disabled(a));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==a&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){!1===e?(null==Xt||Xt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Xt||Xt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Cn(e.prototype[t[n]])}(ks,["identify"]);var ws,Cs;ws=gs[ms]=new ks,(Cs=fn.posthog)&&yn(Cs._i,(function(e){if(e&&Wt(e)){var t=ws.init(e[0],e[1],e[2]),n=Cs[e[2]]||Cs;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),fn.posthog=ws,function(){function e(){e.done||(e.done=!0,ys=!1,yn(gs,(function(e){e._dom_loaded()})))}null!=an&&an.addEventListener&&("complete"===an.readyState?e():an.addEventListener("DOMContentLoaded",e,!1)),Xt&&Rn(Xt,"load",e,!0)}()}();
16
+ 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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),_t=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new pe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=g(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),i.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:b(e),index:t}}))})),r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),bt=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function It(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var kt=!1,wt=new I;function Ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,l=void 0===u?"rr-ignore":u,c=e.ignoreSelector,d=void 0===c?null:c,f=e.maskTextClass,h=void 0===f?"rr-mask":f,p=e.maskTextSelector,v=void 0===p?null:p,m=e.inlineStylesheet,y=void 0===m||m,_=e.maskAllInputs,b=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,C=e.maskTextFn,S=e.hooks,A=e.packFn,E=e.sampling,R=void 0===E?{}:E,M=e.dataURLOptions,T=void 0===M?{}:M,F=e.mousemoveWait,x=e.recordDOM,O=void 0===x||x,N=e.recordCanvas,L=void 0!==N&&N,D=e.recordCrossOriginIframes,P=void 0!==D&&D,B=e.recordAfter,q=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,W=e.userTriggeredOnInput,G=void 0!==W&&W,U=e.collectFonts,H=void 0!==U&&U,V=e.inlineImages,$=void 0!==V&&V,j=e.plugins,Z=e.keepIframeSrcFn,K=void 0===Z?function(){return!1}:Z,J=e.ignoreCSSAttributes,Q=void 0===J?new Set([]):J;Oe(e.errorHandler);var X=!P||window.parent===window,ee=!1;if(!X)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if(X&&!t)throw new Error("emit function is required");void 0!==F&&void 0===R.mousemove&&(R.mousemove=F),wt.reset();var te,ne=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},ae=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var se=0,ue=function(e){var t,n=g(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!ee&&(e=A(e)),e};pt=function(e,i){var o;if(!(null===(o=De[0])||void 0===o?void 0:o.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===_e.Mutation||De.forEach((function(e){return e.unfreeze()})),X)null==t||t(ue(e),i);else if(ee){var a={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===_e.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&&gt(!0)}};var le,ce=function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Mutation},e)}))},pe=function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Scroll},e)}))},ge=function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.CanvasMutation},e)}))},ve=new _t({mutationCb:ce,adoptedStyleSheetCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.AdoptedStyleSheet},e)}))}}),me=new Ye({mirror:wt,mutationCb:ce,stylesheetManager:ve,recordCrossOriginIframes:P,wrappedEmit:pt}),be=g(j||[]);try{for(be.s();!(le=be.n()).done;){var Ie=le.value;Ie.getMirror&&Ie.getMirror({nodeMirror:wt,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){be.e(e)}finally{be.f()}var ke=new bt;vt=new yt({recordCanvas:L,mutationCb:ge,win:window,blockClass:o,blockSelector:s,mirror:wt,sampling:R.canvas,dataURLOptions:T});var we=new Je({mutationCb:ce,scrollCb:pe,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:h,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:T,maskTextFn:C,maskInputFn:w,recordCanvas:L,inlineImages:$,sampling:R,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ve,canvasManager:vt,keepIframeSrcFn:K,processedNodeManager:ke},mirror:wt});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(O){pt(It({type:ye.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ve.reset(),we.init(),De.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new I:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,l=n.maskTextClass,c=void 0===l?"rr-mask":l,d=n.maskTextSelector,f=void 0===d?null:d,h=n.inlineStylesheet,p=void 0===h||h,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,_=n.maskAllInputs,b=void 0!==_&&_,k=n.maskTextFn,w=n.maskInputFn,C=n.slimDOM,S=void 0!==C&&C,A=n.dataURLOptions,E=n.preserveWhiteSpace,R=n.onSerialize,M=n.onIframeLoad,T=n.iframeLoadTimeout,F=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return z(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:k,maskInputFn:w,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:T,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:wt,blockClass:o,blockSelector:s,maskTextClass:h,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:C,slimDOM:ae,dataURLOptions:T,recordCanvas:L,inlineImages:$,onSerialize:function(e){de(e,wt)&&me.addIframe(e),fe(e,wt)&&ve.trackLinkElement(e),he(e)&&we.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),we.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ve.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!t)return console.warn("Failed to snapshot the document");pt(It({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),De.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ve.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))}};try{var Ce=[],Se=function(e){var t;return Le(je)({mutationCb:ce,mousemoveCb:function(e,t){return pt(It({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.MouseInteraction},e)}))},scrollCb:pe,viewportResizeCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.ViewportResize},e)}))},inputCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Input},e)}))},mediaInteractionCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Font},e)}))},selectionCb:function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.Selection},e)}))},customElementCb:function(e){pt(It({type:ye.IncrementalSnapshot,data:Object.assign({source:_e.CustomElement},e)}))},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:h,maskTextSelector:v,maskInputOptions:ne,inlineStylesheet:y,sampling:R,recordDOM:O,recordCanvas:L,inlineImages:$,userTriggeredOnInput:G,collectFonts:H,doc:e,maskInputFn:w,maskTextFn:C,keepIframeSrcFn:K,blockSelector:s,slimDOMOptions:ae,dataURLOptions:T,mirror:wt,iframeManager:me,stylesheetManager:ve,shadowDomManager:we,processedNodeManager:ke,canvasManager:vt,ignoreCSSAttributes:Q,plugins:(null===(t=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return pt(It({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};me.addLoadListener((function(e){try{Ce.push(Se(e.contentDocument))}catch(e){console.warn(e)}}));var Ae=function(){gt(),Ce.push(Se(document)),kt=!0};return"interactive"===document.readyState||"complete"===document.readyState?Ae():(Ce.push(Y("DOMContentLoaded",(function(){pt(It({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===q&&Ae()}))),Ce.push(Y("load",(function(){pt(It({type:ye.Load,data:{}})),"load"===q&&Ae()}),window))),function(){Ce.forEach((function(e){return e()})),ke.destroy(),kt=!1,Ne()}}catch(e){console.warn(e)}}Ct.addCustomEvent=function(e,t){if(!kt)throw new Error("please add custom event after start recording");pt(It({type:ye.Custom,data:{tag:e,payload:t}}))},Ct.freezePage=function(){De.forEach((function(e){return e.freeze()}))},Ct.takeFullSnapshot=function(e){if(!kt)throw new Error("please take full snapshot after start recording");gt(e)},Ct.mirror=wt;var St=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),At=/(^|@)\S+:\d+/,Et=/^\s*at .*(\S+:\d+|\(native\))/m,Rt=/^(eval@)?(\[native code])?$/,Mt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Et)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Et)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new St({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new St({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new St({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new St({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Tt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Ft(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Ft(e[i])&&xt(e[i],t-1))return!0}return!1}function Ot(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ft(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ft(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Tt(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Nt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Lt(e,t,n){var r,i=n?Object.assign({},Nt,n):Nt,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=Mt.parse(r).map((function(e){return e.toString()})),a=[Ot(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((function(){t.removeEventListener("error",l)}));var c=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Ot("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Ot("Uncaught (in promise)",i.stringifyOptions),Ot(t.reason,i.stringifyOptions)]);var o=Mt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",c),u.push((function(){t.removeEventListener("unhandledrejection",c)}))}var d,f=g(i.level);try{for(f.s();!(d=f.n()).done;){var h=d.value;u.push(p(r,h))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function p(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(r,u),!s){s=!0;try{var c=Mt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Ot(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Ot("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Dt=Array.isArray,Pt=Object.prototype,Bt=Pt.hasOwnProperty,qt=Pt.toString,Wt=Dt||function(e){return"[object Array]"===qt.call(e)},Gt=function(e){return"function"==typeof e},Ut=function(e){return e===Object(e)&&!Wt(e)},Ht=function(e){if(Ut(e)){for(var t in e)if(Bt.call(e,t))return!1;return!0}return!1},Vt=function(e){return void 0===e},$t=function(e){return"[object String]"==qt.call(e)},jt=function(e){return null===e},Zt=function(e){return Vt(e)||jt(e)},Kt=function(e){return"[object Number]"==qt.call(e)},zt=function(e){return"[object Boolean]"===qt.call(e)},Yt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},Qt={DEBUG:!1,LIB_VERSION:"1.136.2"},Xt="undefined"!=typeof window?window:void 0,en="undefined"!=typeof globalThis?globalThis:Xt,tn=Array.prototype,nn=tn.forEach,rn=tn.indexOf,on=null==en?void 0:en.navigator,an=null==en?void 0:en.document,sn=null==en?void 0:en.location,un=null==en?void 0:en.fetch,ln=null!=en&&en.XMLHttpRequest&&"withCredentials"in new en.XMLHttpRequest?en.XMLHttpRequest:void 0,cn=null==en?void 0:en.AbortController,dn=null==on?void 0:on.userAgent,fn=null!=Xt?Xt:{},hn="[PostHog.js]",pn={_log:function(e){if(Xt&&(Qt.DEBUG||fn.POSTHOG_DEBUG)&&!Vt(Xt.console)&&Xt.console){for(var t=("__rrweb_original__"in Xt.console[e]?Xt.console[e].__rrweb_original__:Xt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[hn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];pn._log.apply(pn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[hn].concat(n))},uninitializedWarning:function(e){pn.error("You must initialize PostHog before calling ".concat(e))}},gn={},vn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function mn(e,t,n){if(Wt(e))if(nn&&e.forEach===nn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===gn)return}function yn(e,t,n){if(!Zt(e)){if(Wt(e))return mn(e,t,n);if(Jt(e)){var r,i=g(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===gn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(Bt.call(e,a)&&t.call(n,e[a],a)===gn)return}}var _n=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 mn(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function bn(e,t){return-1!==e.indexOf(t)}function In(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var kn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},wn=function(e){try{return e()}catch(e){return}},Cn=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){pn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),pn.critical(e)}}},Sn=function(e){var t={};return yn(e,(function(e,n){$t(e)&&e.length>0&&(t[n]=e)})),t};function An(e,t){return n=e,r=function(e){return $t(e)&&!jt(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),Wt(t)?(o=[],mn(t,(function(t){o.push(e(t))}))):(o={},yn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var En=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),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),jt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Rn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==Xt?void 0:Xt.event)){var o,a=!0;Gt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else pn.error("No valid element provided to register_event")}}();function Mn(e,t){var n=function(){if(!an)return t("document not found");var n=an.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=an.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):an.body.appendChild(n)};null!=an&&an.body?n():null==an||an.addEventListener("DOMContentLoaded",n)}function Tn(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Fn=["localhost","127.0.0.1"],xn=function(e){var t=null==an?void 0:an.createElement("a");return Vt(t)?null:(t.href=e,t)},On=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},Nn=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return yn(e,(function(e,r){Vt(e)||Vt(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Ln=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!Wt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){pn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Dn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Pn(e){return e?vn(e).split(/\s+/):[]}function Bn(e){var t="";switch(r(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Pn(t)}function qn(e){return Zt(e)?null:vn(e).split(/(\s+)/).filter((function(e){return nr(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wn(e){var t="";return Kn(e)&&!zn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;Hn(e)&&e.textContent&&(t+=null!==(n=qn(e.textContent))&&void 0!==n?n:"")})),vn(t)}function Gn(e){return!!e&&1===e.nodeType}function Un(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Hn(e){return!!e&&3===e.nodeType}function Vn(e){return!!e&&11===e.nodeType}var $n=["a","button","form","input","select","textarea","label"];function jn(e){var t=e.parentNode;return!(!t||!Gn(t))&&t}function Zn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!Xt||!e||Un(e,"html")||!Gn(e))return!1;if(null!=n&&n.url_allowlist){var a=Xt.location.href,s=n.url_allowlist;if(s&&!s.some((function(e){return a.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var l=!1,c=[e],d=!0,f=e;f.parentNode&&!Un(f,"body");)if(Vn(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=jn(f)))break;if(i||$n.indexOf(d.tagName.toLowerCase())>-1)l=!0;else{var h=Xt.getComputedStyle(d);h&&"pointer"===h.getPropertyValue("cursor")&&(l=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Vt(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(c,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Vt(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(c,n))return!1;var p=Xt.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return l?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&($n.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function Kn(e){for(var t=e;t.parentNode&&!Un(t,"body");t=t.parentNode){var n=Bn(t);if(bn(n,"ph-sensitive")||bn(n,"ph-no-capture"))return!1}if(bn(Bn(e),"ph-include"))return!0;var r=e.type||"";if($t(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if($t(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function zn(e){return!!(Un(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Un(e,"select")||Un(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Yn="(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})",Jn=new RegExp("^(?:".concat(Yn,")$")),Qn=new RegExp(Yn),Xn="\\d{3}-?\\d{2}-?\\d{4}",er=new RegExp("^(".concat(Xn,")$")),tr=new RegExp("(".concat(Xn,")"));function nr(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zt(e))return!1;if($t(e)){if(e=vn(e),(t?Jn:Qn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?er:tr).test(e))return!1}return!0}function rr(e){var t=Wn(e);return nr(t="".concat(t," ").concat(ir(e)).trim())?t:""}function ir(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Wn(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ir(e)).trim())}catch(e){pn.error(e)}})),t}function or(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=g(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return In(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return l[ar(n.toString())]=ar(r.toString())})),i+=":",i+=In(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:sr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return In(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function ar(e){return e.replace(/"|\\"/g,'\\"')}function sr(e){var t=e.attr__class;return t?Wt(t)?t:Pn(t):void 0}var ur="[SessionRecording]",lr="redacted",cr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},dr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],fr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],hr=["/s/","/e/","/i/"];function pr(e,t,n,r){if(Zt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return $t(i)&&(i=parseInt(i)),i>n?ur+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function gr(e,t){if(Zt(e))return e;var n=e;return nr(n,!1)||(n=ur+" "+t+" body "+lr),yn(fr,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=ur+" "+t+" body "+lr+" as might contain: "+e)})),n}var vr=function(e,n){var r,i,o,a={payloadSizeLimitBytes:cr.payloadSizeLimitBytes,performanceEntryTypeToObserve:f(cr.performanceEntryTypeToObserve)},s=!1!==e.session_recording.recordHeaders&&n.recordHeaders,u=!1!==e.session_recording.recordBody&&n.recordBody,l=!1!==e.capture_performance&&n.recordPerformance,c=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=pr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=pr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return c(function(e){var t=xn(e.name);if(!(t&&t.pathname&&hr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((n=(t=e).requestHeaders,Zt(n)||yn(Object.keys(null!=n?n:{}),(function(e){dr.includes(e.toLowerCase())&&(n[e]=lr)})),t)));var t,n},h=Gt(e.session_recording.maskNetworkRequestFn);return h&&Gt(e.session_recording.maskCapturedNetworkRequestFn)&&pn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=Gt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!Vt(e))return e.requestBody=gr(e.requestBody,"Request"),e.responseBody=gr(e.responseBody,"Response"),e}(d(e))},t(t(t({},cr),a),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})},mr=function(e){return"navigation"===e.entryType},yr=function(e){return"resource"===e.entryType};function _r(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return Gt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r},__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function br(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function Ir(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return mr(e)||yr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return mr(e)||yr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function kr(e,t){return!!t&&(zt(t)||t[e])}function wr(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(zt(t))return!0;if(Wt(t))return r(t);var i=t[e];return zt(i)?i:r(i)}function Cr(e,t,n,r,i){return Sr.apply(this,arguments)}function Sr(){return Sr=o(n().mark((function e(t,r,i,o,a){var s,u,l,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=c.length>5&&void 0!==c[5]?c[5]:0)>10)){e.next=4;break}return pn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),l=br(u,(function(e){return yr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",Cr(t,r,i,o,a,s+1));case 10:return e.abrupt("return",l);case 11:case"end":return e.stop()}}),e)}))),Sr.apply(this,arguments)}function Ar(e){if(Zt(e))return null;if($t(e))return e;if(Yt(e))return e.textContent;if(Jt(e))return Nn(e);if(Ut(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Er=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Rr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(Er(e)){var l,c=g(e.serverTiming||[]);try{for(c.s();!(l=c.n()).done;){var d=l.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){c.e(e)}finally{c.f()}}return u}var Mr=["video/","audio/"];function Tr(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Mr.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Fr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function xr(e){return Or.apply(this,arguments)}function Or(){return(Or=o(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Tr(t),jt(r)){e.next=3;break}return e.abrupt("return",Promise.resolve(r));case 3:return e.abrupt("return",Fr(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nr(e,r,i){if(!("performance"in r))return function(){};var a=i?Object.assign({},cr,i):cr,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=Ir(s,r,a),l=function(){},c=function(){};return(a.recordHeaders||a.recordBody)&&(l=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=kr("request",n.recordHeaders),i=kr("response",n.recordHeaders),o=_r(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,h=this,p=new Request(s),g={},v={},m=h.setRequestHeader.bind(h);h.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=h.send.bind(h);h.send=function(e){return wr("request",n.recordBody,v)&&(Vt(e)||jt(e)?g.requestBody=null:g.requestBody=Ar(e)),u=t.performance.now(),y(e)},h.addEventListener("readystatechange",(function(){if(h.readyState===h.DONE){l=t.performance.now();var r={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),wr("response",n.recordBody,r)&&(Zt(h.response)?g.responseBody=null:g.responseBody=Ar(h.response)),Cr(t,"xmlhttprequest",p.url,u,l).then((function(t){if(!jt(t)){var n=Rr(t,p.method,null==h?void 0:h.status,g);e({requests:n})}})).catch((function(){}))}})),o.call(h,a,s,c,d,f)}}));return function(){o()}}(s,r,a),c=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=kr("request",r.recordHeaders),a=kr("response",r.recordHeaders),s=_r(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,l){var c,d,f,h,p,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=new Request(u,l),f={},n.prev=2,g={},c.headers.forEach((function(e,t){g[t]=e})),i&&(f.requestHeaders=g),!wr("request",r.recordBody,g)){n.next=10;break}return n.next=9,Fr(c);case 9:f.requestBody=n.sent;case 10:return h=t.performance.now(),n.next=13,s(c);case 13:if(d=n.sent,p=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(f.responseHeaders=v),!wr("response",r.recordBody,v)){n.next=22;break}return n.next=21,xr(d);case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Cr(t,"fetch",c.url,h,p).then((function(t){var n;if(!jt(t)){var r=Rr(t,c.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),function(){u(),l(),c()}}var Lr;Xt&&(Xt.rrweb={record:Ct,version:"v2",rrwebVersion:"2.0.0-alpha.13"},Xt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Lt,options:e}}},Xt.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Nr,options:e}}),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Lr||(Lr={}));var Dr="$people_distinct_id",Pr="__alias",Br="__timers",qr="$autocapture_disabled_server_side",Wr="$heatmaps_enabled_server_side",Gr="$session_recording_enabled_server_side",Ur="$console_log_recording_enabled_server_side",Hr="$session_recording_network_payload_capture",Vr="$session_recording_canvas_recording",$r="$replay_sample_rate",jr="$replay_minimum_duration",Zr="$sesid",Kr="$session_is_sampled",zr="$enabled_feature_flags",Yr="$early_access_features",Jr="$stored_person_properties",Qr="$stored_group_properties",Xr="$surveys",ei="$flag_call_reported",ti="$user_state",ni="$client_session_props",ri="$capture_rate_limit",ii="$initial_campaign_params",oi="$initial_referrer_info",ai="$epp",si="__POSTHOG_TOOLBAR__",ui=[Dr,Pr,"__cmpns",Br,Gr,Wr,Zr,zr,ti,Yr,Qr,Jr,Xr,ei,ni,ri,ii,oi,ai],li="$active_feature_flags",ci="$override_feature_flags",di="$feature_flag_payloads",fi=function(e){var t,n={},r=g(In(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},hi=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(zr),t=this.instance.get_property(ci);if(!t)return e||{};for(var n=_n({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(pn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(di)||{}}},{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;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Jr),r=this.instance.get_property(Qr),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:Lr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(ei)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Wt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(l({},ei,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}pn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{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]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);pn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(Wt(a)){var u,c={};if(a)for(var d=0;d<a.length;d++)c[a[d]]=!0;n&&n.register((l(u={},li,a),l(u,zr,c),u))}else{var f=a,h=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),h=t(t({},o),h)),n&&n.register((l(r={},li,Object.keys(fi(f))),l(r,zr,f||{}),l(r,di,h||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return pn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ci);else if(Wt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(l({},ci,t))}else this.instance.persistence.register(l({},ci,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=l({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},l({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((l(i={},li,Object.keys(fi(a))),l(i,zr,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Yr);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Yr,i)),e(i)}}})}},{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}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Jr)||{};this.instance.register(l({},Jr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Jr)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Qr)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(l({},Qr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(Qr)||{};this.instance.register(l({},Qr,t(t({},n),{},l({},e,{}))))}else this.instance.unregister(Qr)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Kt(e)&&isFinite(e)&&Math.floor(e)===e});var pi="0123456789abcdef",gi=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+pi.charAt(this.bytes[t]>>>4)+pi.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),vi=function(){function e(){a(this,e),l(this,"timestamp",0),l(this,"counter",0),l(this,"random",new _i)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Vt(e)){this.timestamp=0;var t=this.generateOrAbort();if(Vt(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return gi.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),mi=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Xt&&!Vt(Xt.crypto)&&crypto.getRandomValues&&(mi=function(e){return crypto.getRandomValues(e)});var yi,_i=function(){function e(){a(this,e),l(this,"buffer",new Uint32Array(8)),l(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(mi(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),bi=function(){return Ii().toString()},Ii=function(){return(yi||(yi=new vi)).generate()},ki="Thu, 01 Jan 1970 00:00:00 GMT",wi="";var Ci=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Si(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:an;if(wi)return wi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+bi(),o=new RegExp("(^|;)\\s*"+i+"=1");!wi&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+ki,wi=a)}return wi}(e);if(!n){var r=function(e){var t=e.match(Ci);return t?t[0]:""}(e);r!==n&&pn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ai,Ei={is_supported:function(){return!!an},error:function(e){pn.error("cookieStore error: "+e)},get:function(e){if(an){try{for(var t=e+"=",n=an.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(Ei.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(an)try{var o="",a="",s=Si(an.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&pn.warn("cookieStore warning: large cookie, len="+l.length),an.cookie=l,l}catch(e){return}},remove:function(e,t){try{Ei.set(e,"",-1,t)}catch(e){return}}},Ri=null,Mi={is_supported:function(){if(!jt(Ri))return Ri;var e=!0;if(Vt(Xt))e=!1;else try{var t="__mplssupport__";Mi.set(t,"xyz"),'"xyz"'!==Mi.get(t)&&(e=!1),Mi.remove(t)}catch(t){e=!1}return e||pn.error("localStorage unsupported; falling back to cookie store"),Ri=e,e},error:function(e){pn.error("localStorage error: "+e)},get:function(e){try{return null==Xt?void 0:Xt.localStorage.getItem(e)}catch(e){Mi.error(e)}return null},parse:function(e){try{return JSON.parse(Mi.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Xt||Xt.localStorage.setItem(e,JSON.stringify(t))}catch(e){Mi.error(e)}},remove:function(e){try{null==Xt||Xt.localStorage.removeItem(e)}catch(e){Mi.error(e)}}},Ti=["distinct_id",Zr,Kr,ai],Fi=t(t({},Mi),{},{parse:function(e){try{var t={};try{t=Ei.parse(e)||{}}catch(e){}var n=_n(t,JSON.parse(Mi.get(e)||"{}"));return Mi.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{Mi.set(e,t);var o={};Ti.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Ei.set(e,o,n,r,i)}catch(e){Mi.error(e)}},remove:function(e,t){try{null==Xt||Xt.localStorage.removeItem(e),Ei.remove(e,t)}catch(e){Mi.error(e)}}}),xi={},Oi={is_supported:function(){return!0},error:function(e){pn.error("memoryStorage error: "+e)},get:function(e){return xi[e]||null},parse:function(e){return xi[e]||null},set:function(e,t){xi[e]=t},remove:function(e){delete xi[e]}},Ni=null,Li={is_supported:function(){if(!jt(Ni))return Ni;if(Ni=!0,Vt(Xt))Ni=!1;else try{var e="__support__";Li.set(e,"xyz"),'"xyz"'!==Li.get(e)&&(Ni=!1),Li.remove(e)}catch(e){Ni=!1}return Ni},error:function(e){pn.error("sessionStorage error: ",e)},get:function(e){try{return null==Xt?void 0:Xt.sessionStorage.getItem(e)}catch(e){Li.error(e)}return null},parse:function(e){try{return JSON.parse(Li.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Xt||Xt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Li.error(e)}},remove:function(e){try{null==Xt||Xt.sessionStorage.removeItem(e)}catch(e){Li.error(e)}}},Di="Mobile",Pi="iOS",Bi="Android",qi="Tablet",Wi=Bi+" "+qi,Gi="iPad",Ui="Apple",Hi=Ui+" Watch",Vi="Safari",$i="BlackBerry",ji="Samsung",Zi=ji+"Browser",Ki=ji+" Internet",zi="Chrome",Yi=zi+" OS",Ji=zi+" "+Pi,Qi="Internet Explorer",Xi=Qi+" "+Di,eo="Opera",to=eo+" Mini",no="Edge",ro="Microsoft "+no,io="Firefox",oo=io+" "+Pi,ao="Nintendo",so="PlayStation",uo="Xbox",lo=Bi+" "+Di,co=Di+" "+Vi,fo="Windows",ho=fo+" Phone",po="Nokia",go="Ouya",vo="Generic",mo=vo+" "+Di.toLowerCase(),yo=vo+" "+qi.toLowerCase(),_o="Konqueror",bo="(\\d+(\\.\\d+)?)",Io=new RegExp("Version/"+bo),ko=new RegExp(uo,"i"),wo=new RegExp(so+" \\w+","i"),Co=new RegExp(ao+" \\w+","i"),So=new RegExp($i+"|PlayBook|BB10","i"),Ao={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Eo=function(e,t){return t&&bn(t,Ui)||function(e){return bn(e,Vi)&&!bn(e,zi)&&!bn(e,Bi)}(e)},Ro=function(e,t){return t=t||"",bn(e," OPR/")&&bn(e,"Mini")?to:bn(e," OPR/")?eo:So.test(e)?$i:bn(e,"IE"+Di)||bn(e,"WPDesktop")?Xi:bn(e,Zi)?Ki:bn(e,no)||bn(e,"Edg/")?ro:bn(e,"FBIOS")?"Facebook "+Di:bn(e,"UCWEB")||bn(e,"UCBrowser")?"UC Browser":bn(e,"CriOS")?Ji:bn(e,"CrMo")?zi:bn(e,Bi)&&bn(e,Vi)?lo:bn(e,zi)?zi:bn(e,"FxiOS")?oo:bn(e.toLowerCase(),_o.toLowerCase())?_o:Eo(e,t)?bn(e,Di)?co:Vi:bn(e,io)?io:bn(e,"MSIE")||bn(e,"Trident/")?Qi:bn(e,"Gecko")?io:""},Mo=(l(Ai={},Xi,[new RegExp("rv:"+bo)]),l(Ai,ro,[new RegExp(no+"?\\/"+bo)]),l(Ai,zi,[new RegExp("("+zi+"|CrMo)\\/"+bo)]),l(Ai,Ji,[new RegExp("CriOS\\/"+bo)]),l(Ai,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+bo)]),l(Ai,Vi,[Io]),l(Ai,co,[Io]),l(Ai,eo,[new RegExp("(Opera|OPR)\\/"+bo)]),l(Ai,io,[new RegExp(io+"\\/"+bo)]),l(Ai,oo,[new RegExp("FxiOS\\/"+bo)]),l(Ai,_o,[new RegExp("Konqueror[:/]?"+bo,"i")]),l(Ai,$i,[new RegExp($i+" "+bo),Io]),l(Ai,lo,[new RegExp("android\\s"+bo,"i")]),l(Ai,Ki,[new RegExp(Zi+"\\/"+bo)]),l(Ai,Qi,[new RegExp("(rv:|MSIE )"+bo)]),l(Ai,"Mozilla",[new RegExp("rv:"+bo)]),Ai),To=[[new RegExp(uo+"; "+uo+" (.*?)[);]","i"),function(e){return[uo,e&&e[1]||""]}],[new RegExp(ao,"i"),[ao,""]],[new RegExp(so,"i"),[so,""]],[So,[$i,""]],[new RegExp(fo,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[ho,""];if(new RegExp(Di).test(t)&&!/IEMobile\b/.test(t))return[fo+" "+Di,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Ao[r]||"";return/arm/i.test(t)&&(i="RT"),[fo,i]}return[fo,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Pi,t.join(".")]}return[Pi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Vt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Bi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Bi+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Bi,t.join(".")]}return[Bi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Yi,""]],[/Linux|debian/i,["Linux",""]]],Fo=function(e){return Co.test(e)?ao:wo.test(e)?so:ko.test(e)?uo:new RegExp(go,"i").test(e)?go:new RegExp("("+ho+"|WPDesktop)","i").test(e)?ho:/iPad/.test(e)?Gi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Hi:So.test(e)?$i:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(po,"i").test(e)?po:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Di).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Bi:Wi:Bi:new RegExp("(pda|"+Di+")","i").test(e)?mo:new RegExp(qi,"i").test(e)&&!new RegExp(qi+" pc","i").test(e)?yo:""},xo="https?://(.*)",Oo=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],No={campaignParams:function(e){var t=Oo.concat(e||[]),n={};return yn(t,(function(e){var t=an?Ln(an.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==an?void 0:an.referrer;return e?0===e.search(xo+"google.([^/?]*)")?"google":0===e.search(xo+"bing.com")?"bing":0===e.search(xo+"yahoo.com")?"yahoo":0===e.search(xo+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=No.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!jt(e)){n.$search_engine=e;var r=an?Ln(an.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:Ro,browserVersion:function(e,t){var n=Ro(e,t),r=Mo[n];if(Vt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<To.length;t++){var n=d(To[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(Gt(i)?i(o,e):i);if(a)return a}return["",""]},device:Fo,deviceType:function(e){var t=Fo(e);return t===Gi||t===Wi||"Kobo"===t||"Kindle Fire"===t||t===yo?qi:t===ao||t===uo||t===so||t===go?"Console":t===Hi?"Wearable":t?Di:"Desktop"},referrer:function(){return(null==an?void 0:an.referrer)||"$direct"},referringDomain:function(){var e;return null!=an&&an.referrer&&(null===(e=xn(an.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},properties:function(){if(!dn)return{};var e=d(No.os(dn),2),t=e[0],n=e[1];return _n(Sn({$os:t,$os_version:n,$browser:No.browser(dn,navigator.vendor),$device:No.device(dn),$device_type:No.deviceType(dn)}),{$current_url:null==sn?void 0:sn.href,$host:null==sn?void 0:sn.host,$pathname:null==sn?void 0:sn.pathname,$raw_user_agent:dn.length>1e3?dn.substring(0,997)+"...":dn,$browser_version:No.browserVersion(dn,navigator.vendor),$browser_language:No.browserLanguage(),$screen_height:null==Xt?void 0:Xt.screen.height,$screen_width:null==Xt?void 0:Xt.screen.width,$viewport_height:null==Xt?void 0:Xt.innerHeight,$viewport_width:null==Xt?void 0:Xt.innerWidth,$lib:"web",$lib_version:Qt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:kn()/1e3})},people_properties:function(){if(!dn)return{};var e=d(No.os(dn),2),t=e[0],n=e[1];return _n(Sn({$os:t,$os_version:n,$browser:No.browser(dn,navigator.vendor)}),{$browser_version:No.browserVersion(dn,navigator.vendor)})}},Lo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Do=function(){function e(t){a(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===Lo.indexOf(e.persistence.toLowerCase())&&(pn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Mi.is_supported()?Mi:"localstorage+cookie"===t&&Fi.is_supported()?Fi:"sessionstorage"===t&&Li.is_supported()?Li:"memory"===t?Oi:"cookie"===t?Ei:Fi.is_supported()?Fi:Ei}},{key:"properties",value:function(){var e={};return yn(this.props,(function(t,n){if(n===zr&&Ut(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(jt(o=ui)?s:rn&&o.indexOf===rn?-1!=o.indexOf(a):(yn(o,(function(e){if(s||(s=e===a))return gn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=_n({},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(Ut(e)){Vt(t)&&(t="None"),this.expire_days=Vt(n)?this.default_expiry:n;var i=!1;if(yn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Ut(e)){this.expire_days=Vt(t)?this.default_expiry:t;var r=!1;if(yn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=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(No.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"set_initial_campaign_params",value:function(){this.register_once(l({},ii,No.campaignParams(this.config.custom_campaign_params)),void 0)}},{key:"update_search_keyword",value:function(){this.register(No.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(No.referrerInfo())}},{key:"set_initial_referrer_info",value:function(){this.register_once(l({},oi,No.referrerInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Sn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};return yn([oi,ii],(function(n){var r=e.props[n];r&&yn(r,(function(e,n){var r;t["$initial_"+(r=n,r.replace(/^\$/,""))]=e}))})),t}},{key:"safe_merge",value:function(e){return yn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(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),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{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[Br]||{};n[e]=t,this.props[Br]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Br]||{})[e];return Vt(t)||(delete this.props[Br][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}(),Po=2,Bo=4;var qo,Wo=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),l(this,"bucketSize",100),l(this,"refillRate",10),l(this,"mutationBuckets",{}),l(this,"loggedTracker",{}),l(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),l(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),l(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),l(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Go=function(e){return 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",e}(Go||{}),Uo=3e5,Ho=Uo;!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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(qo||(qo={}));var Vo,$o=[qo.MouseMove,qo.MouseInteraction,qo.Scroll,qo.ViewportResize,qo.Input,qo.TouchMove,qo.MediaInteraction,qo.Drag],jo=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},Zo="[SessionRecording]",Ko=function(){function e(t){var n=this;if(a(this,e),l(this,"queuedRRWebEvents",[]),l(this,"isIdle",!1),l(this,"_linkedFlagSeen",!1),l(this,"_lastActivityTimestamp",Date.now()),l(this,"windowId",null),l(this,"sessionId",null),l(this,"_linkedFlag",null),l(this,"_forceAllowLocalhostNetworkCapture",!1),l(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==Xt||Xt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==Xt||Xt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==Xt||Xt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==Xt||Xt.addEventListener("visibilitychange",(function(){if(null!=an&&an.visibilityState){var e="window "+an.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw pn.error(Zo+" started without valid sessionManager"),new Error(Zo+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer(),this._setupSampling()}return u(e,[{key:"rrwebRecord",get:function(){var e;return null==fn||null===(e=fn.rrweb)||void 0===e?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw pn.error(Zo+" started without valid sessionManager"),new Error(Zo+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){var e=this.instance.get_property(Kr);return zt(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Gr),t=!this.instance.config.disable_session_recording;return Xt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ur),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(Vr);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Hr),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property($r);return Kt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(jr);return Kt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Zt(this._linkedFlag)||this._linkedFlagSeen?zt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),pn.info(Zo+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,pn.info(Zo+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Kt(r)){var i,o=this.isSampled,a=n||!zt(o);if(a)i=Math.random()<r;else i=o;!i&&a&&pn.warn(Zo+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),null===(t=this.instance.persistence)||void 0===t||t.register(l({},Kr,i))}else{var s;null===(s=this.instance.persistence)||void 0===s||s.register(l({},Kr,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i=this;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!Zt(this._linkedFlag)){var o=$t(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=$t(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=Ut(t)&&o in t,r=a?t[o]===a:n;if(r){var s={linkedFlag:o,linkedVariant:a},u="linked flag matched";pn.info(Zo+" "+u,s),i._tryAddCustomEvent(u,s)}i._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Kt(this.sampleRate)&&jt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var n=this.instance.persistence,r=function(){var r,i,o,a,s,u,c,d,f=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,h=Zt(f)?null:parseFloat(f),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register((l(d={},Gr,!!e.sessionRecording),l(d,Ur,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),l(d,Hr,t({capturePerformance:e.capturePerformance},null===(a=e.sessionRecording)||void 0===a?void 0:a.networkPayloadCapture)),l(d,Vr,{enabled:null===(s=e.sessionRecording)||void 0===s?void 0:s.recordCanvas,fps:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),l(d,$r,h),l(d,jr,Vt(p)?null:p),d))};r(),this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:kn()})}},{key:"_startCapture",value:function(){var e=this;Vt(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():Mn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(Qt.LIB_VERSION)),(function(t){if(t)return pn.error(Zo+" could not load recorder.js",t);e._onScriptLoaded()})))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==$o.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>Ho&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:Ho}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Po,Bo].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):pn.warn(Zo+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(jo((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(jo((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],l=s[1];u in r&&(r[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Wo(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");pn.info(r,{node:t}),n.log(Zo+" "+r,"warn")}}),this._scheduleFullSnapshot();var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:c},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=Xt?n._maskUrl(Xt.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t}),n._tryTakeFullSnapshot()}}catch(e){pn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:c.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else pn.error(Zo+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),Uo)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(fn.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(fn.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Gt(fn.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(fn.getRecordNetworkPlugin(vr(this.instance.config,this.networkPayloadCapture))):pn.info(Zo+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Ut(e)){if(e.type===Go.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Go.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Ut(t)&&6===t.type&&Ut(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Go.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&Xt){var e=this._maskUrl(Xt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=Kt(n)&&n>=0,i=Kt(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),jt(this.buffer.sessionId)&&!jt(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),e}(),zo=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Jr),group_properties:this.instance.get_property(Qr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:Lr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)pn.error("Failed to fetch feature flags from PostHog.");else{if(!an||!an.body)return pn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){t.parseDecideResponse(e)}),500);this.instance._afterDecideResponse(e);var r=null==Xt?void 0:Xt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Vt(r)&&Mn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(n){if(n)return pn.error("Could not load exception autocapture script",n);Xt.extendPostHogWithExceptionAutocapture(t.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var i,o=g(e.siteApps);try{var a=function(){var e=i.value,n=e.id,r=e.url,o=t.instance.requestRouter.endpointFor("api",r);fn["__$$ph_site_app_".concat(n)]=t.instance,Mn(o,(function(e){e&&pn.error("Error while initializing PostHog app with config id ".concat(n),e)}))};for(o.s();!(i=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}else e.siteApps.length>0&&pn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),Yo=null!=Xt&&Xt.location?Dn(Xt.location.hash,"__posthog")||Dn(location.hash,"state"):null,Jo="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Vo||(Vo={}));var Qo=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"setToolbarState",value:function(e){fn.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=fn.ph_toolbar_state)&&void 0!==e?e:Vo.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Xt||!an)return!1;n=null!==(e=n)&&void 0!==e?e:Xt.location,i=null!==(t=i)&&void 0!==t?t:Xt.history;try{if(!r){try{Xt.localStorage.setItem("test","test"),Xt.localStorage.removeItem("test")}catch(e){return!1}r=null==Xt?void 0:Xt.localStorage}var o,a=Yo||Dn(n.hash,"__posthog")||Dn(n.hash,"state"),s=a?wn((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||wn((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(Jo)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){(fn.ph_load_toolbar||fn.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var n=this,r=!(null==an||!an.getElementById(si));if(!Xt||r)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Xt.localStorage.setItem(Jo,JSON.stringify(t(t({},o),{},{source:void 0}))),this.getToolbarState()===Vo.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===Vo.UNINITIALIZED){this.setToolbarState(Vo.LOADING);var a=3e5,s=Math.floor(Date.now()/a)*a;Mn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(s)),(function(e){if(e)return pn.error("Failed to load toolbar",e),void n.setToolbarState(Vo.UNINITIALIZED);n.setToolbarState(Vo.LOADED),n._callLoadToolbar(o)})),Rn(Xt,"turbolinks:load",(function(){n.setToolbarState(Vo.UNINITIALIZED),n.loadToolbar(o)}))}return!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]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Xo=function(){function e(t){a(this,e),l(this,"isPaused",!0),l(this,"queue",[]),l(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&Wt(r.data)&&yn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return yn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Vt(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),ea=Uint8Array,ta=Uint16Array,na=Uint32Array,ra=new ea([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]),ia=new ea([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]),oa=new ea([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aa=function(e,t){for(var n=new ta(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new na(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},sa=aa(ra,2),ua=sa[0],la=sa[1];ua[28]=258,la[258]=28;for(var ca=aa(ia,0)[1],da=new ta(32768),fa=0;fa<32768;++fa){var ha=(43690&fa)>>>1|(21845&fa)<<1;ha=(61680&(ha=(52428&ha)>>>2|(13107&ha)<<2))>>>4|(3855&ha)<<4,da[fa]=((65280&ha)>>>8|(255&ha)<<8)>>>1}var pa=function(e,t,n){for(var r=e.length,i=0,o=new ta(t);i<r;++i)++o[e[i]-1];var a,s=new ta(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ta(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[da[d]>>>u]=l}else for(a=new ta(r),i=0;i<r;++i)a[i]=da[s[e[i]-1]++]>>>15-e[i];return a},ga=new ea(288);for(fa=0;fa<144;++fa)ga[fa]=8;for(fa=144;fa<256;++fa)ga[fa]=9;for(fa=256;fa<280;++fa)ga[fa]=7;for(fa=280;fa<288;++fa)ga[fa]=8;var va=new ea(32);for(fa=0;fa<32;++fa)va[fa]=5;var ma=pa(ga,9,0),ya=pa(va,5,0),_a=function(e){return(e/8>>0)+(7&e&&1)},ba=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ta?ta:e instanceof na?na:ea)(n-t);return r.set(e.subarray(t,n)),r},Ia=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},ka=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},wa=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new ea(0),0];if(1==i){var a=new ea(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],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var h=new ta(f+1),p=Ca(n[c-1],h,0);if(p>t){r=0;var g=0,v=p-t,m=1<<v;for(o.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(h[y]>t))break;g+=m-(1<<p-h[y]),h[y]=t}for(g>>>=v;g>0;){var _=o[r].s;h[_]<t?g-=1<<t-h[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;h[b]==t&&(--h[b],++g)}p=t}return[new ea(h),p]},Ca=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},Sa=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ta(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Aa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ea=function(e,t,n){var r=n.length,i=_a(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ra=function(e,t,n,r,i,o,a,s,u,l,c){Ia(t,c++,n),++i[256];for(var d=wa(i,15),f=d[0],h=d[1],p=wa(o,15),g=p[0],v=p[1],m=Sa(f),y=m[0],_=m[1],b=Sa(g),I=b[0],k=b[1],w=new ta(19),C=0;C<y.length;++C)w[31&y[C]]++;for(C=0;C<I.length;++C)w[31&I[C]]++;for(var S=wa(w,7),A=S[0],E=S[1],R=19;R>4&&!A[oa[R-1]];--R);var M,T,F,x,O=l+5<<3,N=Aa(i,ga)+Aa(o,va)+a,L=Aa(i,f)+Aa(o,g)+a+14+3*R+Aa(w,A)+(2*w[16]+3*w[17]+7*w[18]);if(O<=N&&O<=L)return Ea(t,c,e.subarray(u,u+l));if(Ia(t,c,1+(L<N)),c+=2,L<N){M=pa(f,h,0),T=f,F=pa(g,v,0),x=g;var D=pa(A,E,0);Ia(t,c,_-257),Ia(t,c+5,k-1),Ia(t,c+10,R-4),c+=14;for(C=0;C<R;++C)Ia(t,c+3*C,A[oa[C]]);c+=3*R;for(var P=[y,I],B=0;B<2;++B){var q=P[B];for(C=0;C<q.length;++C){var W=31&q[C];Ia(t,c,D[W]),c+=A[W],W>15&&(Ia(t,c,q[C]>>>5&127),c+=q[C]>>>12)}}}else M=ma,T=ga,F=ya,x=va;for(C=0;C<s;++C)if(r[C]>255){W=r[C]>>>18&31;ka(t,c,M[W+257]),c+=T[W+257],W>7&&(Ia(t,c,r[C]>>>23&31),c+=ra[W]);var G=31&r[C];ka(t,c,F[G]),c+=x[G],G>3&&(ka(t,c,r[C]>>>5&8191),c+=ia[G])}else ka(t,c,M[r[C]]),c+=T[r[C]];return ka(t,c,M[256]),c+T[256]},Ma=new na([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ta=new ea(0),Fa=function(){for(var e=new na(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),xa=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new ea(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=Ea(u,l,e.subarray(c,d)):(u[c]=o,l=Ea(u,l,e.subarray(c,a)))}else{for(var f=Ma[t-1],h=f>>>13,p=8191&f,g=(1<<n)-1,v=new ta(32768),m=new ta(g+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&g},I=new na(25e3),k=new ta(288),w=new ta(32),C=0,S=0,A=(c=0,0),E=0,R=0;c<a;++c){var M=b(c),T=32767&c,F=m[M];if(v[T]=F,m[M]=T,E<=c){var x=a-c;if((C>7e3||A>24576)&&x>423){l=Ra(e,u,0,I,k,w,S,A,R,c-R,l),A=C=S=0,R=c;for(var O=0;O<286;++O)k[O]=0;for(O=0;O<30;++O)w[O]=0}var N=2,L=0,D=p,P=T-F&32767;if(x>2&&M==b(c-P))for(var B=Math.min(h,x)-1,q=Math.min(32767,c),W=Math.min(258,x);P<=q&&--D&&T!=F;){if(e[c+N]==e[c+N-P]){for(var G=0;G<W&&e[c+G]==e[c+G-P];++G);if(G>N){if(N=G,L=P,G>B)break;var U=Math.min(P,G-2),H=0;for(O=0;O<U;++O){var V=c-P+O+32768&32767,$=V-v[V]+32768&32767;$>H&&(H=$,F=V)}}}P+=(T=F)-(F=v[T])+32768&32767}if(L){I[A++]=268435456|la[N]<<18|ca[L];var j=31&la[N],Z=31&ca[L];S+=ra[j]+ia[Z],++k[257+j],++w[Z],E=c+N,++C}else I[A++]=e[c],++k[e[c]]}}l=Ra(e,u,o,I,k,w,S,A,R,c-R,l),o||(l=Ea(u,l,Ta))}return ba(s,0,r+_a(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Oa=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Na(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=Fa[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=xa(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Oa(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),Oa(o,a-8,n.d()),Oa(o,a-4,r),o}var La=!!ln||!!un,Da="text/plain",Pa=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=Nn(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},Ba=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},qa=function(e){var t=e.data,n=e.compression;if(t){if(n===Lr.GZipJS){var r=Na(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ea(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new ea(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return ba(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:Da,body:new Blob([r],{type:Da})}}if(n===Lr.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=En(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Ba(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},Wa=[];ln&&Wa.push({transport:"XHR",method:function(e){var t,n=new ln;n.open(e.method||"GET",e.url,!0);var r=null!==(t=qa(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;yn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)}}),un&&Wa.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=qa(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;yn(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(cn){var l=new cn;u={signal:l.signal,timeout:setTimeout((function(){return l.abort()}),e.timeout)}}un(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){pn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;pn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))}}),null!=on&&on.sendBeacon&&Wa.push({transport:"sendBeacon",method:function(e){var t=Pa(e.url,{beacon:"1"});try{var n,r=null!==(n=qa(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;on.sendBeacon(t,a)}catch(e){}}});var Ga=["retriesPerformedSoFar"];var Ua,Ha=function(){function e(t){var n=this;a(this,e),l(this,"isPolling",!1),l(this,"pollIntervalMs",3e3),l(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Vt(Xt)&&"onLine"in Xt.navigator&&(this.areWeOnline=Xt.navigator.onLine,Xt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),Xt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=c(e,Ga);Kt(r)&&r>0&&(i.url=Pa(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({retriesPerformedSoFar:r},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),pn.warn(i),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.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=g(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){pn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),Va=1800,$a=function(){function e(t,n,r,i){a(this,e),l(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||bi,this._windowIdGenerator=i||bi;var o=t.persistence_name||t.token,s=t.session_idle_timeout_seconds||Va;if(Kt(s)?s>Va?pn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):s<60&&pn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(pn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=Va),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),Va),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Li.parse(this._window_id_storage_key),c=Li.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:Li.remove(this._window_id_storage_key),Li.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Vt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Li.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Li.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Li.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(l({},Zr,[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[Zr];return Wt(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;null==Xt||Xt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Li.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),pn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,h=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,h),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:h}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Ua||(Ua={}));var ja="i.posthog.com",Za=function(){function e(t){a(this,e),l(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ua.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ua.EU:this._regionCache[this.apiHost]=Ua.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost.replace(".".concat(ja),".posthog.com"))+t;if(this.region===Ua.CUSTOM)return this.apiHost+t;var n=ja+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),Ka=u((function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["error"];a(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var a,s,u,l,c;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var d=t.requestRouter.endpointFor("ui","/project/".concat(t.config.token,"/person/").concat(t.get_distinct_id()));e.tags["PostHog Person URL"]=d,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null===(a=e.exception)||void 0===a?void 0:a.values)||[],h={$exception_message:(null===(s=f[0])||void 0===s?void 0:s.value)||e.message,$exception_type:null===(u=f[0])||void 0===u?void 0:u.type,$exception_personURL:d,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null===(l=f[0])||void 0===l?void 0:l.value)||e.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags,$level:e.level};return n&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",h),e}))}}));function za(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||bi()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(ti,"identified")),t()},i=n.user();"then"in i&&Gt(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||pn.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var r;if(!n)return t;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 i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{});return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var Ya=function(){function e(t){a(this,e),this._instance=t}return u(e,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=null!==(e=null==Xt?void 0:Xt.location.pathname)&&void 0!==e?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var n=t.maxScrollHeight,r=t.lastScrollY,i=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,s=t.maxContentY;return Vt(n)||Vt(r)||Vt(i)||Vt(o)||Vt(a)||Vt(s)?{}:(n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),s=Math.ceil(s),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:n<=1?1:Ja(r/n,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:n<=1?1:Ja(i/n,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Ja(a/o,0,1),$prev_pageview_max_content:s,$prev_pageview_max_content_percentage:o<=1?1:Ja(s/o,0,1)})}}]),e}();function Ja(e,t,n){return Math.max(t,Math.min(e,n))}var Qa={icontains:function(e){return!!Xt&&Xt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!Xt&&On(Xt.location.href,e)},exact:function(e){return(null==Xt?void 0:Xt.location.href)===e}},Xa=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=null==fn?void 0:fn.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||Mn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(t){if(t)return pn.error("Could not load surveys script",t);fn.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);var r=this.instance.get_property(Xr);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Xr,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Qa[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==an?void 0:an.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),i=!e.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return n&&r&&i}));return e(r)}),n)}}]),e}(),es=function(){function e(t){var n,r,i=this;a(this,e),l(this,"serverLimits",{}),l(this,"lastEventRateLimited",!1),l(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){pn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),i.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void pn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return u(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(ri))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null===(n=this.instance.persistence)||void 0===n||n.set_property(ri,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ts=function(){return t({initialPathName:(null==sn?void 0:sn.pathname)||"",referringDomain:No.referringDomain()},No.campaignParams())},ns=function(){function e(t,n,r){var i=this;a(this,e),l(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(l({},ni,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ts,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[ni]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),rs=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],is=function(e,t){if(!e)return!1;var n=e.toLowerCase();return rs.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},os=function(){function e(){a(this,e),this.clicks=[]}return u(e,[{key:"isRageClick",value:function(e,t,n){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}();function as(e){var t;return e.id===si||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+si))}var ss=function(){function e(t){var n;a(this,e),l(this,"rageclicks",new os),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Wr])}return u(e,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(pn.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return Vt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(l({},Wr,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;Xt&&an&&(Rn(an,"click",(function(t){return e._onClick(t||(null==Xt?void 0:Xt.event))}),!1,!0),Rn(an,"mousemove",(function(t){return e._onMouseMove(t||(null==Xt?void 0:Xt.event))}),!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&!Un(r,"body");){if(r===n)return!1;if(bn(t,null==Xt?void 0:Xt.getComputedStyle(r).position))return!0;r=jn(r)}return!1}(e.target,["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var n;if(!as(e.target)){var r=this._getProperties(e,"click");null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},r),{},{type:"rageclick"})),this._capture(r)}}},{key:"_onMouseMove",value:function(e){var t=this;as(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(Xt){var t=Xt.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),e}(),us=function(){function e(t){var n=this;a(this,e),l(this,"_updateScrollData",(function(){var e,t,r,i;n.context||(n.context={});var o=n.scrollElement(),a=n.scrollY(),s=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(a),n.context.maxScrollY=Math.max(a,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(s,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(r=n.context.maxContentY)&&void 0!==r?r:0),n.context.maxContentHeight=Math.max(l,null!==(i=n.context.maxContentHeight)&&void 0!==i?i:0)})),this.instance=t}return u(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){null==Xt||Xt.addEventListener("scroll",this._updateScrollData,!0),null==Xt||Xt.addEventListener("scrollend",this._updateScrollData,!0),null==Xt||Xt.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==Xt?void 0:Xt.document.documentElement;var e,t=g(Wt(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==Xt?void 0:Xt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Xt&&(Xt.scrollY||Xt.pageYOffset||Xt.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Xt&&(Xt.scrollX||Xt.pageXOffset||Xt.document.documentElement.scrollLeft)||0}}]),e}(),ls=function(){function e(){a(this,e),l(this,"events",{}),this.events={}}return u(e,[{key:"on",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter((function(e){return e!==t}))}}},{key:"emit",value:function(e,t){var n,r=g(this.events[e]||[]);try{for(r.s();!(n=r.n()).done;){(0,n.value)(t)}}catch(e){r.e(e)}finally{r.f()}var i,o=g(this.events["*"]||[]);try{for(o.s();!(i=o.n()).done;){(0,i.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),cs="$copy_autocapture";function ds(e,t){return t.length>e?t.slice(0,e)+"...":t}var fs,hs=function(){function e(t){a(this,e),l(this,"_initialized",!1),l(this,"_isDisabledServerSide",null),l(this,"rageclicks",new os),l(this,"_elementsChainAsString",!1),this.instance=t}return u(e,[{key:"config",get:function(){var e,t=Ut(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=null===(e=t.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(Xt&&an){var t=function(t){t=t||(null==Xt?void 0:Xt.event);try{e._captureEvent(t)}catch(e){pn.error("Failed to capture event",e)}},n=function(t){t=t||(null==Xt?void 0:Xt.event),e._captureEvent(t,cs)};Rn(an,"submit",t,!1,!0),Rn(an,"change",t,!1,!0),Rn(an,"click",t,!1,!0),this.config.capture_copied_text&&(Rn(an,"copy",n,!1,!0),Rn(an,"cut",n,!1,!0))}}else pn.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(l({},qr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[qr],r=this._isDisabledServerSide;if(jt(r)&&!zt(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Gn(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Kn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&nr(r)&&(t[n]=r)}})),t}},{key:"_getPropertiesFromElement",value:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};$n.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=ds(1024,rr(e)):o.$el_text=ds(1024,Wn(e)));var a=Bn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;yn(e.attributes,(function(n){var r;if((!zn(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&nr(n.value)&&(r=n.name,!$t(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Pn(i).join(" ")),o["attr__"+n.name]=ds(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return Vt(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=this._getEventTarget(e);if(Hn(i)&&(i=i.parentNode||null),"$autocapture"===n&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var o=n===cs;if(i&&Zn(i,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,s,u=[i],l=i;l.parentNode&&!Un(l,"body");)Vn(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d=[],f={},h=!1;if(yn(u,(function(e){var n=Kn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&nr(c)&&c),bn(Bn(e),"ph-no-capture")&&(h=!0),d.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var r=t._getAugmentPropertiesFromElement(e);_n(f,r)})),this.instance.config.mask_all_text||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?d[0].$el_text=rr(i):d[0].$el_text=Wn(i)),c&&(d[0].attr__href=c),h)return!1;var p=_n(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:or(d)}:{$elements:d},null!==(a=d[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=d[0])||void 0===s?void 0:s.$el_text}:{},f);if(n===cs){var g,v=qn(null==Xt||null===(g=Xt.getSelection())||void 0===g?void 0:g.toString()),m=e.type||"clipboard";if(!v)return!1;p.$selected_content=v,p.$copy_type=m}return this.instance.capture(n,p),!0}}}},{key:"isBrowserSupported",value:function(){return Gt(null==an?void 0:an.querySelectorAll)}}]),e}();!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(fs||(fs={}));var ps=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?fs.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===fs.DENIED||this.consent===fs.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?fs.GRANTED:"0"===e?fs.DENIED:fs.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Mi:Ei;var t="localStorage"===e?Ei:Mi;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Tn([null==on?void 0:on.doNotTrack,null==on?void 0:on.msDoNotTrack,fn.doNotTrack],(function(e){return bn([!0,1,"1","yes"],e)}))}}]),e}(),gs={},vs=function(){},ms="posthog",ys=!La&&-1===(null==dn?void 0:dn.indexOf("MSIE"))&&-1===(null==dn?void 0:dn.indexOf("Mozilla")),_s=function(){var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==an?void 0:an.location,n=null==t?void 0:t.hostname,!!$t(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",loaded:vs,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:sn&&$t(null==sn?void 0:sn.search)&&-1!==sn.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Xt||null===(e=Xt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;pn.error(t)},get_device_id:function(e){return e},_onCapture:vs,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always"}},bs=function(e){var t={};Vt(e.process_person)||(t.person_profiles=e.process_person),Vt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Vt(e.cookie_name)||(t.persistence_name=e.cookie_name),Vt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=_n({},t,e);return Wt(e.property_blacklist)&&(Vt(e.property_denylist)?n.property_denylist=e.property_blacklist:Wt(e.property_denylist)?n.property_denylist=[].concat(f(e.property_blacklist),f(e.property_denylist)):pn.error("Invalid value for property_denylist config: "+e.property_denylist)),n},Is=function(){function e(){a(this,e),l(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){pn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),ks=function(){function e(){var t=this;a(this,e),l(this,"webPerformance",new Is),l(this,"_debugEventEmitter",new ls),this.config=_s(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ka,this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new hi(this),this.toolbar=new Qo(this),this.scrollManager=new us(this),this.pageViewManager=new Ya(this),this.surveys=new Xa(this),this.rateLimiter=new es(this),this.requestRouter=new Za(this),this.consent=new ps(this),this.people={set:function(e,n,r){var i=$t(e)?l({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=$t(e)?l({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(function(e){return pn.info("send",e)}))}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==ms){var i,o=null!==(i=gs[r])&&void 0!==i?i:new e;return o._init(t,n,r),gs[r]=o,gs[ms][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(Vt(e)||function(e){return $t(e)&&0===e.trim().length}(e))return pn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return pn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(_n({},_s(),bs(o),{name:a,token:e})),this.compression=o.disable_compression?void 0:Lr.Base64,this.persistence=new Do(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Do(t(t({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Xo((function(e){return i._send_retriable_request(e)})),this._retryQueue=new Ha(this),this.__request_queue=[],this.sessionManager=new $a(this.config,this.persistence),this.sessionPropsManager=new ns(this.sessionManager,this.persistence),this.sessionRecording=new Ko(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new hs(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ss(this),this.heatmaps.startIfEnabled(),Qt.DEBUG=Qt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var s,u,l=this.config.get_device_id(bi()),c=null!==(s=o.bootstrap)&&void 0!==s&&s.isIdentifiedID?l:o.bootstrap.distinctID;this.persistence.set_property(ti,null!==(u=o.bootstrap)&&void 0!==u&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var d,f,h=Object.keys((null===(d=o.bootstrap)||void 0===d?void 0:d.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),p=Object.keys((null===(f=o.bootstrap)||void 0===f?void 0:f.featureFlagPayloads)||{}).filter((function(e){return h[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:p})}if(!this.get_distinct_id()){var g=this.config.get_device_id(bi());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(ti,"anonymous")}return null==Xt||null===(r=Xt.addEventListener)||void 0===r||r.call(Xt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?za(this,(function(){return i._loaded()})):this._loaded(),Gt(this.config._onCapture)&&this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)})),this}},{key:"_afterDecideResponse",value:function(e){var t,n,r,i,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=bn(e.supportedCompression,Lr.GZipJS)?Lr.GZipJS:bn(e.supportedCompression,Lr.Base64)?Lr.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){pn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){an&&e.capture("$pageview",{title:an.title},{send_instantly:!0})}),1),t||(new zo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||mn(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ys?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Pa(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Pa(o.url,{_:(new Date).getTime().toString(),ver:Qt.LIB_VERSION,compression:o.compression});var a=null!==(n=o.transport)&&void 0!==n?n:"XHR",s=null!==(r=null===(i=Tn(Wa,(function(e){return e.transport===a})))||void 0===i?void 0:i.method)&&void 0!==r?r:Wa[0].method;if(!s)throw new Error("No available transport method");s(o)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];mn(e,(function(e){e&&(t=e[0],Wt(t)?o.push(e):Gt(e)?e.call(n):Wt(e)&&"alias"===t?r.push(e):Wt(e)&&-1!==t.indexOf("capture")&&Gt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){mn(e,(function(e){if(Wt(e[0])){var n=t;yn(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(i,this),a(o,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,n,r){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return pn.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!Vt(e)&&$t(e)){if(!dn||this.config.opt_out_useragent_filter||!is(dn,this.config.custom_blocked_useragents)){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&(this.sessionPersistence.update_campaign_params(),this.persistence.set_initial_campaign_params()),this.config.save_referrer&&(this.sessionPersistence.update_referrer_info(),this.persistence.set_initial_referrer_info());var a={uuid:bi(),event:e,properties:this._calculate_event_properties(e,n||{})};if(null==r||!r._noHeatmaps){var s,u=null===(s=this.heatmaps)||void 0===s?void 0:s.getAndClearBuffer();u&&(a.properties.$heatmap_data=u)}o&&(a.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(a.$set=null==r?void 0:r.$set);var l=this._calculate_set_once_properties(null==r?void 0:r.$set_once);l&&(a.$set_once=l),(a=An(a,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==r?void 0:r.timestamp)||new Date,Vt(null==r?void 0:r.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=new Date);var c=t(t({},a.properties.$set),a.$set);Ht(c)||this.setPersonPropertiesForFlags(c),this._debugEventEmitter.emit("eventCaptured",a);var d={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),a}pn.critical("This capture call is ignored due to client rate limiting.")}}else pn.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",(function(t){return e(t.event)}))}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=t({},n);if(i.token=this.config.token,"$snapshot"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var a=No.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,l=s.windowId;i.$session_id=u,i.$window_id=l}if(this.requestRouter.region===Ua.CUSTOM&&(i.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();i=_n(i,c)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=_n(i,d)}if("$pageview"===e&&an&&(i.title=an.title),!Vt(r)){var f=(new Date).getTime()-r;i.$duration=parseFloat((f/1e3).toFixed(3))}dn&&this.config.opt_out_useragent_filter&&(i.$browser_type=is(dn,this.config.custom_blocked_useragents)?"bot":"browser"),(i=_n({},a,this.persistence.properties(),this.sessionPersistence.properties(),i)).$is_identified=this._isIdentified(),Wt(this.config.property_denylist)?yn(this.config.property_denylist,(function(e){delete i[e]})):pn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;return h&&(i=h(i,e)),i.$process_person_profile=this._hasPersonProcessing(),i}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=_n({},this.persistence.get_initial_props(),e||{});return Ht(t)?void 0:t}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},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:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return pn.uninitializedWarning("posthog.identify");if(Kt(e)&&(e=e.toString(),pn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))pn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Pr)&&(this.unregister(Pr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(ti)||"anonymous");e!==r&&o?(this.persistence.set_property(ti,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(ei))}}else pn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},l({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(l({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}}else pn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return pn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(ti,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(bi());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(Dr)?(pn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Vt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Pr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(pn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var n,r,i,o,a=t({},this.config);Ut(e)&&(_n(this.config,bs(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Do(t(t({},this.config),{},{persistence:"sessionStorage"})),Mi.is_supported()&&"true"===Mi.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Qt.DEBUG=!0),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(null!=e&&e.sampling){var t,n,r=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId();null===(n=this.persistence)||void 0===n||n.register(l({},Kr,!0)),pn.info("Session recording started with sampling override for session: ",null==r?void 0:r.sessionId)}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_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ms;return t!==ms&&(t=ms+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(ti))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(ti))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Ht(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Pr])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[ai]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(pn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ai,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==a&&(null===(n=this.persistence)||void 0===n||n.set_disabled(a));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==a&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){!1===e?(null==Xt||Xt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Xt||Xt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Cn(e.prototype[t[n]])}(ks,["identify"]);var ws,Cs;ws=gs[ms]=new ks,(Cs=fn.posthog)&&yn(Cs._i,(function(e){if(e&&Wt(e)){var t=ws.init(e[0],e[1],e[2]),n=Cs[e[2]]||Cs;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),fn.posthog=ws,function(){function e(){e.done||(e.done=!0,ys=!1,yn(gs,(function(e){e._dom_loaded()})))}null!=an&&an.addEventListener&&("complete"===an.readyState?e():an.addEventListener("DOMContentLoaded",e,!1)),Xt&&Rn(Xt,"load",e,!0)}()}();
17
17
  //# sourceMappingURL=array.full.js.map