rozmova-analytics 1.0.20 → 1.0.22

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.
@@ -6,3 +6,4 @@ export declare const getCurrentParams: () => {
6
6
  search_query: any;
7
7
  landing_page_url: any;
8
8
  };
9
+ export declare const storeGeoParam: () => void;
@@ -1,7 +1,7 @@
1
1
  export declare const USER_ID_KEY = "rid";
2
2
  export declare const PARAMS_COOKIE_NAME = "rozmovaAnalyticsParams";
3
3
  export declare const UTM_KEYS: string[];
4
- export declare const GOOGLE_ANALYTICS_ID = "G-9PCTLFE0F6";
4
+ export declare const GOOGLE_ANALYTICS_ID = "G-GYQLL028VQ";
5
5
  export declare const GA_SERVER_CONTAINER_URL = "https://tagging.clearly.help";
6
6
  export declare const MIXPANEL_TOKEN = "9d4cb3d213e5aee689ea01dd68ad65ad";
7
7
  export declare const CUSTOMER_IO_WRITE_KEY = "e6d009719c77519432c3";
package/dist/index.esm.js CHANGED
@@ -11941,7 +11941,7 @@ const UTM_KEYS = [
11941
11941
  "utm_ad_name",
11942
11942
  "utm_keyword",
11943
11943
  ];
11944
- const GOOGLE_ANALYTICS_ID = "G-9PCTLFE0F6";
11944
+ const GOOGLE_ANALYTICS_ID = "G-GYQLL028VQ";
11945
11945
  const GA_SERVER_CONTAINER_URL = "https://tagging.clearly.help";
11946
11946
  const MIXPANEL_TOKEN = "9d4cb3d213e5aee689ea01dd68ad65ad";
11947
11947
  const CUSTOMER_IO_WRITE_KEY = "e6d009719c77519432c3";
@@ -12070,7 +12070,7 @@ const getGAClientId = () => {
12070
12070
  };
12071
12071
  function getGASessionId() {
12072
12072
  // Use your own ID here ↓
12073
- const pattern = /_ga_9PCTLFE0F6=GS\d\.\d\.(.+?)(?:;|$)/;
12073
+ const pattern = /_ga_GYQLL028VQ=GS\d\.\d\.(.+?)(?:;|$)/;
12074
12074
  const match = document.cookie.match(pattern);
12075
12075
  const parts = match?.[1].split(".");
12076
12076
  if (parts)
@@ -12169,6 +12169,13 @@ const getCurrentParams = () => {
12169
12169
  });
12170
12170
  return currentParams;
12171
12171
  };
12172
+ const storeGeoParam = () => {
12173
+ const geo = getQueryParam("geo");
12174
+ if (geo) {
12175
+ const domain = getDomain();
12176
+ api.set("geo", geo, { domain });
12177
+ }
12178
+ };
12172
12179
 
12173
12180
  class Analytics {
12174
12181
  initialized = false;
@@ -12179,6 +12186,7 @@ class Analytics {
12179
12186
  if (this.initialized)
12180
12187
  return;
12181
12188
  insertCustomerIOScript();
12189
+ storeGeoParam();
12182
12190
  const userId = getUserId();
12183
12191
  if (isMetaBrowser()) {
12184
12192
  setQueryParam(USER_ID_KEY, userId);
package/dist/index.js CHANGED
@@ -11943,7 +11943,7 @@ const UTM_KEYS = [
11943
11943
  "utm_ad_name",
11944
11944
  "utm_keyword",
11945
11945
  ];
11946
- const GOOGLE_ANALYTICS_ID = "G-9PCTLFE0F6";
11946
+ const GOOGLE_ANALYTICS_ID = "G-GYQLL028VQ";
11947
11947
  const GA_SERVER_CONTAINER_URL = "https://tagging.clearly.help";
11948
11948
  const MIXPANEL_TOKEN = "9d4cb3d213e5aee689ea01dd68ad65ad";
11949
11949
  const CUSTOMER_IO_WRITE_KEY = "e6d009719c77519432c3";
@@ -12072,7 +12072,7 @@ const getGAClientId = () => {
12072
12072
  };
12073
12073
  function getGASessionId() {
12074
12074
  // Use your own ID here ↓
12075
- const pattern = /_ga_9PCTLFE0F6=GS\d\.\d\.(.+?)(?:;|$)/;
12075
+ const pattern = /_ga_GYQLL028VQ=GS\d\.\d\.(.+?)(?:;|$)/;
12076
12076
  const match = document.cookie.match(pattern);
12077
12077
  const parts = match?.[1].split(".");
12078
12078
  if (parts)
@@ -12171,6 +12171,13 @@ const getCurrentParams = () => {
12171
12171
  });
12172
12172
  return currentParams;
12173
12173
  };
12174
+ const storeGeoParam = () => {
12175
+ const geo = getQueryParam("geo");
12176
+ if (geo) {
12177
+ const domain = getDomain();
12178
+ api.set("geo", geo, { domain });
12179
+ }
12180
+ };
12174
12181
 
12175
12182
  class Analytics {
12176
12183
  initialized = false;
@@ -12181,6 +12188,7 @@ class Analytics {
12181
12188
  if (this.initialized)
12182
12189
  return;
12183
12190
  insertCustomerIOScript();
12191
+ storeGeoParam();
12184
12192
  const userId = getUserId();
12185
12193
  if (isMetaBrowser()) {
12186
12194
  setQueryParam(USER_ID_KEY, userId);
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Analytics=t()}(this,(function(){"use strict";
2
- /*! js-cookie v3.0.5 | MIT */function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var t={read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};var r,n=function t(r,n){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=e({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var i=t[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(n[a]=r.read(s,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}(t,{path:"/"});function o(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function i(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,a).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);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"}(r||(r={}));class c{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function u({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"";const a=n&&l(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function l(e){return e.toLowerCase()}const p="__rrweb_original__";function d(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?l(t):null}function h(e,t){var r;let n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==o?void 0:o[1])&&void 0!==r?r:null}let f=1;const m=new RegExp("[^a-z0-9-_:]");function _(){return f++}let g,y;const v=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,b=/^(?:[a-z+]+:)?\/\//i,S=/^www\..*/i,k=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(v,((e,r,n,o,i,s)=>{const a=n||i||s,c=r||o||"";if(!a)return e;if(b.test(a)||S.test(a))return`url(${c}${a}${c})`;if(k.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const u=t.split("/"),l=a.split("/");u.pop();for(const e of l)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${c}${u.join("/")}${c})`}))}const I=/^[^ \t\n\r\u000c]+/,M=/^[, \t\n\r\u000c]+/;function C(e,t){if(!t||""===t.trim())return t;const r=e.createElement("a");return r.href=t,r.href}function x(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function E(){const e=document.createElement("a");return e.href="",e.href}function O(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?C(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}const o=[];for(;n(M),!(r>=t.length);){let i=n(I);if(","===i.slice(-1))i=C(e,i.substring(0,i.length-1)),o.push(i);else{let n="";i=C(e,i);let s=!1;for(;;){const e=t.charAt(r);if(""===e){o.push((i+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,o.push((i+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return o.join(", ")}(e,n):"style"===r?w(n,E()):"object"===t&&"data"===r?C(e,n):n:C(e,n):n}function T(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&R(e.parentNode,t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&R(e.parentNode,t,r)}function N(e,t,r,n){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(R(o,t,n))return!0;if(r)if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}catch(e){}return!1}function D(e,t){const{doc:n,mirror:o,blockClass:i,blockSelector:a,needsMask:c,inlineStylesheet:h,maskInputOptions:f={},maskTextFn:_,maskInputFn:v,dataURLOptions:b={},inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:M=!1}=t,C=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:r.Document,childNodes:[],compatMode:e.compatMode}:{type:r.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:r.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:h,dataURLOptions:f={},inlineImages:_,recordCanvas:v,keepIframeSrcFn:b,newlyAddedElement:S=!1,rootId:k}=t,I=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,o,i),M=function(e){if(e instanceof HTMLFormElement)return"form";const t=l(e.tagName);return m.test(t)?"div":t}(e);let C={};const R=e.attributes.length;for(let t=0;t<R;t++){const r=e.attributes[t];T(M,r.name,r.value)||(C[r.name]=O(n,M,l(r.name),r.value))}if("link"===M&&a){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let r=null;t&&(r=s(t)),r&&(delete C.rel,delete C.href,C._cssText=w(r,t.href))}if("style"===M&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=s(e.sheet);t&&(C._cssText=w(t,E()))}if("input"===M||"textarea"===M||"select"===M){const t=e.value,r=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&t?C.value=u({element:e,type:d(e),tagName:M,value:t,maskInputOptions:c,maskInputFn:h}):r&&(C.checked=r)}"option"===M&&(e.selected&&!c.select?C.selected=!0:delete C.selected);if("canvas"===M&&v)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const o=t.getImageData,i=p in o?o[p]:o;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){const t=e.toDataURL(f.type,f.quality),r=document.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(f.type,f.quality)&&(C.rr_dataURL=t)}if("img"===M&&_){g||(g=n.createElement("canvas"),y=g.getContext("2d"));const t=e,r=t.crossOrigin;t.crossOrigin="anonymous";const o=()=>{t.removeEventListener("load",o);try{g.width=t.naturalWidth,g.height=t.naturalHeight,y.drawImage(t,0,0),C.rr_dataURL=g.toDataURL(f.type,f.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}r?C.crossOrigin=r:t.removeAttribute("crossorigin")};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===M||"video"===M){const t=C;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}S||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop));if(I){const{width:t,height:r}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==M||b(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src);let N;try{customElements.get(M)&&(N=!0)}catch(e){}return{type:r.Element,tagName:M,attributes:C,childNodes:[],isSVG:x(e)||void 0,needBlock:I,rootId:k,isCustom:N}}(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:h,maskInputOptions:f,maskInputFn:v,dataURLOptions:b,inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:M,rootId:C});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:o,maskTextFn:i,rootId:a}=t,c=e.parentNode&&e.parentNode.tagName;let u=e.textContent;const l="STYLE"===c||void 0,p="SCRIPT"===c||void 0;if(l&&u){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=s(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}u=w(u,E())}p&&(u="SCRIPT_PLACEHOLDER");!l&&!p&&u&&o&&(u=i?i(u,e.parentElement):u.replace(/[\S]/g,"*"));return{type:r.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{needsMask:c,maskTextFn:_,rootId:C});case e.CDATA_SECTION_NODE:return{type:r.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:r.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function L(e){return null==e?"":e.toLowerCase()}function A(e,t){const{doc:n,mirror:s,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:l,skipChild:p=!1,inlineStylesheet:d=!0,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v={},inlineImages:b=!1,recordCanvas:S=!1,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:T=!0}=t;if(!O&&e.childNodes){O=N(e,u,l,void 0===O)}const R=D(e,{doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:x,newlyAddedElement:E});if(!R)return console.warn(e,"not serialized"),null;let q;q=s.hasNode(e)?s.getId(e):!function(e,t){if(t.comment&&e.type===r.Comment)return!0;if(e.type===r.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"===h(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(e.attributes.name)||"icon"===L(e.attributes.rel)||"apple-touch-icon"===L(e.attributes.rel)||"shortcut icon"===L(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===L(e.attributes.name)||"googlebot"===L(e.attributes.name)||"bingbot"===L(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===L(e.attributes.name)||"generator"===L(e.attributes.name)||"framework"===L(e.attributes.name)||"publisher"===L(e.attributes.name)||"progid"===L(e.attributes.name)||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===L(e.attributes.name)||"yandex-verification"===L(e.attributes.name)||"csrf-token"===L(e.attributes.name)||"p:domain_verify"===L(e.attributes.name)||"verify-v1"===L(e.attributes.name)||"verification"===L(e.attributes.name)||"shopify-checkout-api-token"===L(e.attributes.name)))return!0}}return!1}(R,y)&&(T||R.type!==r.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?_():-2;const P=Object.assign(R,{id:q});if(s.add(e,P),-2===q)return null;k&&k(e);let F=!p;if(P.type===r.Element){F=F&&!P.needBlock,delete P.needBlock;const t=e.shadowRoot;t&&i(t)&&(P.isShadowHost=!0)}if((P.type===r.Document||P.type===r.Element)&&F){y.headWhitespace&&P.type===r.Element&&"head"===P.tagName&&(T=!1);const t={doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:p,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x};if(P.type===r.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const r of Array.from(e.childNodes)){const e=A(r,t);e&&P.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const r of Array.from(e.shadowRoot.childNodes)){const n=A(r,t);n&&(i(e.shadowRoot)&&(n.isShadow=!0),P.childNodes.push(n))}}return e.parentNode&&o(e.parentNode)&&i(e.parentNode)&&(P.isShadow=!0),P.type===r.Element&&"iframe"===P.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let o,i=!1;try{o=n.document.readyState}catch(e){return}if("complete"!==o){const n=setTimeout((()=>{i||(t(),i=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),i=!0,t()}))}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&w){const r=A(t,{doc:t,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x});r&&w(e,r)}}),I),P.type===r.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===h(P.attributes.href))&&function(e,t,r){let n,o=!1;try{n=e.sheet}catch(e){return}if(n)return;const i=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(M){const t=A(e,{doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x});t&&M(e,t)}}),C),P}function q(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const P="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.";let F={map:{},getId:()=>(console.error(P),-1),getNode:()=>(console.error(P),null),removeNodeFromMap(){console.error(P)},has:()=>(console.error(P),!1),reset(){console.error(P)}};function U(e,t,r={}){let n=null,o=0;return function(...i){const s=Date.now();o||!1!==r.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(c,i)):n||!1===r.trailing||(n=setTimeout((()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(c,i)}),a))}}function j(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>j(e,t,i||{},!0)}function B(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(F=new Proxy(F,{get:(e,t,r)=>("map"===t&&console.error(P),Reflect.get(e,t,r))}));let $=Date.now;function z(e){var t,r,n,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(r=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null==a?void 0:a.body)||void 0===n?void 0:n.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(i=null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function W(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function V(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function H(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function G(e,t,r,n){if(!e)return!1;const o=H(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(R(o,t,n))return!0}catch(e){}if(r){if(o.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function J(e,t){return-2===t.getId(e)}function K(e,t){if(o(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Q(e){return Boolean(e.changedTouches)}function X(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Y(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Z(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||($=()=>(new Date).getTime());class ee{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(e){var t,r;let n=null;return(null===(r=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function re(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=te(r);)r=t;return r}(e);return t.contains(r)}function ne(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||re(e))}var oe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(oe||{}),ie=(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",e[e.CustomElement=16]="CustomElement",e))(ie||{}),se=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(se||{}),ae=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ae||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{});function ue(e){return"__ln"in e}class le{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ue(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&ue(e.nextSibling)&&e.nextSibling.__ln.previous){const 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++}removeNode(e){const 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--)}}const pe=(e,t)=>`${e}@${t}`;class de{constructor(){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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new le,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{if(!i.parentNode||!ne(i)||"TEXTAREA"===i.parentNode.tagName)return;const s=o(i.parentNode)?this.mirror.getId(te(i)):this.mirror.getId(i.parentNode),a=n(i);if(-1===s||-1===a)return r.addNode(i);const c=A(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{X(e,this.mirror)&&this.iframeManager.addIframe(e),Y(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Z(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});c&&(e.push({parentId:s,nextId:a,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)fe(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)_e(this.droppedSet,e)||fe(this.removes,e,this.mirror)?_e(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let s=null;for(;r.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),r=n(s.value);-1!==t&&-1!==r&&(e=s)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}s=e.previous,r.removeNode(e.value),i(e.value)}const a={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!J(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;G(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:N(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,H(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=d(t);n=u({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(G(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!T(t.tagName,r)&&(o.attributes[r]=O(this.doc,l(t.tagName),l(r),n),"style"===r)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?n:[n,i]:o._unchangedStyles[e]=[n,i]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(G(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=o(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);G(e.target,this.blockClass,this.blockSelector,!1)||J(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(he(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pe(r,n)]?he(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!o(e.target)||!i(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(J(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[pe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);G(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),Z(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function he(e,t){e.delete(t),t.childNodes.forEach((t=>he(e,t)))}function fe(e,t,r){return 0!==e.length&&me(e,t,r)}function me(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return!!e.some((e=>e.id===o))||me(e,n,r)}function _e(e,t){return 0!==e.size&&ge(e,t)}function ge(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||ge(e,r))}let ye;function ve(e){ye=e}function be(){ye=void 0}const Se=e=>{if(!ye)return e;return(...t)=>{try{return e(...t)}catch(e){if(ye&&!0===ye(e))return;throw e}}},ke=[];function we(e){try{if("composedPath"in e){const 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 Ie(e,t){var r,n;const o=new de;ke.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(Se(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Me({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(se).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((i=>{let s=l(i);const u=(t=>i=>{const s=we(i);if(G(s,n,o,!0))return;let a=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=ae.Mouse;break;case"touch":a=ae.Touch;break;case"pen":a=ae.Pen}a===ae.Touch?se[t]===se.MouseDown?u="TouchStart":se[t]===se.MouseUp&&(u="TouchEnd"):ae.Pen}else Q(i)&&(a=ae.Touch);null!==a?(c=a,(u.startsWith("Touch")&&a===ae.Touch||u.startsWith("Mouse")&&a===ae.Mouse)&&(a=null)):se[t]===se.Click&&(a=c,c=null);const l=Q(i)?i.changedTouches[0]:i;if(!l)return;const p=r.getId(s),{clientX:d,clientY:h}=l;Se(e)(Object.assign({type:se[u],id:p,x:d,y:h},null!==a&&{pointerType:a}))})(i);if(window.PointerEvent)switch(se[i]){case se.MouseDown:case se.MouseUp:s=s.replace("mouse","pointer");break;case se.TouchStart:case se.TouchEnd:return}a.push(q(s,u,t))})),Se((()=>{a.forEach((e=>e()))}))}function Ce({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){return q("scroll",Se(U(Se((i=>{const s=we(i);if(!s||G(s,n,o,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=z(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),i.scroll||100)),t)}const xe=["INPUT","TEXTAREA","SELECT"],Ee=new WeakMap;function Oe(e){return function(e,t){if(De("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||De("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||De("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||De("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Te(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Re({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(i=null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=c.set)||void 0===r?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),Se((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Ne(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:p,fontCb:d,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),p(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Ie(e,e.doc));const o=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=U(Se((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),i),u=Se(U(Se((e=>{const t=we(e),{clientX:r,clientY:o}=Q(e)?e.changedTouches[0]:e;s||(s=$()),a.push({x:r,y:o,id:n.getId(t),timeOffset:$()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ie.Drag:e instanceof MouseEvent?ie.MouseMove:ie.TouchMove)})),o,{trailing:!1})),l=[q("mousemove",u,r),q("touchmove",u,r),q("drag",u,r)];return Se((()=>{l.forEach((e=>e()))}))}(e),i=Me(e),s=Ce(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return q("resize",Se(U(Se((()=>{const t=W(),o=V();r===t&&n===o||(e({width:Number(o),height:Number(t)}),r=t,n=o)})),200)),t)}(e,{win:r}),c=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:p}){function h(e){let r=we(e);const l=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=r.parentElement),!r||!h||xe.indexOf(h)<0||G(r,n,o,!0))return;if(r.classList.contains(i)||s&&r.matches(s))return;let m=r.value,_=!1;const g=d(r)||"";"radio"===g||"checkbox"===g?_=r.checked:(a[h.toLowerCase()]||a[g])&&(m=u({element:r,maskInputOptions:a,tagName:h,type:g,value:m,maskInputFn:c})),f(r,p?{text:m,isChecked:_,userTriggered:l}:{text:m,isChecked:_});const y=r.name;"radio"===g&&y&&_&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach((e=>{if(e!==r){const t=e.value;f(e,p?{text:t,isChecked:!_,userTriggered:!1}:{text:t,isChecked:!_})}}))}function f(t,n){const o=Ee.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ee.set(t,n);const o=r.getId(t);Se(e)(Object.assign(Object.assign({},n),{id:o}))}}const m=("last"===l.input?["change"]:["input","change"]).map((e=>q(e,Se(h),t))),_=t.defaultView;if(!_)return()=>{m.forEach((e=>e()))};const g=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),y=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...y.map((e=>j(e[0],e[1],{set(){Se(h)({target:this,isTrusted:!1})}},!1,_)))),Se((()=>{m.forEach((e=>e()))}))}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){const s=Se((i=>U(Se((o=>{const s=we(o);if(!s||G(s,t,r,!0))return;const{currentTime:a,volume:c,muted:u,playbackRate:l,loop:p}=s;e({type:i,id:n.getId(s),currentTime:a,volume:c,muted:u,playbackRate:l,loop:p})})),o.media||500))),a=[q("play",s(0),i),q("pause",s(1),i),q("seeked",s(2),i),q("volumechange",s(3),i),q("ratechange",s(4),i)];return Se((()=>{a.forEach((e=>e()))}))}(e);let p=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(p=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Se(((n,o,i)=>{const[s,a]=i,{id:c,styleId:u}=Te(o,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,adds:[{rule:s,index:a}]}),n.apply(o,i)}))});const i=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),n.apply(o,i)}))}),n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),n.apply(o,i)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),n.apply(o,i)}))}));const c={};Le("CSSGroupingRule")?c.CSSGroupingRule=n.CSSGroupingRule:(Le("CSSMediaRule")&&(c.CSSMediaRule=n.CSSMediaRule),Le("CSSConditionRule")&&(c.CSSConditionRule=n.CSSConditionRule),Le("CSSSupportsRule")&&(c.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(c).forEach((([n,o])=>{u[n]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(u[n].insertRule,{apply:Se(((n,o,i)=>{const[s,a]=i,{id:c,styleId:u}=Te(o.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,adds:[{rule:s,index:[...Oe(o),a||0]}]}),n.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...Oe(o),s]}]}),n.apply(o,i)}))})})),Se((()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule}))}))}(e,{win:r}),h=Re(e,e.doc),f=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Se(((o,s,a)=>{var c;const[u,l,p]=a;if(r.has(u))return i.apply(s,[u,l,p]);const{id:d,styleId:h}=Te(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:u,value:l,priority:p},index:Oe(s.parentRule)}),o.apply(s,a)}))});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Se(((o,i,a)=>{var c;const[u]=a;if(r.has(u))return s.apply(i,[u]);const{id:l,styleId:p}=Te(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||p&&-1!==p)&&e({id:l,styleId:p,remove:{property:u},index:Oe(i.parentRule)}),o.apply(i,a)}))}),Se((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:r}),e.collectFonts&&(m=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){const n=new i(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=B(t.fonts,"add",(function(t){return function(r){return setTimeout(Se((()=>{const t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=i})),n.push(s),Se((()=>{n.forEach((e=>e()))}))}(e)));const _=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e;let s=!0;const a=Se((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:u,endOffset:l}=i;G(s,n,o,!0)||G(u,n,o,!0)||a.push({start:r.getId(s),startOffset:c,end:r.getId(u),endOffset:l})}i({ranges:a})}));return a(),q("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?B(r.customElements,"define",(function(e){return function(r,n,o){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,o])}})):()=>{}}(e),y=[];for(const t of e.plugins)y.push(t.observer(t.callback,r,t.options));return Se((()=>{ke.forEach((e=>e.reset())),null==n||n.disconnect(),o(),i(),s(),a(),c(),l(),p(),h(),f(),m(),_(),g(),y.forEach((e=>e()))}))}function De(e){return void 0!==window[e]}function Le(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ae{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class qe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ae(_),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ae(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case oe.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:oe.IncrementalSnapshot,data:{source:ie.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case oe.Meta:case oe.Load:case oe.DomContentLoaded:return!1;case oe.Plugin:return t;case oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case oe.IncrementalSnapshot:switch(t.data.source){case ie.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case ie.Drag:case ie.TouchMove:case ie.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case ie.ViewportResize:return!1;case ie.MediaInteraction:case ie.MouseInteraction:case ie.Scroll:case ie.CanvasMutation:case ie.Input:return this.replaceIds(t.data,e,["id"]),t;case ie.StyleSheetRule:case ie.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ie.Font:return t;case ie.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case ie.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const o of n)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===r.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Pe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!i(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Ie(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Ce(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Re({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(B(e.prototype,"attachShadow",(function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&ne(this)&&r.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}
2
+ /*! js-cookie v3.0.5 | MIT */function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var t={read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};var r,n=function t(r,n){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=e({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var i=t[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(n[a]=r.read(s,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}(t,{path:"/"});function o(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function i(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,a).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);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"}(r||(r={}));class c{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function u({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"";const a=n&&l(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function l(e){return e.toLowerCase()}const p="__rrweb_original__";function d(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?l(t):null}function h(e,t){var r;let n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==o?void 0:o[1])&&void 0!==r?r:null}let f=1;const m=new RegExp("[^a-z0-9-_:]");function _(){return f++}let g,y;const v=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,b=/^(?:[a-z+]+:)?\/\//i,S=/^www\..*/i,k=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(v,((e,r,n,o,i,s)=>{const a=n||i||s,c=r||o||"";if(!a)return e;if(b.test(a)||S.test(a))return`url(${c}${a}${c})`;if(k.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const u=t.split("/"),l=a.split("/");u.pop();for(const e of l)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${c}${u.join("/")}${c})`}))}const I=/^[^ \t\n\r\u000c]+/,M=/^[, \t\n\r\u000c]+/;function C(e,t){if(!t||""===t.trim())return t;const r=e.createElement("a");return r.href=t,r.href}function x(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function E(){const e=document.createElement("a");return e.href="",e.href}function O(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?C(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}const o=[];for(;n(M),!(r>=t.length);){let i=n(I);if(","===i.slice(-1))i=C(e,i.substring(0,i.length-1)),o.push(i);else{let n="";i=C(e,i);let s=!1;for(;;){const e=t.charAt(r);if(""===e){o.push((i+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,o.push((i+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return o.join(", ")}(e,n):"style"===r?w(n,E()):"object"===t&&"data"===r?C(e,n):n:C(e,n):n}function T(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&R(e.parentNode,t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&R(e.parentNode,t,r)}function N(e,t,r,n){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(R(o,t,n))return!0;if(r)if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}catch(e){}return!1}function D(e,t){const{doc:n,mirror:o,blockClass:i,blockSelector:a,needsMask:c,inlineStylesheet:h,maskInputOptions:f={},maskTextFn:_,maskInputFn:v,dataURLOptions:b={},inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:M=!1}=t,C=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:r.Document,childNodes:[],compatMode:e.compatMode}:{type:r.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:r.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:h,dataURLOptions:f={},inlineImages:_,recordCanvas:v,keepIframeSrcFn:b,newlyAddedElement:S=!1,rootId:k}=t,I=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,o,i),M=function(e){if(e instanceof HTMLFormElement)return"form";const t=l(e.tagName);return m.test(t)?"div":t}(e);let C={};const R=e.attributes.length;for(let t=0;t<R;t++){const r=e.attributes[t];T(M,r.name,r.value)||(C[r.name]=O(n,M,l(r.name),r.value))}if("link"===M&&a){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let r=null;t&&(r=s(t)),r&&(delete C.rel,delete C.href,C._cssText=w(r,t.href))}if("style"===M&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=s(e.sheet);t&&(C._cssText=w(t,E()))}if("input"===M||"textarea"===M||"select"===M){const t=e.value,r=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&t?C.value=u({element:e,type:d(e),tagName:M,value:t,maskInputOptions:c,maskInputFn:h}):r&&(C.checked=r)}"option"===M&&(e.selected&&!c.select?C.selected=!0:delete C.selected);if("canvas"===M&&v)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const o=t.getImageData,i=p in o?o[p]:o;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){const t=e.toDataURL(f.type,f.quality),r=document.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(f.type,f.quality)&&(C.rr_dataURL=t)}if("img"===M&&_){g||(g=n.createElement("canvas"),y=g.getContext("2d"));const t=e,r=t.crossOrigin;t.crossOrigin="anonymous";const o=()=>{t.removeEventListener("load",o);try{g.width=t.naturalWidth,g.height=t.naturalHeight,y.drawImage(t,0,0),C.rr_dataURL=g.toDataURL(f.type,f.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}r?C.crossOrigin=r:t.removeAttribute("crossorigin")};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===M||"video"===M){const t=C;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}S||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop));if(I){const{width:t,height:r}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==M||b(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src);let N;try{customElements.get(M)&&(N=!0)}catch(e){}return{type:r.Element,tagName:M,attributes:C,childNodes:[],isSVG:x(e)||void 0,needBlock:I,rootId:k,isCustom:N}}(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:h,maskInputOptions:f,maskInputFn:v,dataURLOptions:b,inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:M,rootId:C});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:o,maskTextFn:i,rootId:a}=t,c=e.parentNode&&e.parentNode.tagName;let u=e.textContent;const l="STYLE"===c||void 0,p="SCRIPT"===c||void 0;if(l&&u){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=s(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}u=w(u,E())}p&&(u="SCRIPT_PLACEHOLDER");!l&&!p&&u&&o&&(u=i?i(u,e.parentElement):u.replace(/[\S]/g,"*"));return{type:r.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{needsMask:c,maskTextFn:_,rootId:C});case e.CDATA_SECTION_NODE:return{type:r.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:r.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function L(e){return null==e?"":e.toLowerCase()}function A(e,t){const{doc:n,mirror:s,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:l,skipChild:p=!1,inlineStylesheet:d=!0,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v={},inlineImages:b=!1,recordCanvas:S=!1,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:T=!0}=t;if(!O&&e.childNodes){O=N(e,u,l,void 0===O)}const R=D(e,{doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:x,newlyAddedElement:E});if(!R)return console.warn(e,"not serialized"),null;let q;q=s.hasNode(e)?s.getId(e):!function(e,t){if(t.comment&&e.type===r.Comment)return!0;if(e.type===r.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"===h(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(e.attributes.name)||"icon"===L(e.attributes.rel)||"apple-touch-icon"===L(e.attributes.rel)||"shortcut icon"===L(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===L(e.attributes.name)||"googlebot"===L(e.attributes.name)||"bingbot"===L(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===L(e.attributes.name)||"generator"===L(e.attributes.name)||"framework"===L(e.attributes.name)||"publisher"===L(e.attributes.name)||"progid"===L(e.attributes.name)||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===L(e.attributes.name)||"yandex-verification"===L(e.attributes.name)||"csrf-token"===L(e.attributes.name)||"p:domain_verify"===L(e.attributes.name)||"verify-v1"===L(e.attributes.name)||"verification"===L(e.attributes.name)||"shopify-checkout-api-token"===L(e.attributes.name)))return!0}}return!1}(R,y)&&(T||R.type!==r.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?_():-2;const P=Object.assign(R,{id:q});if(s.add(e,P),-2===q)return null;k&&k(e);let F=!p;if(P.type===r.Element){F=F&&!P.needBlock,delete P.needBlock;const t=e.shadowRoot;t&&i(t)&&(P.isShadowHost=!0)}if((P.type===r.Document||P.type===r.Element)&&F){y.headWhitespace&&P.type===r.Element&&"head"===P.tagName&&(T=!1);const t={doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:p,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x};if(P.type===r.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const r of Array.from(e.childNodes)){const e=A(r,t);e&&P.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const r of Array.from(e.shadowRoot.childNodes)){const n=A(r,t);n&&(i(e.shadowRoot)&&(n.isShadow=!0),P.childNodes.push(n))}}return e.parentNode&&o(e.parentNode)&&i(e.parentNode)&&(P.isShadow=!0),P.type===r.Element&&"iframe"===P.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let o,i=!1;try{o=n.document.readyState}catch(e){return}if("complete"!==o){const n=setTimeout((()=>{i||(t(),i=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),i=!0,t()}))}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&w){const r=A(t,{doc:t,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x});r&&w(e,r)}}),I),P.type===r.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===h(P.attributes.href))&&function(e,t,r){let n,o=!1;try{n=e.sheet}catch(e){return}if(n)return;const i=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(M){const t=A(e,{doc:n,mirror:s,blockClass:a,blockSelector:c,needsMask:O,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:T,onSerialize:k,onIframeLoad:w,iframeLoadTimeout:I,onStylesheetLoad:M,stylesheetLoadTimeout:C,keepIframeSrcFn:x});t&&M(e,t)}}),C),P}function q(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const P="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.";let F={map:{},getId:()=>(console.error(P),-1),getNode:()=>(console.error(P),null),removeNodeFromMap(){console.error(P)},has:()=>(console.error(P),!1),reset(){console.error(P)}};function U(e,t,r={}){let n=null,o=0;return function(...i){const s=Date.now();o||!1!==r.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(c,i)):n||!1===r.trailing||(n=setTimeout((()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(c,i)}),a))}}function j(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>j(e,t,i||{},!0)}function B(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(F=new Proxy(F,{get:(e,t,r)=>("map"===t&&console.error(P),Reflect.get(e,t,r))}));let $=Date.now;function z(e){var t,r,n,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(r=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null==a?void 0:a.body)||void 0===n?void 0:n.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(i=null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function W(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function V(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function H(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function G(e,t,r,n){if(!e)return!1;const o=H(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(R(o,t,n))return!0}catch(e){}if(r){if(o.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function J(e,t){return-2===t.getId(e)}function Q(e,t){if(o(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Q(e.parentNode,t))}function K(e){return Boolean(e.changedTouches)}function X(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Y(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Z(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||($=()=>(new Date).getTime());class ee{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(e){var t,r;let n=null;return(null===(r=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function re(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=te(r);)r=t;return r}(e);return t.contains(r)}function ne(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||re(e))}var oe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(oe||{}),ie=(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",e[e.CustomElement=16]="CustomElement",e))(ie||{}),se=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(se||{}),ae=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ae||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{});function ue(e){return"__ln"in e}class le{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ue(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&ue(e.nextSibling)&&e.nextSibling.__ln.previous){const 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++}removeNode(e){const 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--)}}const pe=(e,t)=>`${e}@${t}`;class de{constructor(){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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new le,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{if(!i.parentNode||!ne(i)||"TEXTAREA"===i.parentNode.tagName)return;const s=o(i.parentNode)?this.mirror.getId(te(i)):this.mirror.getId(i.parentNode),a=n(i);if(-1===s||-1===a)return r.addNode(i);const c=A(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{X(e,this.mirror)&&this.iframeManager.addIframe(e),Y(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Z(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});c&&(e.push({parentId:s,nextId:a,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)fe(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)_e(this.droppedSet,e)||fe(this.removes,e,this.mirror)?_e(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let s=null;for(;r.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),r=n(s.value);-1!==t&&-1!==r&&(e=s)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}s=e.previous,r.removeNode(e.value),i(e.value)}const a={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!J(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;G(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:N(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,H(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=d(t);n=u({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(G(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!T(t.tagName,r)&&(o.attributes[r]=O(this.doc,l(t.tagName),l(r),n),"style"===r)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?n:[n,i]:o._unchangedStyles[e]=[n,i]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(G(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=o(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);G(e.target,this.blockClass,this.blockSelector,!1)||J(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(he(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Q(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pe(r,n)]?he(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!o(e.target)||!i(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(J(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[pe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);G(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),Z(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function he(e,t){e.delete(t),t.childNodes.forEach((t=>he(e,t)))}function fe(e,t,r){return 0!==e.length&&me(e,t,r)}function me(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return!!e.some((e=>e.id===o))||me(e,n,r)}function _e(e,t){return 0!==e.size&&ge(e,t)}function ge(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||ge(e,r))}let ye;function ve(e){ye=e}function be(){ye=void 0}const Se=e=>{if(!ye)return e;return(...t)=>{try{return e(...t)}catch(e){if(ye&&!0===ye(e))return;throw e}}},ke=[];function we(e){try{if("composedPath"in e){const 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 Ie(e,t){var r,n;const o=new de;ke.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(Se(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Me({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(se).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((i=>{let s=l(i);const u=(t=>i=>{const s=we(i);if(G(s,n,o,!0))return;let a=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=ae.Mouse;break;case"touch":a=ae.Touch;break;case"pen":a=ae.Pen}a===ae.Touch?se[t]===se.MouseDown?u="TouchStart":se[t]===se.MouseUp&&(u="TouchEnd"):ae.Pen}else K(i)&&(a=ae.Touch);null!==a?(c=a,(u.startsWith("Touch")&&a===ae.Touch||u.startsWith("Mouse")&&a===ae.Mouse)&&(a=null)):se[t]===se.Click&&(a=c,c=null);const l=K(i)?i.changedTouches[0]:i;if(!l)return;const p=r.getId(s),{clientX:d,clientY:h}=l;Se(e)(Object.assign({type:se[u],id:p,x:d,y:h},null!==a&&{pointerType:a}))})(i);if(window.PointerEvent)switch(se[i]){case se.MouseDown:case se.MouseUp:s=s.replace("mouse","pointer");break;case se.TouchStart:case se.TouchEnd:return}a.push(q(s,u,t))})),Se((()=>{a.forEach((e=>e()))}))}function Ce({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){return q("scroll",Se(U(Se((i=>{const s=we(i);if(!s||G(s,n,o,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=z(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),i.scroll||100)),t)}const xe=["INPUT","TEXTAREA","SELECT"],Ee=new WeakMap;function Oe(e){return function(e,t){if(De("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||De("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||De("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||De("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Te(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Re({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(i=null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=c.set)||void 0===r?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),Se((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Ne(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:p,fontCb:d,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),p(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Ie(e,e.doc));const o=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=U(Se((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),i),u=Se(U(Se((e=>{const t=we(e),{clientX:r,clientY:o}=K(e)?e.changedTouches[0]:e;s||(s=$()),a.push({x:r,y:o,id:n.getId(t),timeOffset:$()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ie.Drag:e instanceof MouseEvent?ie.MouseMove:ie.TouchMove)})),o,{trailing:!1})),l=[q("mousemove",u,r),q("touchmove",u,r),q("drag",u,r)];return Se((()=>{l.forEach((e=>e()))}))}(e),i=Me(e),s=Ce(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return q("resize",Se(U(Se((()=>{const t=W(),o=V();r===t&&n===o||(e({width:Number(o),height:Number(t)}),r=t,n=o)})),200)),t)}(e,{win:r}),c=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:p}){function h(e){let r=we(e);const l=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=r.parentElement),!r||!h||xe.indexOf(h)<0||G(r,n,o,!0))return;if(r.classList.contains(i)||s&&r.matches(s))return;let m=r.value,_=!1;const g=d(r)||"";"radio"===g||"checkbox"===g?_=r.checked:(a[h.toLowerCase()]||a[g])&&(m=u({element:r,maskInputOptions:a,tagName:h,type:g,value:m,maskInputFn:c})),f(r,p?{text:m,isChecked:_,userTriggered:l}:{text:m,isChecked:_});const y=r.name;"radio"===g&&y&&_&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach((e=>{if(e!==r){const t=e.value;f(e,p?{text:t,isChecked:!_,userTriggered:!1}:{text:t,isChecked:!_})}}))}function f(t,n){const o=Ee.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ee.set(t,n);const o=r.getId(t);Se(e)(Object.assign(Object.assign({},n),{id:o}))}}const m=("last"===l.input?["change"]:["input","change"]).map((e=>q(e,Se(h),t))),_=t.defaultView;if(!_)return()=>{m.forEach((e=>e()))};const g=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),y=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...y.map((e=>j(e[0],e[1],{set(){Se(h)({target:this,isTrusted:!1})}},!1,_)))),Se((()=>{m.forEach((e=>e()))}))}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){const s=Se((i=>U(Se((o=>{const s=we(o);if(!s||G(s,t,r,!0))return;const{currentTime:a,volume:c,muted:u,playbackRate:l,loop:p}=s;e({type:i,id:n.getId(s),currentTime:a,volume:c,muted:u,playbackRate:l,loop:p})})),o.media||500))),a=[q("play",s(0),i),q("pause",s(1),i),q("seeked",s(2),i),q("volumechange",s(3),i),q("ratechange",s(4),i)];return Se((()=>{a.forEach((e=>e()))}))}(e);let p=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(p=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Se(((n,o,i)=>{const[s,a]=i,{id:c,styleId:u}=Te(o,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,adds:[{rule:s,index:a}]}),n.apply(o,i)}))});const i=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),n.apply(o,i)}))}),n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),n.apply(o,i)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),n.apply(o,i)}))}));const c={};Le("CSSGroupingRule")?c.CSSGroupingRule=n.CSSGroupingRule:(Le("CSSMediaRule")&&(c.CSSMediaRule=n.CSSMediaRule),Le("CSSConditionRule")&&(c.CSSConditionRule=n.CSSConditionRule),Le("CSSSupportsRule")&&(c.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(c).forEach((([n,o])=>{u[n]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(u[n].insertRule,{apply:Se(((n,o,i)=>{const[s,a]=i,{id:c,styleId:u}=Te(o.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,adds:[{rule:s,index:[...Oe(o),a||0]}]}),n.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:Se(((n,o,i)=>{const[s]=i,{id:a,styleId:c}=Te(o.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...Oe(o),s]}]}),n.apply(o,i)}))})})),Se((()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule}))}))}(e,{win:r}),h=Re(e,e.doc),f=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Se(((o,s,a)=>{var c;const[u,l,p]=a;if(r.has(u))return i.apply(s,[u,l,p]);const{id:d,styleId:h}=Te(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:u,value:l,priority:p},index:Oe(s.parentRule)}),o.apply(s,a)}))});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Se(((o,i,a)=>{var c;const[u]=a;if(r.has(u))return s.apply(i,[u]);const{id:l,styleId:p}=Te(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||p&&-1!==p)&&e({id:l,styleId:p,remove:{property:u},index:Oe(i.parentRule)}),o.apply(i,a)}))}),Se((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:r}),e.collectFonts&&(m=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){const n=new i(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=B(t.fonts,"add",(function(t){return function(r){return setTimeout(Se((()=>{const t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=i})),n.push(s),Se((()=>{n.forEach((e=>e()))}))}(e)));const _=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e;let s=!0;const a=Se((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:u,endOffset:l}=i;G(s,n,o,!0)||G(u,n,o,!0)||a.push({start:r.getId(s),startOffset:c,end:r.getId(u),endOffset:l})}i({ranges:a})}));return a(),q("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?B(r.customElements,"define",(function(e){return function(r,n,o){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,o])}})):()=>{}}(e),y=[];for(const t of e.plugins)y.push(t.observer(t.callback,r,t.options));return Se((()=>{ke.forEach((e=>e.reset())),null==n||n.disconnect(),o(),i(),s(),a(),c(),l(),p(),h(),f(),m(),_(),g(),y.forEach((e=>e()))}))}function De(e){return void 0!==window[e]}function Le(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ae{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class qe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ae(_),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ae(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case oe.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:oe.IncrementalSnapshot,data:{source:ie.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case oe.Meta:case oe.Load:case oe.DomContentLoaded:return!1;case oe.Plugin:return t;case oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case oe.IncrementalSnapshot:switch(t.data.source){case ie.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case ie.Drag:case ie.TouchMove:case ie.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case ie.ViewportResize:return!1;case ie.MediaInteraction:case ie.MouseInteraction:case ie.Scroll:case ie.CanvasMutation:case ie.Input:return this.replaceIds(t.data,e,["id"]),t;case ie.StyleSheetRule:case ie.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ie.Font:return t;case ie.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case ie.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const o of n)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===r.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Pe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!i(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Ie(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Ce(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Re({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(B(e.prototype,"attachShadow",(function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&ne(this)&&r.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
5
5
 
@@ -13,7 +13,7 @@
13
13
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
14
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
15
  PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */function Fe(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.apply(e,[])).next())}))}for(var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",je="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Be=0;Be<64;Be++)je[Ue.charCodeAt(Be)]=Be;const $e=new Map;const ze=(e,t,r)=>{if(!e||!He(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=$e.get(e);return r||(r=new Map,$e.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function We(e,t,r){if(e instanceof Array)return e.map((e=>We(e,t,r)));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){const t=e.constructor.name,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=Ue[r[t]>>2],o+=Ue[(3&r[t])<<4|r[t+1]>>4],o+=Ue[(15&r[t+1])<<2|r[t+2]>>6],o+=Ue[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[We(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[We(e.data,t,r),e.width,e.height]}}if(He(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ze(e,t,r)}}return e}const Ve=(e,t,r)=>e.map((e=>We(e,t,r))),He=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ge(e,t,r,n){const o=[];try{const i=B(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!G(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Je(e,t,r,n,o,i,s){const a=[],c=Object.getOwnPropertyNames(e);for(const i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const c=B(e,i,(function(e){return function(...a){const c=e.apply(this,a);if(ze(c,s,this),"tagName"in this.canvas&&!G(this.canvas,n,o,!0)){const e=Ve(a,s,this),n={type:t,property:i,args:e};r(this.canvas,n)}return c}}));a.push(c)}catch(n){const o=j(e,i,{set(e){r(this.canvas,{type:t,property:i,args:[e],setter:!0})}});a.push(o)}return a}var Ke,Qe,Xe=(Ke=function(){!function(){
16
+ ***************************************************************************** */function Fe(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.apply(e,[])).next())}))}for(var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",je="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Be=0;Be<64;Be++)je[Ue.charCodeAt(Be)]=Be;const $e=new Map;const ze=(e,t,r)=>{if(!e||!He(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=$e.get(e);return r||(r=new Map,$e.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function We(e,t,r){if(e instanceof Array)return e.map((e=>We(e,t,r)));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){const t=e.constructor.name,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=Ue[r[t]>>2],o+=Ue[(3&r[t])<<4|r[t+1]>>4],o+=Ue[(15&r[t+1])<<2|r[t+2]>>6],o+=Ue[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[We(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[We(e.data,t,r),e.width,e.height]}}if(He(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ze(e,t,r)}}return e}const Ve=(e,t,r)=>e.map((e=>We(e,t,r))),He=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ge(e,t,r,n){const o=[];try{const i=B(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!G(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Je(e,t,r,n,o,i,s){const a=[],c=Object.getOwnPropertyNames(e);for(const i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const c=B(e,i,(function(e){return function(...a){const c=e.apply(this,a);if(ze(c,s,this),"tagName"in this.canvas&&!G(this.canvas,n,o,!0)){const e=Ve(a,s,this),n={type:t,property:i,args:e};r(this.canvas,n)}return c}}));a.push(c)}catch(n){const o=j(e,i,{set(e){r(this.canvas,{type:t,property:i,args:[e],setter:!0})}});a.push(o)}return a}var Qe,Ke,Xe=(Qe=function(){!function(){
17
17
  /*! *****************************************************************************
18
18
  Copyright (c) Microsoft Corporation.
19
19
 
@@ -28,4 +28,4 @@
28
28
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
29
29
  PERFORMANCE OF THIS SOFTWARE.
30
30
  ***************************************************************************** */
31
- function e(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.apply(e,[])).next())}))}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;var o=function(e){var r,n=new Uint8Array(e),o=n.length,i="";for(r=0;r<o;r+=3)i+=t[n[r]>>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i};const i=new Map,s=new Map,a=self;a.onmessage=function(t){return e(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:t.data.id});{const{id:r,bitmap:n,width:c,height:u,dataURLOptions:l}=t.data,p=function(t,r,n){return e(this,0,void 0,(function*(){const e=`${t}-${r}`;if("OffscreenCanvas"in globalThis){if(s.has(e))return s.get(e);const i=new OffscreenCanvas(t,r);i.getContext("2d");const a=yield i.convertToBlob(n),c=yield a.arrayBuffer(),u=o(c);return s.set(e,u),u}return""}))}(c,u,l),d=new OffscreenCanvas(c,u);d.getContext("2d").drawImage(n,0,0),n.close();const h=yield d.convertToBlob(l),f=h.type,m=yield h.arrayBuffer(),_=o(m);if(!i.has(r)&&(yield p)===_)return i.set(r,_),a.postMessage({id:r});if(i.get(r)===_)return a.postMessage({id:r});a.postMessage({id:r,type:f,base64:_,width:c,height:u}),i.set(r,_)}}))}}()},function(e){return Qe=Qe||function(e){var t=function(e){var t=e.toString().split("\n");t.pop(),t.shift();for(var r=t[0].search(/\S/),n=/(['"])__worker_loader_strict__(['"])/g,o=0,i=t.length;o<i;++o)t[o]=t[o].substring(r).replace(n,"$1use strict$2")+"\n";return t}(e),r=new Blob(t,{type:"application/javascript"});return URL.createObjectURL(r)}(Ke),new Worker(Qe,e)});class Ye{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,n,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:s})}initCanvasFPSObserver(e,t,r,n,o){const i=Ge(t,r,n,!0),s=new Map,a=new Xe;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:i}=e.data;this.mutationCb({id:t,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const c=1e3/e;let u,l=0;const p=e=>{l&&e-l<c||(l=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{G(t,r,n,!0)||e.push(t)})),e})().forEach((e=>Fe(this,0,void 0,(function*(){var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))))),u=requestAnimationFrame(p)};u=requestAnimationFrame(p),this.resetObservers=()=>{i(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Ge(e,t,r,!1),o=function(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=B(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(...i){return G(this.canvas,r,n,!0)||setTimeout((()=>{const r=Ve(i,t,this);e(this.canvas,{type:ce["2D"],property:s,args:r})}),0),o.apply(this,i)}}));o.push(i)}catch(r){const n=j(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:ce["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,n){const o=[];return o.push(...Je(t.WebGLRenderingContext.prototype,ce.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Je(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,r,n,0,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class Ze{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ee,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:a(e),index:t})))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class et{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function tt(e){return Object.assign(Object.assign({},e),{timestamp:$()})}let rt,nt,ot,it=!1;const st=new c;function at(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:_,hooks:g,packFn:y,sampling:v={},dataURLOptions:b={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:w=!1,recordCrossOriginIframes:I=!1,recordAfter:M=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:x=!1,inlineImages:E=!1,plugins:O,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:N}=e;ve(N);const D=!I||window.parent===window;let L=!1;if(!D)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(D&&!t)throw new Error("emit function is required");void 0!==S&&void 0===v.mousemove&&(v.mousemove=S),st.reset();const P=!0===d?{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!==h?h:{password:!0},F=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f}:f||{};let U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let j=0;const B=e=>{for(const t of O||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!L&&(e=y(e)),e};rt=(e,o)=>{var i;if(!(null===(i=ke[0])||void 0===i?void 0:i.isFrozen())||e.type===oe.FullSnapshot||e.type===oe.IncrementalSnapshot&&e.data.source===ie.Mutation||ke.forEach((e=>e.unfreeze())),D)null==t||t(B(e),o);else if(L){const t={type:"rrweb",event:B(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===oe.FullSnapshot)U=e,j=0;else if(e.type===oe.IncrementalSnapshot){if(e.data.source===ie.Mutation&&e.data.isAttachIframe)return;j++;const t=n&&j>=n,o=r&&e.timestamp-U.timestamp>r;(t||o)&&nt(!0)}};const $=e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Mutation},e)}))},H=e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Scroll},e)})),G=e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.CanvasMutation},e)})),J=new Ze({mutationCb:$,adoptedStyleSheetCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.AdoptedStyleSheet},e)}))}),K=new qe({mirror:st,mutationCb:$,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:rt});for(const e of O||[])e.getMirror&&e.getMirror({nodeMirror:st,crossOriginIframeMirror:K.crossOriginIframeMirror,crossOriginIframeStyleMirror:K.crossOriginIframeStyleMirror});const Q=new et;ot=new Ye({recordCanvas:w,mutationCb:G,win:window,blockClass:o,blockSelector:i,mirror:st,sampling:v.canvas,dataURLOptions:b});const ee=new Pe({mutationCb:$,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:P,dataURLOptions:b,maskTextFn:_,maskInputFn:m,recordCanvas:w,inlineImages:E,sampling:v,slimDOMOptions:F,iframeManager:K,stylesheetManager:J,canvasManager:ot,keepIframeSrcFn:T,processedNodeManager:Q},mirror:st});nt=(e=!1)=>{if(!k)return;rt(tt({type:oe.Meta,data:{href:window.location.href,width:V(),height:W()}}),e),J.reset(),ee.init(),ke.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new c,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:k=()=>!1}=t;return A(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===p?{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===p?{password:!0}:p,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:u,recordCanvas:l,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:st,blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:P,maskTextFn:_,slimDOM:F,dataURLOptions:b,recordCanvas:w,inlineImages:E,onSerialize:e=>{X(e,st)&&K.addIframe(e),Y(e,st)&&J.trackLinkElement(e),Z(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{K.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{J.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");rt(tt({type:oe.FullSnapshot,data:{node:t,initialOffset:z(window)}}),e),ke.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,st.getId(document))};try{const e=[],t=e=>{var t;return Se(Ne)({mutationCb:$,mousemoveCb:(e,t)=>rt(tt({type:oe.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.MouseInteraction},e)})),scrollCb:H,viewportResizeCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.ViewportResize},e)})),inputCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Input},e)})),mediaInteractionCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.MediaInteraction},e)})),styleSheetRuleCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.StyleSheetRule},e)})),styleDeclarationCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.StyleDeclaration},e)})),canvasMutationCb:G,fontCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Font},e)})),selectionCb:e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Selection},e)}))},customElementCb:e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.CustomElement},e)}))},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:u,maskTextSelector:l,maskInputOptions:P,inlineStylesheet:p,sampling:v,recordDOM:k,recordCanvas:w,inlineImages:E,userTriggeredOnInput:C,collectFonts:x,doc:e,maskInputFn:m,maskTextFn:_,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:F,dataURLOptions:b,mirror:st,iframeManager:K,stylesheetManager:J,shadowDomManager:ee,processedNodeManager:Q,canvasManager:ot,ignoreCSSAttributes:R,plugins:(null===(t=null==O?void 0:O.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>rt(tt({type:oe.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},g)};K.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{nt(),e.push(t(document)),it=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(q("DOMContentLoaded",(()=>{rt(tt({type:oe.DomContentLoaded,data:{}})),"DOMContentLoaded"===M&&r()}))),e.push(q("load",(()=>{rt(tt({type:oe.Load,data:{}})),"load"===M&&r()}),window))),()=>{e.forEach((e=>e())),Q.destroy(),it=!1,be()}}catch(e){console.warn(e)}}at.addCustomEvent=(e,t)=>{if(!it)throw new Error("please add custom event after start recording");rt(tt({type:oe.Custom,data:{tag:e,payload:t}}))},at.freezePage=()=>{ke.forEach((e=>e.freeze()))},at.takeFullSnapshot=e=>{if(!it)throw new Error("please take full snapshot after start recording");nt(e)},at.mirror=st;var ct,ut=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ut||{}),lt=(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",e[e.CustomElement=16]="CustomElement",e))(lt||{}),pt={DEBUG:!1,LIB_VERSION:"2.58.0"};if("undefined"==typeof window){var dt={hostname:""};ct={navigator:{userAgent:"",onLine:!0},document:{location:dt,referrer:""},screen:{width:0,height:0},location:dt}}else ct=window;var ht,ft,mt,_t=ct.setImmediate,gt=Object.prototype.toString,yt=void 0!==_t?function(e){return _t(e)}:setTimeout;try{Object.defineProperty({},"x",{}),ht=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch(e){ht=function(e,t,r){return e[t]=r,e}}function vt(e,t){mt.add(e,t),ft||(ft=yt(mt.drain))}function bt(e){var t,r=typeof e;return null===e||"object"!==r&&"function"!==r||(t=e.then),"function"==typeof t&&t}function St(){for(var e=0;e<this.chain.length;e++)kt(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function kt(e,t,r){var n,o;try{!1===t?r.reject(e.msg):(n=!0===t?e.msg:t.call(void 0,e.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(o=bt(n))?o.call(n,r.resolve,r.reject):r.resolve(n)}catch(e){r.reject(e)}}function wt(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=bt(e))?vt((function(){var n=new Ct(r);try{t.call(e,(function(){wt.apply(n,arguments)}),(function(){It.apply(n,arguments)}))}catch(e){It.call(n,e)}})):(r.msg=e,r.state=1,r.chain.length>0&&vt(St,r))}catch(e){It.call(new Ct(r),e)}}}function It(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&vt(St,t))}function Mt(e,t,r,n){for(var o=0;o<t.length;o++)!function(o){e.resolve(t[o]).then((function(e){r(o,e)}),n)}(o)}function Ct(e){this.def=e,this.triggered=!1}function xt(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function Et(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new xt(this);this.then=function(e,r){var n={success:"function"!=typeof e||e,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t})),t.chain.push(n),0!==t.state&&vt(St,t),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){wt.call(t,e)}),(function(e){It.call(t,e)}))}catch(e){It.call(t,e)}}mt=function(){var e,t,r;function n(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(o,i){r=new n(o,i),t?t.next=r:e=r,t=r,r=void 0},drain:function(){var r=e;for(e=t=ft=void 0;r;)r.fn.call(r.self),r=r.next}}}();var Ot,Tt=ht({},"constructor",Et,!1);Et.prototype=Tt,ht(Tt,"__NPO__",0,!1),ht(Et,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");t(e)}))})),ht(Et,"reject",(function(e){return new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");r(e)}))})),ht(Et,"all",(function(e){var t=this;return"[object Array]"!==gt.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var o=e.length,i=Array(o),s=0;Mt(t,e,(function(e,t){i[e]=t,++s===o&&r(i)}),n)}))})),ht(Et,"race",(function(e){var t=this;return"[object Array]"!==gt.call(e)?t.reject(TypeError("Not an array")):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");Mt(t,e,(function(e,t){r(t)}),n)}))})),Ot="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:Et;var Rt,Nt,Dt,Lt,At,qt,Pt,Ft,Ut,jt,Bt,$t=864e5,zt=8e3,Wt=Array.prototype,Vt=Function.prototype,Ht=Object.prototype,Gt=Wt.slice,Jt=Ht.toString,Kt=Ht.hasOwnProperty,Qt=ct.console,Xt=ct.navigator,Yt=ct.document,Zt=ct.opera,er=ct.screen,tr=Xt.userAgent,rr=Vt.bind,nr=Wt.forEach,or=Wt.indexOf,ir=Wt.map,sr=Array.isArray,ar={},cr={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ur={log:function(){if(pt.DEBUG&&!cr.isUndefined(Qt)&&Qt)try{Qt.log.apply(Qt,arguments)}catch(e){cr.each(arguments,(function(e){Qt.log(e)}))}},warn:function(){if(pt.DEBUG&&!cr.isUndefined(Qt)&&Qt){var e=["Mixpanel warning:"].concat(cr.toArray(arguments));try{Qt.warn.apply(Qt,e)}catch(t){cr.each(e,(function(e){Qt.warn(e)}))}}},error:function(){if(pt.DEBUG&&!cr.isUndefined(Qt)&&Qt){var e=["Mixpanel error:"].concat(cr.toArray(arguments));try{Qt.error.apply(Qt,e)}catch(t){cr.each(e,(function(e){Qt.error(e)}))}}},critical:function(){if(!cr.isUndefined(Qt)&&Qt){var e=["Mixpanel error:"].concat(cr.toArray(arguments));try{Qt.error.apply(Qt,e)}catch(t){cr.each(e,(function(e){Qt.error(e)}))}}}},lr=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ur,arguments)}},pr=function(e){return{log:lr(ur.log,e),error:lr(ur.error,e),critical:lr(ur.critical,e)}};cr.bind=function(e,t){var r,n;if(rr&&e.bind===rr)return rr.apply(e,Gt.call(arguments,1));if(!cr.isFunction(e))throw new TypeError;return r=Gt.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(Gt.call(arguments)));var o={};o.prototype=e.prototype;var i=new o;o.prototype=null;var s=e.apply(i,r.concat(Gt.call(arguments)));return Object(s)===s?s:i},n},cr.each=function(e,t,r){if(null!=e)if(nr&&e.forEach===nr)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,o=e.length;n<o;n++)if(n in e&&t.call(r,e[n],n,e)===ar)return}else for(var i in e)if(Kt.call(e,i)&&t.call(r,e[i],i,e)===ar)return},cr.extend=function(e){return cr.each(Gt.call(arguments,1),(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},cr.isArray=sr||function(e){return"[object Array]"===Jt.call(e)},cr.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},cr.isArguments=function(e){return!(!e||!Kt.call(e,"callee"))},cr.toArray=function(e){return e?e.toArray?e.toArray():cr.isArray(e)||cr.isArguments(e)?Gt.call(e):cr.values(e):[]},cr.map=function(e,t,r){if(ir&&e.map===ir)return e.map(t,r);var n=[];return cr.each(e,(function(e){n.push(t.call(r,e))})),n},cr.keys=function(e){var t=[];return null===e||cr.each(e,(function(e,r){t[t.length]=r})),t},cr.values=function(e){var t=[];return null===e||cr.each(e,(function(e){t[t.length]=e})),t},cr.include=function(e,t){var r=!1;return null===e?r:or&&e.indexOf===or?-1!=e.indexOf(t):(cr.each(e,(function(e){if(r||(r=e===t))return ar})),r)},cr.includes=function(e,t){return-1!==e.indexOf(t)},cr.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},cr.isObject=function(e){return e===Object(e)&&!cr.isArray(e)},cr.isEmptyObject=function(e){if(cr.isObject(e)){for(var t in e)if(Kt.call(e,t))return!1;return!0}return!1},cr.isUndefined=function(e){return void 0===e},cr.isString=function(e){return"[object String]"==Jt.call(e)},cr.isDate=function(e){return"[object Date]"==Jt.call(e)},cr.isNumber=function(e){return"[object Number]"==Jt.call(e)},cr.isElement=function(e){return!(!e||1!==e.nodeType)},cr.encodeDates=function(e){return cr.each(e,(function(t,r){cr.isDate(t)?e[r]=cr.formatDate(t):cr.isObject(t)&&(e[r]=cr.encodeDates(t))})),e},cr.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},cr.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},cr.strip_empty_properties=function(e){var t={};return cr.each(e,(function(e,r){cr.isString(e)&&e.length>0&&(t[r]=e)})),t},cr.truncate=function(e,t){var r;return"string"==typeof e?r=e.slice(0,t):cr.isArray(e)?(r=[],cr.each(e,(function(e){r.push(cr.truncate(e,t))}))):cr.isObject(e)?(r={},cr.each(e,(function(e,n){r[n]=cr.truncate(e,t)}))):r=e,r},cr.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=r[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},r=function(e,n){var o="",i=0,s="",a="",c=0,u=o,l=[],p=n[e];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(e)),typeof p){case"string":return t(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(o+=" ",l=[],"[object Array]"===Jt.apply(p)){for(c=p.length,i=0;i<c;i+=1)l[i]=r(i,p)||"null";return a=0===l.length?"[]":o?"[\n"+o+l.join(",\n"+o)+"\n"+u+"]":"["+l.join(",")+"]",o=u,a}for(s in p)Kt.call(p,s)&&(a=r(s,p))&&l.push(t(s)+(o?": ":":")+a);return a=0===l.length?"{}":o?"{"+l.join(",")+u+"}":"{"+l.join(",")+"}",o=u,a}};return r("",{"":e})},cr.JSONDecode=(At={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},qt=function(e){var t=new SyntaxError(e);throw t.at=Rt,t.text=Dt,t},Pt=function(e){return e&&e!==Nt&&qt("Expected '"+e+"' instead of '"+Nt+"'"),Nt=Dt.charAt(Rt),Rt+=1,Nt},Ft=function(){var e,t="";for("-"===Nt&&(t="-",Pt("-"));Nt>="0"&&Nt<="9";)t+=Nt,Pt();if("."===Nt)for(t+=".";Pt()&&Nt>="0"&&Nt<="9";)t+=Nt;if("e"===Nt||"E"===Nt)for(t+=Nt,Pt(),"-"!==Nt&&"+"!==Nt||(t+=Nt,Pt());Nt>="0"&&Nt<="9";)t+=Nt,Pt();if(e=+t,isFinite(e))return e;qt("Bad number")},Ut=function(){var e,t,r,n="";if('"'===Nt)for(;Pt();){if('"'===Nt)return Pt(),n;if("\\"===Nt)if(Pt(),"u"===Nt){for(r=0,t=0;t<4&&(e=parseInt(Pt(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof At[Nt])break;n+=At[Nt]}else n+=Nt}qt("Bad string")},jt=function(){for(;Nt&&Nt<=" ";)Pt()},Lt=function(){switch(jt(),Nt){case"{":return function(){var e,t={};if("{"===Nt){if(Pt("{"),jt(),"}"===Nt)return Pt("}"),t;for(;Nt;){if(e=Ut(),jt(),Pt(":"),Object.hasOwnProperty.call(t,e)&&qt('Duplicate key "'+e+'"'),t[e]=Lt(),jt(),"}"===Nt)return Pt("}"),t;Pt(","),jt()}}qt("Bad object")}();case"[":return function(){var e=[];if("["===Nt){if(Pt("["),jt(),"]"===Nt)return Pt("]"),e;for(;Nt;){if(e.push(Lt()),jt(),"]"===Nt)return Pt("]"),e;Pt(","),jt()}}qt("Bad array")}();case'"':return Ut();case"-":return Ft();default:return Nt>="0"&&Nt<="9"?Ft():function(){switch(Nt){case"t":return Pt("t"),Pt("r"),Pt("u"),Pt("e"),!0;case"f":return Pt("f"),Pt("a"),Pt("l"),Pt("s"),Pt("e"),!1;case"n":return Pt("n"),Pt("u"),Pt("l"),Pt("l"),null}qt('Unexpected "'+Nt+'"')}()}},function(e){var t;return Dt=e,Rt=0,Nt=" ",t=Lt(),jt(),Nt&&qt("Syntax error"),t}),cr.base64Encode=function(e){var t,r,n,o,i,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=cr.utf8Encode(e);do{t=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=i>>12&63,n=i>>6&63,o=63&i,l[c++]=s.charAt(t)+s.charAt(r)+s.charAt(n)+s.charAt(o)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u},cr.utf8Encode=function(e){var t,r,n,o,i="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<n;o++){var s=e.charCodeAt(o),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(r>t&&(i+=e.substring(t,r)),i+=a,t=r=o+1)}return r>t&&(i+=e.substring(t,e.length)),i},cr.UUID=(Bt=function(){var e,t=1*new Date;if(ct.performance&&ct.performance.now)e=ct.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)},function(){var e=(er.height*er.width).toString(16);return Bt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,r=tr,n=[],o=0;function i(e,t){var r,o=0;for(r=0;r<t.length;r++)o|=n[r]<<8*r;return e^o}for(e=0;e<r.length;e++)t=r.charCodeAt(e),n.unshift(255&t),n.length>=4&&(o=i(o,n),n=[]);return n.length>0&&(o=i(o,n)),o.toString(16)}()+"-"+e+"-"+Bt()});var dr=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","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"];cr.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<dr.length;t++)if(-1!==e.indexOf(dr[t]))return!0;return!1},cr.HTTPBuildQuery=function(e,t){var r,n,o=[];return cr.isUndefined(t)&&(t="&"),cr.each(e,(function(e,t){r=encodeURIComponent(e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r})),o.join(t)},cr.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var n=r[1];try{n=decodeURIComponent(n)}catch(e){ur.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")},cr.cookie={get:function(e){for(var t=e+"=",r=Yt.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null},parse:function(e){var t;try{t=cr.JSONDecode(cr.cookie.get(e))||{}}catch(e){}return t},set_seconds:function(e,t,r,n,o,i,s){var a="",c="",u="";if(s)a="; domain="+s;else if(n){var l=Sr(Yt.location.hostname);a=l?"; domain=."+l:""}if(r){var p=new Date;p.setTime(p.getTime()+1e3*r),c="; expires="+p.toGMTString()}i&&(o=!0,u="; SameSite=None"),o&&(u+="; secure"),Yt.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+u},set:function(e,t,r,n,o,i,s){var a="",c="",u="";if(s)a="; domain="+s;else if(n){var l=Sr(Yt.location.hostname);a=l?"; domain=."+l:""}if(r){var p=new Date;p.setTime(p.getTime()+24*r*60*60*1e3),c="; expires="+p.toGMTString()}i&&(o=!0,u="; SameSite=None"),o&&(u+="; secure");var d=e+"="+encodeURIComponent(t)+c+"; path=/"+a+u;return Yt.cookie=d,d},remove:function(e,t,r){cr.cookie.set(e,"",-1,t,!1,!1,r)}};var hr=null,fr=function(e,t){if(null!==hr&&!t)return hr;var r=!0;try{e=e||ct.localStorage;var n="__mplss_"+yr(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(r=!1),e.removeItem(n)}catch(e){r=!1}return hr=r,r};cr.localStorage={is_supported:function(e){var t=fr(null,e);return t||ur.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){ur.error("localStorage error: "+e)},get:function(e){try{return ct.localStorage.getItem(e)}catch(e){cr.localStorage.error(e)}return null},parse:function(e){try{return cr.JSONDecode(cr.localStorage.get(e))||{}}catch(e){}return null},set:function(e,t){try{ct.localStorage.setItem(e,t)}catch(e){cr.localStorage.error(e)}},remove:function(e){try{ct.localStorage.removeItem(e)}catch(e){cr.localStorage.error(e)}}},cr.register_event=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,r,n,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(r,n,!!i);else{var s="on"+r,a=t[s];t[s]=function(t,r,n){var o=function(o){if(o=o||e(ct.event)){var i,s,a=!0;return cr.isFunction(n)&&(i=n(o)),s=r.call(t,o),!1!==i&&!1!==s||(a=!1),a}};return o}(t,n,a)}else ur.error("No valid element provided to register_event")}}();var mr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');cr.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(e,r){var n=" "+r+" ";return(" "+e.className+" ").replace(t," ").indexOf(n)>=0}function n(t){if(!Yt.getElementsByTagName)return[];var n,o,i,s,a,c,u,l,p,d,h=t.split(" "),f=[Yt];for(c=0;c<h.length;c++)if((n=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(o=n.split("#"))[0];var m=o[1],_=Yt.getElementById(m);if(!_||i&&_.nodeName.toLowerCase()!=i)return[];f=[_]}else if(n.indexOf(".")>-1){i=(o=n.split("."))[0];var g=o[1];for(i||(i="*"),s=[],a=0,u=0;u<f.length;u++)for(p="*"==i?e(f[u]):f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];for(f=[],d=0,u=0;u<s.length;u++)s[u].className&&cr.isString(s[u].className)&&r(s[u],g)&&(f[d++]=s[u])}else{var y=n.match(mr);if(y){i=y[1];var v,b=y[2],S=y[3],k=y[4];for(i||(i="*"),s=[],a=0,u=0;u<f.length;u++)for(p="*"==i?e(f[u]):f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];switch(f=[],d=0,S){case"=":v=function(e){return e.getAttribute(b)==k};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+k+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+k+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(k)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(k)==e.getAttribute(b).length-k.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(k)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],d=0,u=0;u<s.length;u++)v(s[u])&&(f[d++]=s[u])}else{for(i=n,s=[],a=0,u=0;u<f.length;u++)for(p=f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];f=s}}return f}return function(e){return cr.isElement(e)?[e]:cr.isObject(e)&&!cr.isUndefined(e.length)?e:n.call(this,e)}}();var _r=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],gr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];cr.info={campaignParams:function(e){var t="",r={};return cr.each(_r,(function(n){(t=cr.getQueryParam(Yt.URL,n)).length?r[n]=t:void 0!==e&&(r[n]=e)})),r},clickParams:function(){var e="",t={};return cr.each(gr,(function(r){(e=cr.getQueryParam(Yt.URL,r)).length&&(t[r]=e)})),t},marketingParams:function(){return cr.extend(cr.info.campaignParams(),cr.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=cr.info.searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(null!==t){n.$search_engine=t;var o=cr.getQueryParam(e,r);o.length&&(n.mp_keyword=o)}return n},browser:function(e,t,r){return t=t||"",r||cr.includes(e," OPR/")?cr.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":cr.includes(e,"IEMobile")||cr.includes(e,"WPDesktop")?"Internet Explorer Mobile":cr.includes(e,"SamsungBrowser/")?"Samsung Internet":cr.includes(e,"Edge")||cr.includes(e,"Edg/")?"Microsoft Edge":cr.includes(e,"FBIOS")?"Facebook Mobile":cr.includes(e,"Chrome")?"Chrome":cr.includes(e,"CriOS")?"Chrome iOS":cr.includes(e,"UCWEB")||cr.includes(e,"UCBrowser")?"UC Browser":cr.includes(e,"FxiOS")?"Firefox iOS":cr.includes(t,"Apple")?cr.includes(e,"Mobile")?"Mobile Safari":"Safari":cr.includes(e,"Android")?"Android Mobile":cr.includes(e,"Konqueror")?"Konqueror":cr.includes(e,"Firefox")?"Firefox":cr.includes(e,"MSIE")||cr.includes(e,"Trident/")?"Internet Explorer":cr.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[cr.info.browser(e,t,r)];if(void 0===n)return null;var o=e.match(n);return o?parseFloat(o[o.length-2]):null},os:function(){var e=tr;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return ct.location.href},properties:function(e){return"object"!=typeof e&&(e={}),cr.extend(cr.strip_empty_properties({$os:cr.info.os(),$browser:cr.info.browser(tr,Xt.vendor,Zt),$referrer:Yt.referrer,$referring_domain:cr.info.referringDomain(Yt.referrer),$device:cr.info.device(tr)}),{$current_url:cr.info.currentUrl(),$browser_version:cr.info.browserVersion(tr,Xt.vendor,Zt),$screen_height:er.height,$screen_width:er.width,mp_lib:"web",$lib_version:pt.LIB_VERSION,$insert_id:yr(),time:cr.timestamp()/1e3},cr.strip_empty_properties(e))},people_properties:function(){return cr.extend(cr.strip_empty_properties({$os:cr.info.os(),$browser:cr.info.browser(tr,Xt.vendor,Zt)}),{$browser_version:cr.info.browserVersion(tr,Xt.vendor,Zt)})},mpPageViewProperties:function(){return cr.strip_empty_properties({current_page_title:Yt.title,current_domain:ct.location.hostname,current_url_path:ct.location.pathname,current_url_protocol:ct.location.protocol,current_url_search:ct.location.search})}};var yr=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},vr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,br=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Sr=function(e){var t=br,r=e.split("."),n=r[r.length-1];(n.length>4||"com"===n||"org"===n)&&(t=vr);var o=e.match(t);return o?o[0]:""},kr=null,wr=null;"undefined"!=typeof JSON&&(kr=JSON.stringify,wr=JSON.parse),kr=kr||cr.JSONEncode,wr=wr||cr.JSONDecode,cr.toArray=cr.toArray,cr.isObject=cr.isObject,cr.JSONEncode=cr.JSONEncode,cr.JSONDecode=cr.JSONDecode,cr.isBlockedUA=cr.isBlockedUA,cr.isEmptyObject=cr.isEmptyObject,cr.info=cr.info,cr.info.device=cr.info.device,cr.info.browser=cr.info.browser,cr.info.browserVersion=cr.info.browserVersion,cr.info.properties=cr.info.properties,cr.NPO=Et;function Ir(e,t){Ar(!0,e,t)}function Mr(e,t){Ar(!1,e,t)}function Cr(e,t){return"1"===Lr(e,t)}function xr(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||ct,r=t.navigator||{},n=!1;return cr.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],(function(e){cr.includes([!0,1,"1","yes"],e)&&(n=!0)})),n}(t))return ur.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r="0"===Lr(e,t);return r&&ur.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Er(e){return qr(e,(function(e){return this.get_config(e)}))}function Or(e){return qr(e,(function(e){return this._get_config(e)}))}function Tr(e){return qr(e,(function(e){return this._get_config(e)}))}function Rr(e,t){Nr(t=t||{}).remove(Dr(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Nr(e){return"localStorage"===(e=e||{}).persistenceType?cr.localStorage:cr.cookie}function Dr(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function Lr(e,t){return Nr(t).get(Dr(e,t))}function Ar(e,t,r){cr.isString(t)&&t.length?(Nr(r=r||{}).set(Dr(t,r),e?1:0,cr.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&e&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})):ur.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function qr(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),o=t.call(this,"ignore_dnt"),i=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");n&&(r=xr(n,{ignoreDnt:o,persistenceType:i,persistencePrefix:s,window:a}))}catch(e){ur.error("Unexpected error when checking tracking opt-out status: "+e)}if(!r)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var Pr=pr("lock"),Fr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||Ot};Fr.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(cr.bind((function(r,n){var o=t||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,u=this.storage,l=s+":X",p=s+":Y",d=s+":Z",h=function(e){if((new Date).getTime()-i>c)return Pr.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+o+"]"),u.removeItem(d),u.removeItem(p),void _();setTimeout((function(){try{e()}catch(e){n(e)}}),a*(Math.random()+.1))},f=function(e,t){e()?t():h((function(){f(e,t)}))},m=function(){var e=u.getItem(p);return(!e||e===o)&&(u.setItem(p,o),u.getItem(p)===o||(fr(u,!0)||n(new Error("localStorage support dropped while acquiring lock")),!1))},_=function(){u.setItem(l,o),f(m,(function(){u.getItem(l)!==o?h((function(){u.getItem(p)===o?f((function(){return!u.getItem(d)}),g):_()})):g()}))},g=function(){u.setItem(d,"1");var t=function(){u.removeItem(d),u.getItem(p)===o&&u.removeItem(p),u.getItem(l)===o&&u.removeItem(l)};e().then((function(e){t(),r(e)})).catch((function(e){t(),n(e)}))};try{if(!fr(u,!0))throw new Error("localStorage support check failed");_()}catch(e){n(e)}}),this))};var Ur=function(e){this.storage=e||localStorage};Ur.prototype.init=function(){return Ot.resolve()},Ur.prototype.setItem=function(e,t){return new Ot(cr.bind((function(r,n){try{this.storage.setItem(e,t)}catch(e){n(e)}r()}),this))},Ur.prototype.getItem=function(e){return new Ot(cr.bind((function(t,r){var n;try{n=this.storage.getItem(e)}catch(e){r(e)}t(n)}),this))},Ur.prototype.removeItem=function(e){return new Ot(cr.bind((function(t,r){try{this.storage.removeItem(e)}catch(e){r(e)}t()}),this))};var jr=pr("batch"),Br=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Ur,this.lock=new Fr(e,{storage:t.sharedLockStorage||window.localStorage}),this.queueStorage.init()),this.reportError=t.errorReporter||cr.bind(jr.error,jr),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1};Br.prototype.ensureInit=function(){return this.initialized?Ot.resolve():this.queueStorage.init().then(cr.bind((function(){this.initialized=!0}),this)).catch(cr.bind((function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1}),this))},Br.prototype.enqueue=function(e,t){var r={id:yr(),flushAfter:(new Date).getTime()+2*t,payload:e};if(this.usePersistence){var n=cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){return e.push(r),this.saveToStorage(e)}),this)).then(cr.bind((function(e){return e&&this.memQueue.push(r),e}),this)).catch(cr.bind((function(t){return this.reportError("Error enqueueing item",t,e),!1}),this))}),this);return this.lock.withLock(n,this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!1}),this))}return this.memQueue.push(r),Ot.resolve(!0)},Br.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(r){if(r.length){var n={};cr.each(t,(function(e){n[e.id]=!0}));for(var o=0;o<r.length;o++){var i=r[o];if((new Date).getTime()>i.flushAfter&&!n[i.id]&&(i.orphaned=!0,t.push(i),t.length>=e))break}}return t}),this)):Ot.resolve(t)};var $r=function(e,t){var r=[];return cr.each(e,(function(e){e.id&&!t[e.id]&&r.push(e)})),r};Br.prototype.removeItemsByID=function(e){var t={};if(cr.each(e,(function(e){t[e]=!0})),this.memQueue=$r(this.memQueue,t),this.usePersistence){var r=cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){return e=$r(e,t),this.saveToStorage(e)}),this)).then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){for(var r=0;r<e.length;r++){var n=e[r];if(n.id&&t[n.id])throw new Error("Item not removed from storage")}return!0}),this)).catch(cr.bind((function(t){return this.reportError("Error removing items",t,e),!1}),this))}),this);return this.lock.withLock(r,this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!fr(this.queueStorage.storage,!0)&&r().then(cr.bind((function(e){return e||this.queueStorage.removeItem(this.storageKey).then((function(){return e}))}),this)).catch(cr.bind((function(e){return this.reportError("Error clearing queue",e),!1}),this))}),this))}return Ot.resolve(!0)};var zr=function(e,t){var r=[];return cr.each(e,(function(e){var n=e.id;if(n in t){var o=t[n];null!==o&&(e.payload=o,r.push(e))}else r.push(e)})),r};Br.prototype.updatePayloads=function(e){return this.memQueue=zr(this.memQueue,e),this.usePersistence?this.lock.withLock(cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(t){return t=zr(t,e),this.saveToStorage(t)}),this)).catch(cr.bind((function(t){return this.reportError("Error updating items",e,t),!1}),this))}),this),this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!1}),this)):Ot.resolve(!0)},Br.prototype.readFromStorage=function(){return this.ensureInit().then(cr.bind((function(){return this.queueStorage.getItem(this.storageKey)}),this)).then(cr.bind((function(e){return e&&(e=wr(e),cr.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]}),this)).catch(cr.bind((function(e){return this.reportError("Error retrieving queue",e),[]}),this))},Br.prototype.saveToStorage=function(e){try{var t=kr(e)}catch(e){return this.reportError("Error serializing queue",e),Ot.resolve(!1)}return this.ensureInit().then(cr.bind((function(){return this.queueStorage.setItem(this.storageKey,t)}),this)).then((function(){return!0})).catch(cr.bind((function(e){return this.reportError("Error saving queue",e),!1}),this))},Br.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(cr.bind((function(){return this.queueStorage.removeItem(this.storageKey)}),this)):Ot.resolve()};var Wr=pr("batch"),Vr=function(e,t){this.errorReporter=t.errorReporter,this.queue=new Br(e,{errorReporter:cr.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};Vr.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Vr.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Vr.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Vr.prototype.clear=function(){return this.queue.clear()},Vr.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Vr.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Vr.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(cr.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},Vr.prototype.sendRequestPromise=function(e,t){return new Ot(cr.bind((function(r){this.sendRequest(e,t,r)}),this))},Vr.prototype.flush=function(e){if(this.requestInProgress)return Wr.log("Flush: Request already in progress"),Ot.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=(new Date).getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(cr.bind((function(o){var i=o.length===n,s=[],a={};if(cr.each(o,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=cr.extend({},t.properties,{mp_sent_by_lib_version:pt.LIB_VERSION}));var r=!0,n=e.id;n?(this.itemIdsSentSuccessfully[n]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[n]}),r=!1):this.reportError("[dupe] found item with no ID",{item:e}),r&&s.push(t)}a[e.id]=t}),this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),Ot.resolve();var c=cr.bind((function(){return this.queue.removeItemsByID(cr.map(o,(function(e){return e.id}))).then(cr.bind((function(e){return cr.each(o,cr.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!i?(this.resetFlush(),Ot.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),Ot.resolve())}),this))}),this),u=cr.bind((function(i){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(cr.isObject(i)&&"timeout"===i.error&&(new Date).getTime()-r>=t)return this.reportError("Network timeout; retrying"),this.flush();if(cr.isObject(i)&&(i.httpStatusCode>=500||429===i.httpStatusCode||i.httpStatusCode<=0&&(l=ct.navigator.onLine,!cr.isUndefined(l)&&!l)||"timeout"===i.error)){var s=2*this.flushInterval;return i.retryAfter&&(s=1e3*parseInt(i.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),Ot.resolve()}if(cr.isObject(i)&&413===i.httpStatusCode){if(o.length>1){var u=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,u,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),Ot.resolve()}return this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),c()}return c()}catch(e){this.reportError("Error handling API response",e),this.resetFlush()}var l}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(l.transport="sendBeacon"),Wr.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,l).then(u)}),this)).catch(cr.bind((function(e){this.reportError("Error flushing request queue",e),this.resetFlush()}),this))},Vr.prototype.reportError=function(e,t){if(Wr.error.apply(Wr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){Wr.error(t)}};var Hr=pr("recorder"),Gr=ct.CompressionStream,Jr={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},Kr=new Set([lt.MouseMove,lt.MouseInteraction,lt.Scroll,lt.ViewportResize,lt.Input,lt.TouchMove,lt.MediaInteraction,lt.Drag,lt.Selection]);var Qr=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout,this._onMaxLengthReached=e.onMaxLengthReached,this._rrwebRecord=e.rrwebRecord,this.replayId=e.replayId,this._stopRecording=null,this.seqNo=0,this.replayStartTime=null,this.replayStartUrl=null,this.batchStartUrl=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=$t,this.recordMinMs=0;var t="__mprec_"+this.getConfig("token")+"_"+this.replayId;this.batcher=new Vr(t,{errorReporter:cr.bind(this.reportError,this),flushOnlyOnInterval:!0,libConfig:Jr,sendRequestFunc:cr.bind(this.flushEventsWithOptOut,this),usePersistence:!1})};Qr.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Qr.prototype.get_config=function(e){return this.getConfig(e)},Qr.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>$t&&(this.recordMaxMs=$t,Hr.critical("record_max_ms cannot be greater than "+$t+"ms. Capping value.")),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>zt&&(this.recordMinMs=zt,Hr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.replayStartTime=(new Date).getTime(),this.batchStartUrl=cr.info.currentUrl(),this.replayStartUrl=cr.info.currentUrl(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=cr.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(this._onIdleTimeout,this.getConfig("record_idle_timeout_ms"))}),this),r=this.getConfig("record_block_selector");if(""!==r&&null!==r||(r=void 0),this._stopRecording=this._rrwebRecord({emit:cr.bind((function(e){this.batcher.enqueue(e),function(e){return e.type===ut.IncrementalSnapshot&&Kr.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}}),"function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();t(),this.maxTimeoutId=setTimeout(cr.bind(this._onMaxLengthReached,this),this.recordMaxMs)}else Hr.log("Recording already in progress, skipping startRecording.")},Qr.prototype.stopRecording=function(){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(e){this.reportError("Error with rrweb stopRecording",e)}this._stopRecording=null}this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Qr.prototype.isRrwebStopped=function(){return null===this._stopRecording},Qr.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,cr.bind(this._onOptOut,this))},Qr.prototype._onOptOut=function(e){0===e&&this.stopRecording()},Qr.prototype._sendRequest=function(e,t,r,n){var o=cr.bind((function(t,r){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=cr.info.currentUrl()),n({status:0,httpStatusCode:t.status,responseBody:r,retryAfter:t.headers.get("Retry-After")})}),this);ct.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then((function(e){e.json().then((function(t){o(e,t)})).catch((function(e){n({error:e})}))})).catch((function(e){n({error:e,httpStatusCode:0})}))},Qr.prototype._flushEvents=Er((function(e,t,r){const n=e.length;if(n>0){var o=this.replayId,i=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=i);var s=e[n-1].timestamp-this.replayStartTime,a={$current_url:this.batchStartUrl,$lib_version:pt.LIB_VERSION,batch_start_time:i/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:o,replay_length_ms:s,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},c=cr.JSONEncode(e),u=this._mixpanel.get_property("$device_id");u&&(a.$device_id=u);var l=this._mixpanel.get_property("$user_id");if(l&&(a.$user_id=l),Gr){var p=new Blob([c],{type:"application/json"}).stream().pipeThrough(new Gr("gzip"));new Response(p).blob().then(cr.bind((function(e){a.format="gzip",this._sendRequest(o,a,e,r)}),this))}else a.format="body",this._sendRequest(o,a,c,r)}})),Qr.prototype.reportError=function(e,t){Hr.error.apply(Hr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(t){Hr.error(t)}};var Xr=pr("recorder"),Yr=function(e){this._mixpanel=e,this.activeRecording=null};Yr.prototype.startRecording=function(e){if(!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=cr.bind((function(){Xr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),r=cr.bind((function(){Xr.log("Max recording length reached, stopping recording."),this.resetRecording()}),this);this.activeRecording=new Qr({mixpanelInstance:this._mixpanel,onIdleTimeout:t,onMaxLengthReached:r,replayId:cr.UUID(),rrwebRecord:at}),this.activeRecording.startRecording(e)}else Xr.log("Recording already in progress, skipping startRecording.")},Yr.prototype.stopRecording=function(){this.activeRecording&&(this.activeRecording.stopRecording(),this.activeRecording=null)},Yr.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Yr.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Yr.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),ct.__mp_recorder=Yr;var Zr=function(){};Zr.prototype.create_properties=function(){},Zr.prototype.event_handler=function(){},Zr.prototype.after_track_handler=function(){},Zr.prototype.init=function(e){return this.mp=e,this},Zr.prototype.track=function(e,t,r,n){var o=this,i=cr.dom_query(e);if(0!==i.length)return cr.each(i,(function(e){cr.register_event(e,this.override_event,(function(e){var i={},s=o.create_properties(r,this),a=o.mp.get_config("track_links_timeout");o.event_handler(e,this,i),window.setTimeout(o.track_callback(n,s,i,!0),a),o.mp.track(t,s,o.track_callback(n,s,i))}))}),this),!0;ur.error("The DOM query ("+e+") returned 0 elements")},Zr.prototype.track_callback=function(e,t,r,n){n=n||!1;var o=this;return function(){r.callback_fired||(r.callback_fired=!0,e&&!1===e(n,t)||o.after_track_handler(t,r,n))}},Zr.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):cr.extend({},e)};var en=function(){this.override_event="click"};cr.inherit(en,Zr),en.prototype.create_properties=function(e,t){var r=en.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r},en.prototype.event_handler=function(e,t,r){r.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,r.href=t.href,r.new_tab||e.preventDefault()},en.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var tn=function(){this.override_event="submit"};cr.inherit(tn,Zr),tn.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()},tn.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var rn="$set",nn="$set_once",on="$unset",sn="$add",an="$append",cn="$union",un="$remove",ln={set_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[rn]=n,r},unset_action:function(e){var t={},r=[];return cr.isArray(e)||(e=[e]),cr.each(e,(function(e){this._is_reserved_property(e)||r.push(e)}),this),t[on]=r,t},set_once_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[nn]=n,r},union_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=cr.isArray(e)?e:[e])}),this):n[e]=cr.isArray(t)?t:[t],r[cn]=n,r},append_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[an]=n,r},remove_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[un]=n,r},delete_action:function(){var e={$delete:""};return e}},pn=function(){};cr.extend(pn.prototype,ln),pn.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r},pn.prototype.set=Tr((function(e,t,r){var n=this.set_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),pn.prototype.set_once=Tr((function(e,t,r){var n=this.set_once_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),pn.prototype.unset=Tr((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),pn.prototype.union=Tr((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)})),pn.prototype.delete=Tr((function(e){var t=this.delete_action();return this._send_request(t,e)})),pn.prototype.remove=Tr((function(e,t,r){var n=this.remove_action(e,t);return this._send_request(n,r)})),pn.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var r=cr.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},pn.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},pn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},pn.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},pn.prototype.remove=pn.prototype.remove,pn.prototype.set=pn.prototype.set,pn.prototype.set_once=pn.prototype.set_once,pn.prototype.union=pn.prototype.union,pn.prototype.unset=pn.prototype.unset,pn.prototype.toString=pn.prototype.toString;var dn=function(){};cr.extend(dn.prototype,ln),dn.prototype._init=function(e){this._mixpanel=e},dn.prototype.set=Or((function(e,t,r){var n=this.set_action(e,t);return cr.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[rn]=cr.extend({},cr.info.people_properties(),n[rn]),this._send_request(n,r)})),dn.prototype.set_once=Or((function(e,t,r){var n=this.set_once_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),dn.prototype.unset=Or((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),dn.prototype.increment=Or((function(e,t,r){var n={},o={};return cr.isObject(e)?(cr.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void ur.error("Invalid increment value passed to mixpanel.people.increment - must be a number");o[t]=e}}),this),r=t):(cr.isUndefined(t)&&(t=1),o[e]=t),n[sn]=o,this._send_request(n,r)})),dn.prototype.append=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.append_action(e,t);return this._send_request(n,r)})),dn.prototype.remove=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.remove_action(e,t);return this._send_request(n,r)})),dn.prototype.union=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)})),dn.prototype.track_charge=Or((function(e,t,r){if(cr.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",cr.extend({$amount:e},t),r);ur.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),dn.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},dn.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}ur.error("mixpanel.people.delete_user() requires you to call identify() first")},dn.prototype.toString=function(){return this._mixpanel.toString()+".people"},dn.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(e.$device_id=r),n&&(e.$user_id=n),o&&(e.$had_persisted_distinct_id=o);var i=cr.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:i,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),cr.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),cr.truncate(i,255))},dn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},dn.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},dn.prototype._enqueue=function(e){rn in e?this._mixpanel.persistence._add_to_people_queue(rn,e):nn in e?this._mixpanel.persistence._add_to_people_queue(nn,e):on in e?this._mixpanel.persistence._add_to_people_queue(on,e):sn in e?this._mixpanel.persistence._add_to_people_queue(sn,e):an in e?this._mixpanel.persistence._add_to_people_queue(an,e):un in e?this._mixpanel.persistence._add_to_people_queue(un,e):cn in e?this._mixpanel.persistence._add_to_people_queue(cn,e):ur.error("Invalid call to _enqueue():",e)},dn.prototype._flush_one_queue=function(e,t,r,n){var o=this,i=cr.extend({},this._mixpanel.persistence.load_queue(e)),s=i;cr.isUndefined(i)||!cr.isObject(i)||cr.isEmptyObject(i)||(o._mixpanel.persistence._pop_from_people_queue(e,i),o._mixpanel.persistence.save(),n&&(s=n(i)),t.call(o,s,(function(t,n){0===t&&o._mixpanel.persistence._add_to_people_queue(e,i),cr.isUndefined(r)||r(t,n)})))},dn.prototype._flush=function(e,t,r,n,o,i,s){var a=this;this._flush_one_queue(rn,this.set,e),this._flush_one_queue(nn,this.set_once,n),this._flush_one_queue(on,this.unset,i,(function(e){return cr.keys(e)})),this._flush_one_queue(sn,this.increment,t),this._flush_one_queue(cn,this.union,o);var c=this._mixpanel.persistence.load_queue(an);if(!cr.isUndefined(c)&&cr.isArray(c)&&c.length)for(var u,l=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(an,u),cr.isUndefined(r)||r(e,t)},p=c.length-1;p>=0;p--)c=this._mixpanel.persistence.load_queue(an),u=c.pop(),a._mixpanel.persistence.save(),cr.isEmptyObject(u)||a.append(u,l);var d=this._mixpanel.persistence.load_queue(un);if(!cr.isUndefined(d)&&cr.isArray(d)&&d.length)for(var h,f=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(un,h),cr.isUndefined(s)||s(e,t)},m=d.length-1;m>=0;m--)d=this._mixpanel.persistence.load_queue(un),h=d.pop(),a._mixpanel.persistence.save(),cr.isEmptyObject(h)||a.remove(h,f)},dn.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},dn.prototype.set=dn.prototype.set,dn.prototype.set_once=dn.prototype.set_once,dn.prototype.unset=dn.prototype.unset,dn.prototype.increment=dn.prototype.increment,dn.prototype.append=dn.prototype.append,dn.prototype.remove=dn.prototype.remove,dn.prototype.union=dn.prototype.union,dn.prototype.track_charge=dn.prototype.track_charge,dn.prototype.clear_charges=dn.prototype.clear_charges,dn.prototype.delete_user=dn.prototype.delete_user,dn.prototype.toString=dn.prototype.toString;var hn,fn="__mps",mn="__mpso",_n="__mpus",gn="__mpa",yn="__mpap",vn="__mpr",bn="__mpu",Sn="$people_distinct_id",kn="__alias",wn="__timers",In=[fn,mn,_n,gn,yn,vn,bn,Sn,kn,wn],Mn=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(ur.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&cr.localStorage.is_supported()?this.storage=cr.localStorage:this.storage=cr.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Mn.prototype.properties=function(){var e={};return this.load(),cr.each(this.props,(function(t,r){cr.include(In,r)||(e[r]=t)})),e},Mn.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=cr.extend({},e))}},Mn.prototype.upgrade=function(){var e,t;this.storage===cr.localStorage?(e=cr.cookie.parse(this.name),cr.cookie.remove(this.name),cr.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===cr.cookie&&(t=cr.localStorage.parse(this.name),cr.localStorage.remove(this.name),t&&this.register_once(t))},Mn.prototype.save=function(){this.disabled||this.storage.set(this.name,cr.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Mn.prototype.load_prop=function(e){return this.load(),this.props[e]},Mn.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Mn.prototype.clear=function(){this.remove(),this.props={}},Mn.prototype.register_once=function(e,t,r){return!!cr.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===r?this.default_expiry:r,this.load(),cr.each(e,(function(e,r){this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e)}),this),this.save(),!0)},Mn.prototype.register=function(e,t){return!!cr.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),cr.extend(this.props,e),this.save(),!0)},Mn.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Mn.prototype.update_search_keyword=function(e){this.register(cr.info.searchInfo(e))},Mn.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:cr.info.referringDomain(e)||"$direct"},"")},Mn.prototype.get_referrer_info=function(){return cr.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Mn.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Mn.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Mn.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Mn.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Mn.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Mn.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Mn.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Mn.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),n=t[e],o=this._get_or_create_queue(rn),i=this._get_or_create_queue(nn),s=this._get_or_create_queue(on),a=this._get_or_create_queue(sn),c=this._get_or_create_queue(cn),u=this._get_or_create_queue(un,[]),l=this._get_or_create_queue(an,[]);r===fn?(cr.extend(o,n),this._pop_from_people_queue(sn,n),this._pop_from_people_queue(cn,n),this._pop_from_people_queue(on,n)):r===mn?(cr.each(n,(function(e,t){t in i||(i[t]=e)})),this._pop_from_people_queue(on,n)):r===_n?cr.each(n,(function(e){cr.each([o,i,a,c],(function(t){e in t&&delete t[e]})),cr.each(l,(function(t){e in t&&delete t[e]})),s[e]=!0})):r===gn?(cr.each(n,(function(e,t){t in o?o[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue(on,n)):r===bn?(cr.each(n,(function(e,t){cr.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(on,n)):r===vn?(u.push(n),this._pop_from_people_queue(an,n)):r===yn&&(l.push(n),this._pop_from_people_queue(on,n)),ur.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ur.log(t),this.save()},Mn.prototype._pop_from_people_queue=function(e,t){var r=this.props[this._get_queue_key(e)];cr.isUndefined(r)||cr.each(t,(function(t,n){e===an||e===un?cr.each(r,(function(e){e[n]===t&&delete e[n]})):delete r[n]}),this)},Mn.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Mn.prototype._get_queue_key=function(e){return e===rn?fn:e===nn?mn:e===on?_n:e===sn?gn:e===an?yn:e===un?vn:e===cn?bn:void ur.error("Invalid queue:",e)},Mn.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=cr.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)},Mn.prototype.set_event_timer=function(e,t){var r=this.load_prop(wn)||{};r[e]=t,this.props[wn]=r,this.save()},Mn.prototype.remove_event_timer=function(e){var t=(this.load_prop(wn)||{})[e];return cr.isUndefined(t)||(delete this.props[wn][e],this.save()),t};var Cn,xn=function(e,t){throw new Error(e+" not available in this build.")},En=function(e){return e},On=function(){},Tn="mixpanel",Rn="base64",Nn="$device:",Dn=ct.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Ln=!Dn&&-1===tr.indexOf("MSIE")&&-1===tr.indexOf("Mozilla"),An=null;Xt.sendBeacon&&(An=function(){return Xt.sendBeacon.apply(Xt,arguments)});var qn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Pn={api_host:"https://api-js.mixpanel.com",api_routes:qn,api_method:"POST",api_transport:"XHR",api_payload_format:Rn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:On,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:On,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:$t,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Fn=!1,Un=function(){},jn=function(e,t,r){var n,o=r===Tn?Cn:Cn[r];if(o&&0===hn)n=o;else{if(o&&!cr.isArray(o))return void ur.error("You have already initialized "+r);n=new Un}if(n._cached_groups={},n._init(e,t,r),n.people=new dn,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var i=cr.info.campaignParams(null),s={},a=!1;cr.each(i,(function(e,t){s["initial_"+t]=e,e&&(a=!0)})),a&&n.people.set_once(s)}return pt.DEBUG=pt.DEBUG||n.get_config("debug"),!cr.isUndefined(o)&&cr.isArray(o)&&(n._execute_array.call(n.people,o.people),n._execute_array(o)),n};Un.prototype.init=function(e,t,r){if(cr.isUndefined(r))this.report_error("You must name your new library: init(token, config, name)");else{if(r!==Tn){var n=jn(e,t,r);return Cn[r]=n,n._loaded(),n}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Un.prototype._init=function(e,t,r){t=t||{},this.__loaded=!0,this.config={};var n={};"api_payload_format"in t||(t.api_host||Pn.api_host).match(/\.mixpanel\.com/)&&(n.api_payload_format="json");if(this.set_config(cr.extend({},Pn,n,t,{name:r,token:e,callback_fn:(r===Tn?r:Tn+"."+r)+"._jsc"})),this._jsc=On,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(cr.localStorage.is_supported(!0)&&Dn){if(this.init_batchers(),An&&ct.addEventListener){var o=cr.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);ct.addEventListener("pagehide",(function(e){e.persisted&&o()})),ct.addEventListener("visibilitychange",(function(){"hidden"===Yt.visibilityState&&o()}))}}else this._batch_requests=!1,ur.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),cr.each(this.get_batcher_configs(),(function(e){ur.log("Clearing batch queue "+e.queue_key),cr.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new Mn(this.config),this.unpersisted_superprops={},this._gdpr_init();var i=cr.UUID();this.get_distinct_id()||this.register_once({distinct_id:Nn+i,$device_id:i},"");var s=this.get_config("track_pageview");s&&this._init_url_change_tracking(s),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},Un.prototype.start_session_recording=Er((function(){if(ct.MutationObserver){var e=cr.bind((function(){this._recorder=this._recorder||new ct.__mp_recorder(this),this._recorder.startRecording()}),this);cr.isUndefined(ct.__mp_recorder)?xn(this.get_config("recorder_src"),e):e()}else ur.critical("Browser does not support MutationObserver; skipping session recording")})),Un.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():ur.critical("Session recorder module not loaded")},Un.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},Un.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+cr.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},Un.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},Un.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=cr.info.campaignParams(null);cr.each(e,function(e,t){this.unregister(t)}.bind(this))}},Un.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Yt.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(cr.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Yt.referrer)},Un.prototype._dom_loaded=function(){cr.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||cr.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},Un.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Fn)return this.__dom_loaded_queue.push([e,t]),!1;var r=(new e).init(this);return r.track.apply(r,t)},Un.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=cr.info.currentUrl()),cr.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){ct.addEventListener("popstate",(function(){ct.dispatchEvent(new Event("mp_locationchange"))})),ct.addEventListener("hashchange",(function(){ct.dispatchEvent(new Event("mp_locationchange"))}));var r=ct.history.pushState;"function"==typeof r&&(ct.history.pushState=function(e,t,n){r.call(ct.history,e,t,n),ct.dispatchEvent(new Event("mp_locationchange"))});var n=ct.history.replaceState;"function"==typeof n&&(ct.history.replaceState=function(e,t,r){n.call(ct.history,e,t,r),ct.dispatchEvent(new Event("mp_locationchange"))}),ct.addEventListener("mp_locationchange",function(){var r=cr.info.currentUrl(),n=!1;("full-url"===e?n=r!==t:"url-with-path-and-query-string"===e?n=r.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(n=r.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),n)&&(this.track_pageview()&&(t=r))}.bind(this))}},Un.prototype._prepare_callback=function(e,t){if(cr.isUndefined(e))return null;if(Dn){return function(r){e(r,t)}}var r=this._jsc,n=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+n+"]";return r[n]=function(o){delete r[n],e(o,t)},o},Un.prototype._send_request=function(e,t,r,n){var o=!0;if(Ln)return this.__request_queue.push(arguments),o;var i={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;n||!cr.isFunction(r)&&"string"!=typeof r||(n=r,r=null),r=cr.extend(i,r||{}),Dn||(r.method="GET");var a="POST"===r.method,c=An&&a&&"sendbeacon"===r.transport.toLowerCase(),u=r.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),Dn||(n?t.callback=n:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+cr.HTTPBuildQuery(t);var l=this;if("img"in t){var p=Yt.createElement("img");p.src=e,Yt.body.appendChild(p)}else if(c){try{o=An(e,s)}catch(e){l.report_error(e),o=!1}try{n&&n(o?1:0)}catch(e){l.report_error(e)}}else if(Dn)try{var d=new XMLHttpRequest;d.open(r.method,e,!0);var h=this.get_config("xhr_headers");if(a&&(h["Content-Type"]="application/x-www-form-urlencoded"),cr.each(h,(function(e,t){d.setRequestHeader(t,e)})),r.timeout_ms&&void 0!==d.timeout){d.timeout=r.timeout_ms;var f=(new Date).getTime()}d.withCredentials=!0,d.onreadystatechange=function(){var e;if(4===d.readyState)if(200===d.status){if(n)if(u){var t;try{t=cr.JSONDecode(d.responseText)}catch(e){if(l.report_error(e),!r.ignore_json_errors)return;t=d.responseText}n(t)}else n(Number(d.responseText))}else if(e=d.timeout&&!d.status&&(new Date).getTime()-f>=d.timeout?"timeout":"Bad HTTP status: "+d.status+" "+d.statusText,l.report_error(e),n)if(u){var o=d.responseHeaders||{};n({status:0,httpStatusCode:d.status,error:e,retryAfter:o["Retry-After"]})}else n(0)},d.send(s)}catch(e){l.report_error(e),o=!1}else{var m=Yt.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var _=Yt.getElementsByTagName("script")[0];_.parentNode.insertBefore(m,_)}return o},Un.prototype._execute_array=function(e){var t,r=[],n=[],o=[];cr.each(e,(function(e){e&&(t=e[0],cr.isArray(t)?o.push(e):"function"==typeof e?e.call(this):cr.isArray(e)&&"alias"===t?r.push(e):cr.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?o.push(e):n.push(e))}),this);var i=function(e,t){cr.each(e,(function(e){if(cr.isArray(e[0])){var r=t;cr.each(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};i(r,this),i(n,this),i(o,this)},Un.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Un.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},Un.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=cr.bind((function(e){return new Vr(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:cr.bind((function(t,r,n){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),r,this._prepare_callback(n,t))}),this),beforeSendHook:cr.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:cr.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},Un.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,cr.each(this.request_batchers,(function(e){e.start()})))},Un.prototype.stop_batch_senders=function(){this._batch_requests=!1,cr.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},Un.prototype.push=function(e){this._execute_array([e])},Un.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Un.prototype._encode_data_for_request=function(e){var t=cr.JSONEncode(e);return this.get_config("api_payload_format")===Rn&&(t=cr.base64Encode(t)),{data:t}},Un.prototype._track_or_batch=function(e,t){var r=cr.truncate(e.data,255),n=e.endpoint,o=e.batcher,i=e.should_send_immediately,s=e.send_request_options||{};t=t||On;var a=!0,c=cr.bind((function(){return s.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(ur.log("MIXPANEL REQUEST:"),ur.log(r),this._send_request(n,this._encode_data_for_request(r),s,this._prepare_callback(t,r))):null}),this);return this._batch_requests&&!i?o.enqueue(r).then((function(e){e?t(1,r):c()})):a=c(),a&&r},Un.prototype.track=Er((function(e,t,r,n){n||"function"!=typeof r||(n=r,r=null);var o=(r=r||{}).transport;o&&(r.transport=o);var i=r.send_immediately;if("function"!=typeof n&&(n=On),cr.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=cr.extend({},t)).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!cr.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?cr.info.marketingParams():{};t=cr.extend({},cr.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");cr.isArray(u)?cr.each(u,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+u);var l={event:e,properties:t};return this._track_or_batch({type:"events",data:l,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:i,send_request_options:r},n)}n(0)}})),Un.prototype.set_group=Er((function(e,t,r){cr.isArray(t)||(t=[t]);var n={};return n[e]=t,this.register(n),this.people.set(e,t,r)})),Un.prototype.add_group=Er((function(e,t,r){var n=this.get_property(e),o={};return void 0===n?(o[e]=[t],this.register(o)):-1===n.indexOf(t)&&(n.push(t),o[e]=n,this.register(o)),this.people.union(e,t,r)})),Un.prototype.remove_group=Er((function(e,t,r){var n=this.get_property(e);if(void 0!==n){var o=n.indexOf(t);o>-1&&(n.splice(o,1),this.register({group_key:n})),0===n.length&&this.unregister(e)}return this.people.remove(e,t,r)})),Un.prototype.track_with_groups=Er((function(e,t,r,n){var o=cr.extend({},t||{});return cr.each(r,(function(e,t){null!=e&&(o[t]=e)})),this.track(e,o,n)})),Un.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Un.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Un.prototype.get_group=function(e,t){var r=this._create_map_key(e,t),n=this._cached_groups[r];return void 0!==n&&n._group_key===e&&n._group_id===t||((n=new pn)._init(this,e,t),this._cached_groups[r]=n),n},Un.prototype.track_pageview=Er((function(e,t){"object"!=typeof e&&(e={});var r=(t=t||{}).event_name||"$mp_web_page_view",n=cr.extend(cr.info.mpPageViewProperties(),cr.info.campaignParams(),cr.info.clickParams()),o=cr.extend({},n,e);return this.track(r,o)})),Un.prototype.track_links=function(){return this._track_dom.call(this,en,arguments)},Un.prototype.track_forms=function(){return this._track_dom.call(this,tn,arguments)},Un.prototype.time_event=function(e){cr.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Bn={persistent:!0},$n=function(e){var t;return t=cr.isObject(e)?e:cr.isUndefined(e)?{}:{days:e},cr.extend({},Bn,t)};Un.prototype.register=function(e,t){var r=$n(t);r.persistent?this.persistence.register(e,r.days):cr.extend(this.unpersisted_superprops,e)},Un.prototype.register_once=function(e,t,r){var n=$n(r);n.persistent?this.persistence.register_once(e,t,n.days):(void 0===t&&(t="None"),cr.each(e,(function(e,r){this.unpersisted_superprops.hasOwnProperty(r)&&this.unpersisted_superprops[r]!==t||(this.unpersisted_superprops[r]=e)}),this))},Un.prototype.unregister=function(e,t){(t=$n(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},Un.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)},Un.prototype.identify=function(e,t,r,n,o,i,s,a){var c=this.get_distinct_id();if(e&&c!==e){if("string"==typeof e&&0===e.indexOf(Nn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==c&&e!==this.get_property(kn)&&(this.unregister(kn),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,r,n,o,i,s,a),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},Un.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=cr.UUID();this.register_once({distinct_id:Nn+e,$device_id:e},"")},Un.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Un.prototype.alias=function(e,t){if(e===this.get_property(Sn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return cr.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(kn,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){r.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Un.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Un.prototype.set_config=function(e){cr.isObject(e)&&(cr.extend(this.config,e),e.batch_size&&cr.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),pt.DEBUG=pt.DEBUG||this.get_config("debug"))},Un.prototype.get_config=function(e){return this.config[e]},Un.prototype._run_hook=function(e){var t=(this.config.hooks[e]||En).apply(this,Gt.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},Un.prototype.get_property=function(e){return this.persistence.load_prop([e])},Un.prototype.toString=function(){var e=this.get_config("name");return e!==Tn&&(e=Tn+"."+e),e},Un.prototype._event_is_disabled=function(e){return cr.isBlockedUA(tr)||this._flags.disable_all_events||cr.include(this.__disabled_events,e)},Un.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&cr.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!cr.cookie.get("mp_optout")||(cr.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Un.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},Un.prototype._gdpr_call_func=function(e,t){return t=cr.extend({track:cr.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),cr.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},Un.prototype.opt_in_tracking=function(e){e=cr.extend({enable_persistence:!0},e),this._gdpr_call_func(Ir,e),this._gdpr_update_persistence(e)},Un.prototype.opt_out_tracking=function(e){(e=cr.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Mr,e),this._gdpr_update_persistence(e)},Un.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(Cr,e)},Un.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(xr,e)},Un.prototype.clear_opt_in_out_tracking=function(e){e=cr.extend({enable_persistence:!0},e),this._gdpr_call_func(Rr,e),this._gdpr_update_persistence(e)},Un.prototype.report_error=function(e,t){ur.error.apply(ur.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){ur.error(t)}},Un.prototype.init=Un.prototype.init,Un.prototype.reset=Un.prototype.reset,Un.prototype.disable=Un.prototype.disable,Un.prototype.time_event=Un.prototype.time_event,Un.prototype.track=Un.prototype.track,Un.prototype.track_links=Un.prototype.track_links,Un.prototype.track_forms=Un.prototype.track_forms,Un.prototype.track_pageview=Un.prototype.track_pageview,Un.prototype.register=Un.prototype.register,Un.prototype.register_once=Un.prototype.register_once,Un.prototype.unregister=Un.prototype.unregister,Un.prototype.identify=Un.prototype.identify,Un.prototype.alias=Un.prototype.alias,Un.prototype.name_tag=Un.prototype.name_tag,Un.prototype.set_config=Un.prototype.set_config,Un.prototype.get_config=Un.prototype.get_config,Un.prototype.get_property=Un.prototype.get_property,Un.prototype.get_distinct_id=Un.prototype.get_distinct_id,Un.prototype.toString=Un.prototype.toString,Un.prototype.opt_out_tracking=Un.prototype.opt_out_tracking,Un.prototype.opt_in_tracking=Un.prototype.opt_in_tracking,Un.prototype.has_opted_out_tracking=Un.prototype.has_opted_out_tracking,Un.prototype.has_opted_in_tracking=Un.prototype.has_opted_in_tracking,Un.prototype.clear_opt_in_out_tracking=Un.prototype.clear_opt_in_out_tracking,Un.prototype.get_group=Un.prototype.get_group,Un.prototype.set_group=Un.prototype.set_group,Un.prototype.add_group=Un.prototype.add_group,Un.prototype.remove_group=Un.prototype.remove_group,Un.prototype.track_with_groups=Un.prototype.track_with_groups,Un.prototype.start_batch_senders=Un.prototype.start_batch_senders,Un.prototype.stop_batch_senders=Un.prototype.stop_batch_senders,Un.prototype.start_session_recording=Un.prototype.start_session_recording,Un.prototype.stop_session_recording=Un.prototype.stop_session_recording,Un.prototype.get_session_recording_properties=Un.prototype.get_session_recording_properties,Un.prototype.get_session_replay_url=Un.prototype.get_session_replay_url,Un.prototype.DEFAULT_API_ROUTES=qn,Mn.prototype.properties=Mn.prototype.properties,Mn.prototype.update_search_keyword=Mn.prototype.update_search_keyword,Mn.prototype.update_referrer_info=Mn.prototype.update_referrer_info,Mn.prototype.get_cross_subdomain=Mn.prototype.get_cross_subdomain,Mn.prototype.clear=Mn.prototype.clear;var zn={},Wn=function(){Cn.init=function(e,t,r){if(r)return Cn[r]||(Cn[r]=zn[r]=jn(e,t,r),Cn[r]._loaded()),Cn[r];var n=Cn;zn[Tn]?n=zn[Tn]:e&&((n=jn(e,t,Tn))._loaded(),zn[Tn]=n),Cn=n,1===hn&&(ct[Tn]=Cn),cr.each(zn,(function(e,t){t!==Tn&&(Cn[t]=e)})),Cn._=cr}};var Vn=(xn=function(e,t){t()},hn=0,Cn=new Un,Wn(),Cn.init(),function(){function e(){e.done||(e.done=!0,Fn=!0,Ln=!1,cr.each(zn,(function(e){e._dom_loaded()})))}if(Yt.addEventListener)"complete"===Yt.readyState?e():Yt.addEventListener("DOMContentLoaded",e,!1);else if(Yt.attachEvent){Yt.attachEvent("onreadystatechange",e);var t=!1;try{t=null===ct.frameElement}catch(e){}Yt.documentElement.doScroll&&t&&function t(){try{Yt.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}()}cr.register_event(ct,"load",e,!0)}(),Cn);const Hn="rid",Gn="rozmovaAnalyticsParams",Jn=["utm_source","utm_medium","utm_campaign","utm_campaign_id","utm_advertiser_id","utm_adset_id","utm_adset_name","utm_ad_id","utm_ad_name","utm_keyword"],Kn="G-9PCTLFE0F6",Qn="https://tagging.clearly.help",Xn=["en","uk","pl","es","ru"];function Yn(){const e=navigator.userAgent;return e.indexOf("Edg")>-1?"Microsoft Edge":e.indexOf("Chrome")>-1?"Chrome":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("Safari")>-1?"Safari":e.indexOf("Opera")>-1?"Opera":e.indexOf("Trident")>-1||e.indexOf("MSIE")>-1?"Internet Explorer":"Unknown"}function Zn(){const e=navigator.userAgent;return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)?"Mobile":"Desktop"}function eo(){const e=navigator.userAgent;return e.includes("Win")?"Windows":e.includes("Mac")?"macOS":e.includes("X11")||e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("like Mac")?"iOS":"Unknown OS"}const to=()=>{const e=window.location.hostname.split("."),t=e.length;return 1===e.length?e[0]:e.slice(t-2,t).join(".")},ro=()=>{const e=document.referrer;if(e){if(new URL(e).hostname.includes(to()))return null}return e};function no(){const e=ro();if(!e)return null;const t={"google.com":"q","bing.com":"q","yahoo.com":"p","duckduckgo.com":"q","ask.com":"q","baidu.com":"wd","yandex.com":"text"},r=new URL(e);for(const[e,n]of Object.entries(t))if(r.hostname.includes(e)){const e=r.searchParams.get(n);return e?decodeURIComponent(e):null}return null}const oo=()=>{const e=n.get("_ga");if(!e)return"";const t=e.split(".");return t[2]+"."+t[3]};function io(){const e=document.cookie.match(/_ga_9PCTLFE0F6=GS\d\.\d\.(.+?)(?:;|$)/),t=e?.[1].split(".");return t?t[0]:null}const so=()=>{const e=window.location.pathname.split("/")[1];return Xn.includes(e)?e:window.location.hostname.includes("clearly")?"en":"uk"};const ao=e=>{const t=to();n.set(Hn,e,{domain:t}),localStorage.setItem(Hn,e)},co=()=>{const e=((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))();return ao(e),e},uo=()=>{const e=(t=Hn,new URLSearchParams(window.location.search).get(t));var t;return e&&ao(e),e||localStorage.getItem(Hn)||n.get(Hn)||co()};var lo=new class{initialized=!1;locale="uk";platform="web";dataLayer=[];init(e,t){if(this.initialized)return;!function(){const e=document.createElement("script");e.type="text/javascript",e.text='\n (function(){\n var analytics = window.analytics = window.analytics || [];\n if (!analytics.initialize) \n if (analytics.invoked) \n window.console && console.error && console.error("Snippet included twice.");\n else {\n analytics.invoked = !0;\n analytics.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on", "addSourceMiddleware", "addIntegrationMiddleware", "setAnonymousId", "addDestinationMiddleware"];\n analytics.factory = function(e) {\n return function() {\n var t = Array.prototype.slice.call(arguments);\n t.unshift(e);\n analytics.push(t);\n return analytics;\n }\n };\n for (var e = 0; e < analytics.methods.length; e++) {\n var key = analytics.methods[e];\n analytics[key] = analytics.factory(key);\n }\n analytics.load = function(key, e) {\n var t = document.createElement("script");\n t.type = "text/javascript";\n t.async = !0;\n t.src = "https://cdp-eu.customer.io/v1/analytics-js/snippet/" + key + "/analytics.min.js";\n var n = document.getElementsByTagName("script")[0];\n n.parentNode.insertBefore(t, n);\n analytics._writeKey = key;\n analytics._loadOptions = e;\n };\n analytics.SNIPPET_VERSION = "4.15.3";\n analytics.load("e6d009719c77519432c3");\n analytics.page();\n }\n })();\n ',document.head.appendChild(e)}();const r=uo();(navigator.userAgent||navigator.vendor||window.opera).match(/FBAN|FBAV|Instagram/i)&&((e,t)=>{const r=new URL(window.location.href);r.searchParams.set(e,t),window.history.replaceState({path:r.toString()},"",r.toString())})(Hn,r),Vn.init("9d4cb3d213e5aee689ea01dd68ad65ad",{debug:!1,track_pageview:"url-with-path",persistence:"cookie"}),this.locale=e||so(),t&&(this.platform=t);const n=this.getCommonParams();for(Vn.register(n),gtag("config",Kn,{user_properties:n,server_container_url:Qn}),this.initialized=!0;this.dataLayer.length>0;){const e=this.dataLayer.shift();this.trackEvent(e?.eventName,e?.eventParams)}}trackEvent(e,t){if(!this.initialized)return void this.dataLayer.push({eventName:e,eventParams:t});const r={...this.getCommonParams(),...t};try{Vn.track(e,r)}catch(e){console.log(e)}try{gtag("event",e,r)}catch(e){console.log(e)}try{window.analytics.track(e,r)}catch(e){console.log(e)}}setUser(e,t){if(!this.initialized)return void console.warn("Analytics is not initialized.");const{email:r,name:n}=t;Vn.identify(e),Vn.people.set({$email:r,name:n}),gtag("config",Kn,{user_properties:this.getCommonParams(),user_id:e,server_container_url:Qn}),window.analytics.identify(e,t)}getCommonParams(){return{...(()=>{const e=n.get(Gn),t=e?JSON.parse(e):{},r=new URLSearchParams(window.location.search),o={...Jn.some((e=>r.get(e)&&r.get(e)!==t[e]))?Jn.reduce(((e,t)=>({...e,[t]:r.get(t)})),{}):Jn.reduce(((e,r)=>({...e,[r]:t[r]})),{}),referrer:ro()||t.referrer,search_query:no()||t.search_query,landing_page_url:t.landing_page_url||window.location.href};return n.set(Gn,JSON.stringify(o),{domain:to()}),o})(),fbc:n.get("_fbc"),fbp:n.get("_fbp"),session_id:io(),user_pseudo_id:oo(),rid:uo(),funnel_name:n.get("funnel_name"),funnel_type:n.get("funnel_type"),language:window.navigator.language,platform:this.platform,url:window.location.href,device:Zn(),browser:Yn(),system:eo(),locale:this.locale}}setLocale(e){this.locale=e}resetUser(){this.initialized?(Vn.reset(),window.analytics.reset(),co(),this.init()):console.warn("Analytics is not initialized.")}getUserId=uo};return lo}));
31
+ function e(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.apply(e,[])).next())}))}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;var o=function(e){var r,n=new Uint8Array(e),o=n.length,i="";for(r=0;r<o;r+=3)i+=t[n[r]>>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i};const i=new Map,s=new Map,a=self;a.onmessage=function(t){return e(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:t.data.id});{const{id:r,bitmap:n,width:c,height:u,dataURLOptions:l}=t.data,p=function(t,r,n){return e(this,0,void 0,(function*(){const e=`${t}-${r}`;if("OffscreenCanvas"in globalThis){if(s.has(e))return s.get(e);const i=new OffscreenCanvas(t,r);i.getContext("2d");const a=yield i.convertToBlob(n),c=yield a.arrayBuffer(),u=o(c);return s.set(e,u),u}return""}))}(c,u,l),d=new OffscreenCanvas(c,u);d.getContext("2d").drawImage(n,0,0),n.close();const h=yield d.convertToBlob(l),f=h.type,m=yield h.arrayBuffer(),_=o(m);if(!i.has(r)&&(yield p)===_)return i.set(r,_),a.postMessage({id:r});if(i.get(r)===_)return a.postMessage({id:r});a.postMessage({id:r,type:f,base64:_,width:c,height:u}),i.set(r,_)}}))}}()},function(e){return Ke=Ke||function(e){var t=function(e){var t=e.toString().split("\n");t.pop(),t.shift();for(var r=t[0].search(/\S/),n=/(['"])__worker_loader_strict__(['"])/g,o=0,i=t.length;o<i;++o)t[o]=t[o].substring(r).replace(n,"$1use strict$2")+"\n";return t}(e),r=new Blob(t,{type:"application/javascript"});return URL.createObjectURL(r)}(Qe),new Worker(Ke,e)});class Ye{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,n,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:s})}initCanvasFPSObserver(e,t,r,n,o){const i=Ge(t,r,n,!0),s=new Map,a=new Xe;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:i}=e.data;this.mutationCb({id:t,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const c=1e3/e;let u,l=0;const p=e=>{l&&e-l<c||(l=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{G(t,r,n,!0)||e.push(t)})),e})().forEach((e=>Fe(this,0,void 0,(function*(){var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))))),u=requestAnimationFrame(p)};u=requestAnimationFrame(p),this.resetObservers=()=>{i(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Ge(e,t,r,!1),o=function(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=B(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(...i){return G(this.canvas,r,n,!0)||setTimeout((()=>{const r=Ve(i,t,this);e(this.canvas,{type:ce["2D"],property:s,args:r})}),0),o.apply(this,i)}}));o.push(i)}catch(r){const n=j(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:ce["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,n){const o=[];return o.push(...Je(t.WebGLRenderingContext.prototype,ce.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Je(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,r,n,0,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class Ze{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ee,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:a(e),index:t})))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class et{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function tt(e){return Object.assign(Object.assign({},e),{timestamp:$()})}let rt,nt,ot,it=!1;const st=new c;function at(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:_,hooks:g,packFn:y,sampling:v={},dataURLOptions:b={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:w=!1,recordCrossOriginIframes:I=!1,recordAfter:M=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:x=!1,inlineImages:E=!1,plugins:O,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:N}=e;ve(N);const D=!I||window.parent===window;let L=!1;if(!D)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(D&&!t)throw new Error("emit function is required");void 0!==S&&void 0===v.mousemove&&(v.mousemove=S),st.reset();const P=!0===d?{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!==h?h:{password:!0},F=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f}:f||{};let U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let j=0;const B=e=>{for(const t of O||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!L&&(e=y(e)),e};rt=(e,o)=>{var i;if(!(null===(i=ke[0])||void 0===i?void 0:i.isFrozen())||e.type===oe.FullSnapshot||e.type===oe.IncrementalSnapshot&&e.data.source===ie.Mutation||ke.forEach((e=>e.unfreeze())),D)null==t||t(B(e),o);else if(L){const t={type:"rrweb",event:B(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===oe.FullSnapshot)U=e,j=0;else if(e.type===oe.IncrementalSnapshot){if(e.data.source===ie.Mutation&&e.data.isAttachIframe)return;j++;const t=n&&j>=n,o=r&&e.timestamp-U.timestamp>r;(t||o)&&nt(!0)}};const $=e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Mutation},e)}))},H=e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Scroll},e)})),G=e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.CanvasMutation},e)})),J=new Ze({mutationCb:$,adoptedStyleSheetCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.AdoptedStyleSheet},e)}))}),Q=new qe({mirror:st,mutationCb:$,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:rt});for(const e of O||[])e.getMirror&&e.getMirror({nodeMirror:st,crossOriginIframeMirror:Q.crossOriginIframeMirror,crossOriginIframeStyleMirror:Q.crossOriginIframeStyleMirror});const K=new et;ot=new Ye({recordCanvas:w,mutationCb:G,win:window,blockClass:o,blockSelector:i,mirror:st,sampling:v.canvas,dataURLOptions:b});const ee=new Pe({mutationCb:$,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:P,dataURLOptions:b,maskTextFn:_,maskInputFn:m,recordCanvas:w,inlineImages:E,sampling:v,slimDOMOptions:F,iframeManager:Q,stylesheetManager:J,canvasManager:ot,keepIframeSrcFn:T,processedNodeManager:K},mirror:st});nt=(e=!1)=>{if(!k)return;rt(tt({type:oe.Meta,data:{href:window.location.href,width:V(),height:W()}}),e),J.reset(),ee.init(),ke.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new c,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:k=()=>!1}=t;return A(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===p?{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===p?{password:!0}:p,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:u,recordCanvas:l,preserveWhiteSpace:_,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:st,blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:P,maskTextFn:_,slimDOM:F,dataURLOptions:b,recordCanvas:w,inlineImages:E,onSerialize:e=>{X(e,st)&&Q.addIframe(e),Y(e,st)&&J.trackLinkElement(e),Z(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Q.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{J.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");rt(tt({type:oe.FullSnapshot,data:{node:t,initialOffset:z(window)}}),e),ke.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,st.getId(document))};try{const e=[],t=e=>{var t;return Se(Ne)({mutationCb:$,mousemoveCb:(e,t)=>rt(tt({type:oe.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.MouseInteraction},e)})),scrollCb:H,viewportResizeCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.ViewportResize},e)})),inputCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Input},e)})),mediaInteractionCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.MediaInteraction},e)})),styleSheetRuleCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.StyleSheetRule},e)})),styleDeclarationCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.StyleDeclaration},e)})),canvasMutationCb:G,fontCb:e=>rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Font},e)})),selectionCb:e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.Selection},e)}))},customElementCb:e=>{rt(tt({type:oe.IncrementalSnapshot,data:Object.assign({source:ie.CustomElement},e)}))},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:u,maskTextSelector:l,maskInputOptions:P,inlineStylesheet:p,sampling:v,recordDOM:k,recordCanvas:w,inlineImages:E,userTriggeredOnInput:C,collectFonts:x,doc:e,maskInputFn:m,maskTextFn:_,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:F,dataURLOptions:b,mirror:st,iframeManager:Q,stylesheetManager:J,shadowDomManager:ee,processedNodeManager:K,canvasManager:ot,ignoreCSSAttributes:R,plugins:(null===(t=null==O?void 0:O.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>rt(tt({type:oe.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},g)};Q.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{nt(),e.push(t(document)),it=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(q("DOMContentLoaded",(()=>{rt(tt({type:oe.DomContentLoaded,data:{}})),"DOMContentLoaded"===M&&r()}))),e.push(q("load",(()=>{rt(tt({type:oe.Load,data:{}})),"load"===M&&r()}),window))),()=>{e.forEach((e=>e())),K.destroy(),it=!1,be()}}catch(e){console.warn(e)}}at.addCustomEvent=(e,t)=>{if(!it)throw new Error("please add custom event after start recording");rt(tt({type:oe.Custom,data:{tag:e,payload:t}}))},at.freezePage=()=>{ke.forEach((e=>e.freeze()))},at.takeFullSnapshot=e=>{if(!it)throw new Error("please take full snapshot after start recording");nt(e)},at.mirror=st;var ct,ut=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ut||{}),lt=(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",e[e.CustomElement=16]="CustomElement",e))(lt||{}),pt={DEBUG:!1,LIB_VERSION:"2.58.0"};if("undefined"==typeof window){var dt={hostname:""};ct={navigator:{userAgent:"",onLine:!0},document:{location:dt,referrer:""},screen:{width:0,height:0},location:dt}}else ct=window;var ht,ft,mt,_t=ct.setImmediate,gt=Object.prototype.toString,yt=void 0!==_t?function(e){return _t(e)}:setTimeout;try{Object.defineProperty({},"x",{}),ht=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch(e){ht=function(e,t,r){return e[t]=r,e}}function vt(e,t){mt.add(e,t),ft||(ft=yt(mt.drain))}function bt(e){var t,r=typeof e;return null===e||"object"!==r&&"function"!==r||(t=e.then),"function"==typeof t&&t}function St(){for(var e=0;e<this.chain.length;e++)kt(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function kt(e,t,r){var n,o;try{!1===t?r.reject(e.msg):(n=!0===t?e.msg:t.call(void 0,e.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(o=bt(n))?o.call(n,r.resolve,r.reject):r.resolve(n)}catch(e){r.reject(e)}}function wt(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=bt(e))?vt((function(){var n=new Ct(r);try{t.call(e,(function(){wt.apply(n,arguments)}),(function(){It.apply(n,arguments)}))}catch(e){It.call(n,e)}})):(r.msg=e,r.state=1,r.chain.length>0&&vt(St,r))}catch(e){It.call(new Ct(r),e)}}}function It(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&vt(St,t))}function Mt(e,t,r,n){for(var o=0;o<t.length;o++)!function(o){e.resolve(t[o]).then((function(e){r(o,e)}),n)}(o)}function Ct(e){this.def=e,this.triggered=!1}function xt(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function Et(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new xt(this);this.then=function(e,r){var n={success:"function"!=typeof e||e,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t})),t.chain.push(n),0!==t.state&&vt(St,t),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){wt.call(t,e)}),(function(e){It.call(t,e)}))}catch(e){It.call(t,e)}}mt=function(){var e,t,r;function n(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(o,i){r=new n(o,i),t?t.next=r:e=r,t=r,r=void 0},drain:function(){var r=e;for(e=t=ft=void 0;r;)r.fn.call(r.self),r=r.next}}}();var Ot,Tt=ht({},"constructor",Et,!1);Et.prototype=Tt,ht(Tt,"__NPO__",0,!1),ht(Et,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");t(e)}))})),ht(Et,"reject",(function(e){return new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");r(e)}))})),ht(Et,"all",(function(e){var t=this;return"[object Array]"!==gt.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var o=e.length,i=Array(o),s=0;Mt(t,e,(function(e,t){i[e]=t,++s===o&&r(i)}),n)}))})),ht(Et,"race",(function(e){var t=this;return"[object Array]"!==gt.call(e)?t.reject(TypeError("Not an array")):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");Mt(t,e,(function(e,t){r(t)}),n)}))})),Ot="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:Et;var Rt,Nt,Dt,Lt,At,qt,Pt,Ft,Ut,jt,Bt,$t=864e5,zt=8e3,Wt=Array.prototype,Vt=Function.prototype,Ht=Object.prototype,Gt=Wt.slice,Jt=Ht.toString,Qt=Ht.hasOwnProperty,Kt=ct.console,Xt=ct.navigator,Yt=ct.document,Zt=ct.opera,er=ct.screen,tr=Xt.userAgent,rr=Vt.bind,nr=Wt.forEach,or=Wt.indexOf,ir=Wt.map,sr=Array.isArray,ar={},cr={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ur={log:function(){if(pt.DEBUG&&!cr.isUndefined(Kt)&&Kt)try{Kt.log.apply(Kt,arguments)}catch(e){cr.each(arguments,(function(e){Kt.log(e)}))}},warn:function(){if(pt.DEBUG&&!cr.isUndefined(Kt)&&Kt){var e=["Mixpanel warning:"].concat(cr.toArray(arguments));try{Kt.warn.apply(Kt,e)}catch(t){cr.each(e,(function(e){Kt.warn(e)}))}}},error:function(){if(pt.DEBUG&&!cr.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(cr.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){cr.each(e,(function(e){Kt.error(e)}))}}},critical:function(){if(!cr.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(cr.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){cr.each(e,(function(e){Kt.error(e)}))}}}},lr=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ur,arguments)}},pr=function(e){return{log:lr(ur.log,e),error:lr(ur.error,e),critical:lr(ur.critical,e)}};cr.bind=function(e,t){var r,n;if(rr&&e.bind===rr)return rr.apply(e,Gt.call(arguments,1));if(!cr.isFunction(e))throw new TypeError;return r=Gt.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(Gt.call(arguments)));var o={};o.prototype=e.prototype;var i=new o;o.prototype=null;var s=e.apply(i,r.concat(Gt.call(arguments)));return Object(s)===s?s:i},n},cr.each=function(e,t,r){if(null!=e)if(nr&&e.forEach===nr)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,o=e.length;n<o;n++)if(n in e&&t.call(r,e[n],n,e)===ar)return}else for(var i in e)if(Qt.call(e,i)&&t.call(r,e[i],i,e)===ar)return},cr.extend=function(e){return cr.each(Gt.call(arguments,1),(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},cr.isArray=sr||function(e){return"[object Array]"===Jt.call(e)},cr.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},cr.isArguments=function(e){return!(!e||!Qt.call(e,"callee"))},cr.toArray=function(e){return e?e.toArray?e.toArray():cr.isArray(e)||cr.isArguments(e)?Gt.call(e):cr.values(e):[]},cr.map=function(e,t,r){if(ir&&e.map===ir)return e.map(t,r);var n=[];return cr.each(e,(function(e){n.push(t.call(r,e))})),n},cr.keys=function(e){var t=[];return null===e||cr.each(e,(function(e,r){t[t.length]=r})),t},cr.values=function(e){var t=[];return null===e||cr.each(e,(function(e){t[t.length]=e})),t},cr.include=function(e,t){var r=!1;return null===e?r:or&&e.indexOf===or?-1!=e.indexOf(t):(cr.each(e,(function(e){if(r||(r=e===t))return ar})),r)},cr.includes=function(e,t){return-1!==e.indexOf(t)},cr.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},cr.isObject=function(e){return e===Object(e)&&!cr.isArray(e)},cr.isEmptyObject=function(e){if(cr.isObject(e)){for(var t in e)if(Qt.call(e,t))return!1;return!0}return!1},cr.isUndefined=function(e){return void 0===e},cr.isString=function(e){return"[object String]"==Jt.call(e)},cr.isDate=function(e){return"[object Date]"==Jt.call(e)},cr.isNumber=function(e){return"[object Number]"==Jt.call(e)},cr.isElement=function(e){return!(!e||1!==e.nodeType)},cr.encodeDates=function(e){return cr.each(e,(function(t,r){cr.isDate(t)?e[r]=cr.formatDate(t):cr.isObject(t)&&(e[r]=cr.encodeDates(t))})),e},cr.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},cr.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},cr.strip_empty_properties=function(e){var t={};return cr.each(e,(function(e,r){cr.isString(e)&&e.length>0&&(t[r]=e)})),t},cr.truncate=function(e,t){var r;return"string"==typeof e?r=e.slice(0,t):cr.isArray(e)?(r=[],cr.each(e,(function(e){r.push(cr.truncate(e,t))}))):cr.isObject(e)?(r={},cr.each(e,(function(e,n){r[n]=cr.truncate(e,t)}))):r=e,r},cr.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=r[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},r=function(e,n){var o="",i=0,s="",a="",c=0,u=o,l=[],p=n[e];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(e)),typeof p){case"string":return t(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(o+=" ",l=[],"[object Array]"===Jt.apply(p)){for(c=p.length,i=0;i<c;i+=1)l[i]=r(i,p)||"null";return a=0===l.length?"[]":o?"[\n"+o+l.join(",\n"+o)+"\n"+u+"]":"["+l.join(",")+"]",o=u,a}for(s in p)Qt.call(p,s)&&(a=r(s,p))&&l.push(t(s)+(o?": ":":")+a);return a=0===l.length?"{}":o?"{"+l.join(",")+u+"}":"{"+l.join(",")+"}",o=u,a}};return r("",{"":e})},cr.JSONDecode=(At={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},qt=function(e){var t=new SyntaxError(e);throw t.at=Rt,t.text=Dt,t},Pt=function(e){return e&&e!==Nt&&qt("Expected '"+e+"' instead of '"+Nt+"'"),Nt=Dt.charAt(Rt),Rt+=1,Nt},Ft=function(){var e,t="";for("-"===Nt&&(t="-",Pt("-"));Nt>="0"&&Nt<="9";)t+=Nt,Pt();if("."===Nt)for(t+=".";Pt()&&Nt>="0"&&Nt<="9";)t+=Nt;if("e"===Nt||"E"===Nt)for(t+=Nt,Pt(),"-"!==Nt&&"+"!==Nt||(t+=Nt,Pt());Nt>="0"&&Nt<="9";)t+=Nt,Pt();if(e=+t,isFinite(e))return e;qt("Bad number")},Ut=function(){var e,t,r,n="";if('"'===Nt)for(;Pt();){if('"'===Nt)return Pt(),n;if("\\"===Nt)if(Pt(),"u"===Nt){for(r=0,t=0;t<4&&(e=parseInt(Pt(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof At[Nt])break;n+=At[Nt]}else n+=Nt}qt("Bad string")},jt=function(){for(;Nt&&Nt<=" ";)Pt()},Lt=function(){switch(jt(),Nt){case"{":return function(){var e,t={};if("{"===Nt){if(Pt("{"),jt(),"}"===Nt)return Pt("}"),t;for(;Nt;){if(e=Ut(),jt(),Pt(":"),Object.hasOwnProperty.call(t,e)&&qt('Duplicate key "'+e+'"'),t[e]=Lt(),jt(),"}"===Nt)return Pt("}"),t;Pt(","),jt()}}qt("Bad object")}();case"[":return function(){var e=[];if("["===Nt){if(Pt("["),jt(),"]"===Nt)return Pt("]"),e;for(;Nt;){if(e.push(Lt()),jt(),"]"===Nt)return Pt("]"),e;Pt(","),jt()}}qt("Bad array")}();case'"':return Ut();case"-":return Ft();default:return Nt>="0"&&Nt<="9"?Ft():function(){switch(Nt){case"t":return Pt("t"),Pt("r"),Pt("u"),Pt("e"),!0;case"f":return Pt("f"),Pt("a"),Pt("l"),Pt("s"),Pt("e"),!1;case"n":return Pt("n"),Pt("u"),Pt("l"),Pt("l"),null}qt('Unexpected "'+Nt+'"')}()}},function(e){var t;return Dt=e,Rt=0,Nt=" ",t=Lt(),jt(),Nt&&qt("Syntax error"),t}),cr.base64Encode=function(e){var t,r,n,o,i,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=cr.utf8Encode(e);do{t=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=i>>12&63,n=i>>6&63,o=63&i,l[c++]=s.charAt(t)+s.charAt(r)+s.charAt(n)+s.charAt(o)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u},cr.utf8Encode=function(e){var t,r,n,o,i="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<n;o++){var s=e.charCodeAt(o),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(r>t&&(i+=e.substring(t,r)),i+=a,t=r=o+1)}return r>t&&(i+=e.substring(t,e.length)),i},cr.UUID=(Bt=function(){var e,t=1*new Date;if(ct.performance&&ct.performance.now)e=ct.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)},function(){var e=(er.height*er.width).toString(16);return Bt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,r=tr,n=[],o=0;function i(e,t){var r,o=0;for(r=0;r<t.length;r++)o|=n[r]<<8*r;return e^o}for(e=0;e<r.length;e++)t=r.charCodeAt(e),n.unshift(255&t),n.length>=4&&(o=i(o,n),n=[]);return n.length>0&&(o=i(o,n)),o.toString(16)}()+"-"+e+"-"+Bt()});var dr=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","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"];cr.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<dr.length;t++)if(-1!==e.indexOf(dr[t]))return!0;return!1},cr.HTTPBuildQuery=function(e,t){var r,n,o=[];return cr.isUndefined(t)&&(t="&"),cr.each(e,(function(e,t){r=encodeURIComponent(e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r})),o.join(t)},cr.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var n=r[1];try{n=decodeURIComponent(n)}catch(e){ur.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")},cr.cookie={get:function(e){for(var t=e+"=",r=Yt.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null},parse:function(e){var t;try{t=cr.JSONDecode(cr.cookie.get(e))||{}}catch(e){}return t},set_seconds:function(e,t,r,n,o,i,s){var a="",c="",u="";if(s)a="; domain="+s;else if(n){var l=Sr(Yt.location.hostname);a=l?"; domain=."+l:""}if(r){var p=new Date;p.setTime(p.getTime()+1e3*r),c="; expires="+p.toGMTString()}i&&(o=!0,u="; SameSite=None"),o&&(u+="; secure"),Yt.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+u},set:function(e,t,r,n,o,i,s){var a="",c="",u="";if(s)a="; domain="+s;else if(n){var l=Sr(Yt.location.hostname);a=l?"; domain=."+l:""}if(r){var p=new Date;p.setTime(p.getTime()+24*r*60*60*1e3),c="; expires="+p.toGMTString()}i&&(o=!0,u="; SameSite=None"),o&&(u+="; secure");var d=e+"="+encodeURIComponent(t)+c+"; path=/"+a+u;return Yt.cookie=d,d},remove:function(e,t,r){cr.cookie.set(e,"",-1,t,!1,!1,r)}};var hr=null,fr=function(e,t){if(null!==hr&&!t)return hr;var r=!0;try{e=e||ct.localStorage;var n="__mplss_"+yr(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(r=!1),e.removeItem(n)}catch(e){r=!1}return hr=r,r};cr.localStorage={is_supported:function(e){var t=fr(null,e);return t||ur.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){ur.error("localStorage error: "+e)},get:function(e){try{return ct.localStorage.getItem(e)}catch(e){cr.localStorage.error(e)}return null},parse:function(e){try{return cr.JSONDecode(cr.localStorage.get(e))||{}}catch(e){}return null},set:function(e,t){try{ct.localStorage.setItem(e,t)}catch(e){cr.localStorage.error(e)}},remove:function(e){try{ct.localStorage.removeItem(e)}catch(e){cr.localStorage.error(e)}}},cr.register_event=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,r,n,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(r,n,!!i);else{var s="on"+r,a=t[s];t[s]=function(t,r,n){var o=function(o){if(o=o||e(ct.event)){var i,s,a=!0;return cr.isFunction(n)&&(i=n(o)),s=r.call(t,o),!1!==i&&!1!==s||(a=!1),a}};return o}(t,n,a)}else ur.error("No valid element provided to register_event")}}();var mr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');cr.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(e,r){var n=" "+r+" ";return(" "+e.className+" ").replace(t," ").indexOf(n)>=0}function n(t){if(!Yt.getElementsByTagName)return[];var n,o,i,s,a,c,u,l,p,d,h=t.split(" "),f=[Yt];for(c=0;c<h.length;c++)if((n=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(o=n.split("#"))[0];var m=o[1],_=Yt.getElementById(m);if(!_||i&&_.nodeName.toLowerCase()!=i)return[];f=[_]}else if(n.indexOf(".")>-1){i=(o=n.split("."))[0];var g=o[1];for(i||(i="*"),s=[],a=0,u=0;u<f.length;u++)for(p="*"==i?e(f[u]):f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];for(f=[],d=0,u=0;u<s.length;u++)s[u].className&&cr.isString(s[u].className)&&r(s[u],g)&&(f[d++]=s[u])}else{var y=n.match(mr);if(y){i=y[1];var v,b=y[2],S=y[3],k=y[4];for(i||(i="*"),s=[],a=0,u=0;u<f.length;u++)for(p="*"==i?e(f[u]):f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];switch(f=[],d=0,S){case"=":v=function(e){return e.getAttribute(b)==k};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+k+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+k+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(k)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(k)==e.getAttribute(b).length-k.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(k)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],d=0,u=0;u<s.length;u++)v(s[u])&&(f[d++]=s[u])}else{for(i=n,s=[],a=0,u=0;u<f.length;u++)for(p=f[u].getElementsByTagName(i),l=0;l<p.length;l++)s[a++]=p[l];f=s}}return f}return function(e){return cr.isElement(e)?[e]:cr.isObject(e)&&!cr.isUndefined(e.length)?e:n.call(this,e)}}();var _r=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],gr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];cr.info={campaignParams:function(e){var t="",r={};return cr.each(_r,(function(n){(t=cr.getQueryParam(Yt.URL,n)).length?r[n]=t:void 0!==e&&(r[n]=e)})),r},clickParams:function(){var e="",t={};return cr.each(gr,(function(r){(e=cr.getQueryParam(Yt.URL,r)).length&&(t[r]=e)})),t},marketingParams:function(){return cr.extend(cr.info.campaignParams(),cr.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=cr.info.searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(null!==t){n.$search_engine=t;var o=cr.getQueryParam(e,r);o.length&&(n.mp_keyword=o)}return n},browser:function(e,t,r){return t=t||"",r||cr.includes(e," OPR/")?cr.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":cr.includes(e,"IEMobile")||cr.includes(e,"WPDesktop")?"Internet Explorer Mobile":cr.includes(e,"SamsungBrowser/")?"Samsung Internet":cr.includes(e,"Edge")||cr.includes(e,"Edg/")?"Microsoft Edge":cr.includes(e,"FBIOS")?"Facebook Mobile":cr.includes(e,"Chrome")?"Chrome":cr.includes(e,"CriOS")?"Chrome iOS":cr.includes(e,"UCWEB")||cr.includes(e,"UCBrowser")?"UC Browser":cr.includes(e,"FxiOS")?"Firefox iOS":cr.includes(t,"Apple")?cr.includes(e,"Mobile")?"Mobile Safari":"Safari":cr.includes(e,"Android")?"Android Mobile":cr.includes(e,"Konqueror")?"Konqueror":cr.includes(e,"Firefox")?"Firefox":cr.includes(e,"MSIE")||cr.includes(e,"Trident/")?"Internet Explorer":cr.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[cr.info.browser(e,t,r)];if(void 0===n)return null;var o=e.match(n);return o?parseFloat(o[o.length-2]):null},os:function(){var e=tr;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return ct.location.href},properties:function(e){return"object"!=typeof e&&(e={}),cr.extend(cr.strip_empty_properties({$os:cr.info.os(),$browser:cr.info.browser(tr,Xt.vendor,Zt),$referrer:Yt.referrer,$referring_domain:cr.info.referringDomain(Yt.referrer),$device:cr.info.device(tr)}),{$current_url:cr.info.currentUrl(),$browser_version:cr.info.browserVersion(tr,Xt.vendor,Zt),$screen_height:er.height,$screen_width:er.width,mp_lib:"web",$lib_version:pt.LIB_VERSION,$insert_id:yr(),time:cr.timestamp()/1e3},cr.strip_empty_properties(e))},people_properties:function(){return cr.extend(cr.strip_empty_properties({$os:cr.info.os(),$browser:cr.info.browser(tr,Xt.vendor,Zt)}),{$browser_version:cr.info.browserVersion(tr,Xt.vendor,Zt)})},mpPageViewProperties:function(){return cr.strip_empty_properties({current_page_title:Yt.title,current_domain:ct.location.hostname,current_url_path:ct.location.pathname,current_url_protocol:ct.location.protocol,current_url_search:ct.location.search})}};var yr=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},vr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,br=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Sr=function(e){var t=br,r=e.split("."),n=r[r.length-1];(n.length>4||"com"===n||"org"===n)&&(t=vr);var o=e.match(t);return o?o[0]:""},kr=null,wr=null;"undefined"!=typeof JSON&&(kr=JSON.stringify,wr=JSON.parse),kr=kr||cr.JSONEncode,wr=wr||cr.JSONDecode,cr.toArray=cr.toArray,cr.isObject=cr.isObject,cr.JSONEncode=cr.JSONEncode,cr.JSONDecode=cr.JSONDecode,cr.isBlockedUA=cr.isBlockedUA,cr.isEmptyObject=cr.isEmptyObject,cr.info=cr.info,cr.info.device=cr.info.device,cr.info.browser=cr.info.browser,cr.info.browserVersion=cr.info.browserVersion,cr.info.properties=cr.info.properties,cr.NPO=Et;function Ir(e,t){Ar(!0,e,t)}function Mr(e,t){Ar(!1,e,t)}function Cr(e,t){return"1"===Lr(e,t)}function xr(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||ct,r=t.navigator||{},n=!1;return cr.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],(function(e){cr.includes([!0,1,"1","yes"],e)&&(n=!0)})),n}(t))return ur.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r="0"===Lr(e,t);return r&&ur.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Er(e){return qr(e,(function(e){return this.get_config(e)}))}function Or(e){return qr(e,(function(e){return this._get_config(e)}))}function Tr(e){return qr(e,(function(e){return this._get_config(e)}))}function Rr(e,t){Nr(t=t||{}).remove(Dr(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Nr(e){return"localStorage"===(e=e||{}).persistenceType?cr.localStorage:cr.cookie}function Dr(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function Lr(e,t){return Nr(t).get(Dr(e,t))}function Ar(e,t,r){cr.isString(t)&&t.length?(Nr(r=r||{}).set(Dr(t,r),e?1:0,cr.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&e&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})):ur.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function qr(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),o=t.call(this,"ignore_dnt"),i=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");n&&(r=xr(n,{ignoreDnt:o,persistenceType:i,persistencePrefix:s,window:a}))}catch(e){ur.error("Unexpected error when checking tracking opt-out status: "+e)}if(!r)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var Pr=pr("lock"),Fr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||Ot};Fr.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(cr.bind((function(r,n){var o=t||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,u=this.storage,l=s+":X",p=s+":Y",d=s+":Z",h=function(e){if((new Date).getTime()-i>c)return Pr.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+o+"]"),u.removeItem(d),u.removeItem(p),void _();setTimeout((function(){try{e()}catch(e){n(e)}}),a*(Math.random()+.1))},f=function(e,t){e()?t():h((function(){f(e,t)}))},m=function(){var e=u.getItem(p);return(!e||e===o)&&(u.setItem(p,o),u.getItem(p)===o||(fr(u,!0)||n(new Error("localStorage support dropped while acquiring lock")),!1))},_=function(){u.setItem(l,o),f(m,(function(){u.getItem(l)!==o?h((function(){u.getItem(p)===o?f((function(){return!u.getItem(d)}),g):_()})):g()}))},g=function(){u.setItem(d,"1");var t=function(){u.removeItem(d),u.getItem(p)===o&&u.removeItem(p),u.getItem(l)===o&&u.removeItem(l)};e().then((function(e){t(),r(e)})).catch((function(e){t(),n(e)}))};try{if(!fr(u,!0))throw new Error("localStorage support check failed");_()}catch(e){n(e)}}),this))};var Ur=function(e){this.storage=e||localStorage};Ur.prototype.init=function(){return Ot.resolve()},Ur.prototype.setItem=function(e,t){return new Ot(cr.bind((function(r,n){try{this.storage.setItem(e,t)}catch(e){n(e)}r()}),this))},Ur.prototype.getItem=function(e){return new Ot(cr.bind((function(t,r){var n;try{n=this.storage.getItem(e)}catch(e){r(e)}t(n)}),this))},Ur.prototype.removeItem=function(e){return new Ot(cr.bind((function(t,r){try{this.storage.removeItem(e)}catch(e){r(e)}t()}),this))};var jr=pr("batch"),Br=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Ur,this.lock=new Fr(e,{storage:t.sharedLockStorage||window.localStorage}),this.queueStorage.init()),this.reportError=t.errorReporter||cr.bind(jr.error,jr),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1};Br.prototype.ensureInit=function(){return this.initialized?Ot.resolve():this.queueStorage.init().then(cr.bind((function(){this.initialized=!0}),this)).catch(cr.bind((function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1}),this))},Br.prototype.enqueue=function(e,t){var r={id:yr(),flushAfter:(new Date).getTime()+2*t,payload:e};if(this.usePersistence){var n=cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){return e.push(r),this.saveToStorage(e)}),this)).then(cr.bind((function(e){return e&&this.memQueue.push(r),e}),this)).catch(cr.bind((function(t){return this.reportError("Error enqueueing item",t,e),!1}),this))}),this);return this.lock.withLock(n,this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!1}),this))}return this.memQueue.push(r),Ot.resolve(!0)},Br.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(r){if(r.length){var n={};cr.each(t,(function(e){n[e.id]=!0}));for(var o=0;o<r.length;o++){var i=r[o];if((new Date).getTime()>i.flushAfter&&!n[i.id]&&(i.orphaned=!0,t.push(i),t.length>=e))break}}return t}),this)):Ot.resolve(t)};var $r=function(e,t){var r=[];return cr.each(e,(function(e){e.id&&!t[e.id]&&r.push(e)})),r};Br.prototype.removeItemsByID=function(e){var t={};if(cr.each(e,(function(e){t[e]=!0})),this.memQueue=$r(this.memQueue,t),this.usePersistence){var r=cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){return e=$r(e,t),this.saveToStorage(e)}),this)).then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(e){for(var r=0;r<e.length;r++){var n=e[r];if(n.id&&t[n.id])throw new Error("Item not removed from storage")}return!0}),this)).catch(cr.bind((function(t){return this.reportError("Error removing items",t,e),!1}),this))}),this);return this.lock.withLock(r,this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!fr(this.queueStorage.storage,!0)&&r().then(cr.bind((function(e){return e||this.queueStorage.removeItem(this.storageKey).then((function(){return e}))}),this)).catch(cr.bind((function(e){return this.reportError("Error clearing queue",e),!1}),this))}),this))}return Ot.resolve(!0)};var zr=function(e,t){var r=[];return cr.each(e,(function(e){var n=e.id;if(n in t){var o=t[n];null!==o&&(e.payload=o,r.push(e))}else r.push(e)})),r};Br.prototype.updatePayloads=function(e){return this.memQueue=zr(this.memQueue,e),this.usePersistence?this.lock.withLock(cr.bind((function(){return this.ensureInit().then(cr.bind((function(){return this.readFromStorage()}),this)).then(cr.bind((function(t){return t=zr(t,e),this.saveToStorage(t)}),this)).catch(cr.bind((function(t){return this.reportError("Error updating items",e,t),!1}),this))}),this),this.pid).catch(cr.bind((function(e){return this.reportError("Error acquiring storage lock",e),!1}),this)):Ot.resolve(!0)},Br.prototype.readFromStorage=function(){return this.ensureInit().then(cr.bind((function(){return this.queueStorage.getItem(this.storageKey)}),this)).then(cr.bind((function(e){return e&&(e=wr(e),cr.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]}),this)).catch(cr.bind((function(e){return this.reportError("Error retrieving queue",e),[]}),this))},Br.prototype.saveToStorage=function(e){try{var t=kr(e)}catch(e){return this.reportError("Error serializing queue",e),Ot.resolve(!1)}return this.ensureInit().then(cr.bind((function(){return this.queueStorage.setItem(this.storageKey,t)}),this)).then((function(){return!0})).catch(cr.bind((function(e){return this.reportError("Error saving queue",e),!1}),this))},Br.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(cr.bind((function(){return this.queueStorage.removeItem(this.storageKey)}),this)):Ot.resolve()};var Wr=pr("batch"),Vr=function(e,t){this.errorReporter=t.errorReporter,this.queue=new Br(e,{errorReporter:cr.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};Vr.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Vr.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Vr.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Vr.prototype.clear=function(){return this.queue.clear()},Vr.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Vr.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Vr.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(cr.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},Vr.prototype.sendRequestPromise=function(e,t){return new Ot(cr.bind((function(r){this.sendRequest(e,t,r)}),this))},Vr.prototype.flush=function(e){if(this.requestInProgress)return Wr.log("Flush: Request already in progress"),Ot.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=(new Date).getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(cr.bind((function(o){var i=o.length===n,s=[],a={};if(cr.each(o,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=cr.extend({},t.properties,{mp_sent_by_lib_version:pt.LIB_VERSION}));var r=!0,n=e.id;n?(this.itemIdsSentSuccessfully[n]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[n]}),r=!1):this.reportError("[dupe] found item with no ID",{item:e}),r&&s.push(t)}a[e.id]=t}),this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),Ot.resolve();var c=cr.bind((function(){return this.queue.removeItemsByID(cr.map(o,(function(e){return e.id}))).then(cr.bind((function(e){return cr.each(o,cr.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!i?(this.resetFlush(),Ot.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),Ot.resolve())}),this))}),this),u=cr.bind((function(i){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(cr.isObject(i)&&"timeout"===i.error&&(new Date).getTime()-r>=t)return this.reportError("Network timeout; retrying"),this.flush();if(cr.isObject(i)&&(i.httpStatusCode>=500||429===i.httpStatusCode||i.httpStatusCode<=0&&(l=ct.navigator.onLine,!cr.isUndefined(l)&&!l)||"timeout"===i.error)){var s=2*this.flushInterval;return i.retryAfter&&(s=1e3*parseInt(i.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),Ot.resolve()}if(cr.isObject(i)&&413===i.httpStatusCode){if(o.length>1){var u=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,u,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),Ot.resolve()}return this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),c()}return c()}catch(e){this.reportError("Error handling API response",e),this.resetFlush()}var l}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(l.transport="sendBeacon"),Wr.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,l).then(u)}),this)).catch(cr.bind((function(e){this.reportError("Error flushing request queue",e),this.resetFlush()}),this))},Vr.prototype.reportError=function(e,t){if(Wr.error.apply(Wr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){Wr.error(t)}};var Hr=pr("recorder"),Gr=ct.CompressionStream,Jr={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},Qr=new Set([lt.MouseMove,lt.MouseInteraction,lt.Scroll,lt.ViewportResize,lt.Input,lt.TouchMove,lt.MediaInteraction,lt.Drag,lt.Selection]);var Kr=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout,this._onMaxLengthReached=e.onMaxLengthReached,this._rrwebRecord=e.rrwebRecord,this.replayId=e.replayId,this._stopRecording=null,this.seqNo=0,this.replayStartTime=null,this.replayStartUrl=null,this.batchStartUrl=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=$t,this.recordMinMs=0;var t="__mprec_"+this.getConfig("token")+"_"+this.replayId;this.batcher=new Vr(t,{errorReporter:cr.bind(this.reportError,this),flushOnlyOnInterval:!0,libConfig:Jr,sendRequestFunc:cr.bind(this.flushEventsWithOptOut,this),usePersistence:!1})};Kr.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Kr.prototype.get_config=function(e){return this.getConfig(e)},Kr.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>$t&&(this.recordMaxMs=$t,Hr.critical("record_max_ms cannot be greater than "+$t+"ms. Capping value.")),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>zt&&(this.recordMinMs=zt,Hr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.replayStartTime=(new Date).getTime(),this.batchStartUrl=cr.info.currentUrl(),this.replayStartUrl=cr.info.currentUrl(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=cr.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(this._onIdleTimeout,this.getConfig("record_idle_timeout_ms"))}),this),r=this.getConfig("record_block_selector");if(""!==r&&null!==r||(r=void 0),this._stopRecording=this._rrwebRecord({emit:cr.bind((function(e){this.batcher.enqueue(e),function(e){return e.type===ut.IncrementalSnapshot&&Qr.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}}),"function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();t(),this.maxTimeoutId=setTimeout(cr.bind(this._onMaxLengthReached,this),this.recordMaxMs)}else Hr.log("Recording already in progress, skipping startRecording.")},Kr.prototype.stopRecording=function(){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(e){this.reportError("Error with rrweb stopRecording",e)}this._stopRecording=null}this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Kr.prototype.isRrwebStopped=function(){return null===this._stopRecording},Kr.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,cr.bind(this._onOptOut,this))},Kr.prototype._onOptOut=function(e){0===e&&this.stopRecording()},Kr.prototype._sendRequest=function(e,t,r,n){var o=cr.bind((function(t,r){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=cr.info.currentUrl()),n({status:0,httpStatusCode:t.status,responseBody:r,retryAfter:t.headers.get("Retry-After")})}),this);ct.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then((function(e){e.json().then((function(t){o(e,t)})).catch((function(e){n({error:e})}))})).catch((function(e){n({error:e,httpStatusCode:0})}))},Kr.prototype._flushEvents=Er((function(e,t,r){const n=e.length;if(n>0){var o=this.replayId,i=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=i);var s=e[n-1].timestamp-this.replayStartTime,a={$current_url:this.batchStartUrl,$lib_version:pt.LIB_VERSION,batch_start_time:i/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:o,replay_length_ms:s,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},c=cr.JSONEncode(e),u=this._mixpanel.get_property("$device_id");u&&(a.$device_id=u);var l=this._mixpanel.get_property("$user_id");if(l&&(a.$user_id=l),Gr){var p=new Blob([c],{type:"application/json"}).stream().pipeThrough(new Gr("gzip"));new Response(p).blob().then(cr.bind((function(e){a.format="gzip",this._sendRequest(o,a,e,r)}),this))}else a.format="body",this._sendRequest(o,a,c,r)}})),Kr.prototype.reportError=function(e,t){Hr.error.apply(Hr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(t){Hr.error(t)}};var Xr=pr("recorder"),Yr=function(e){this._mixpanel=e,this.activeRecording=null};Yr.prototype.startRecording=function(e){if(!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=cr.bind((function(){Xr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),r=cr.bind((function(){Xr.log("Max recording length reached, stopping recording."),this.resetRecording()}),this);this.activeRecording=new Kr({mixpanelInstance:this._mixpanel,onIdleTimeout:t,onMaxLengthReached:r,replayId:cr.UUID(),rrwebRecord:at}),this.activeRecording.startRecording(e)}else Xr.log("Recording already in progress, skipping startRecording.")},Yr.prototype.stopRecording=function(){this.activeRecording&&(this.activeRecording.stopRecording(),this.activeRecording=null)},Yr.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Yr.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Yr.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),ct.__mp_recorder=Yr;var Zr=function(){};Zr.prototype.create_properties=function(){},Zr.prototype.event_handler=function(){},Zr.prototype.after_track_handler=function(){},Zr.prototype.init=function(e){return this.mp=e,this},Zr.prototype.track=function(e,t,r,n){var o=this,i=cr.dom_query(e);if(0!==i.length)return cr.each(i,(function(e){cr.register_event(e,this.override_event,(function(e){var i={},s=o.create_properties(r,this),a=o.mp.get_config("track_links_timeout");o.event_handler(e,this,i),window.setTimeout(o.track_callback(n,s,i,!0),a),o.mp.track(t,s,o.track_callback(n,s,i))}))}),this),!0;ur.error("The DOM query ("+e+") returned 0 elements")},Zr.prototype.track_callback=function(e,t,r,n){n=n||!1;var o=this;return function(){r.callback_fired||(r.callback_fired=!0,e&&!1===e(n,t)||o.after_track_handler(t,r,n))}},Zr.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):cr.extend({},e)};var en=function(){this.override_event="click"};cr.inherit(en,Zr),en.prototype.create_properties=function(e,t){var r=en.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r},en.prototype.event_handler=function(e,t,r){r.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,r.href=t.href,r.new_tab||e.preventDefault()},en.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var tn=function(){this.override_event="submit"};cr.inherit(tn,Zr),tn.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()},tn.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var rn="$set",nn="$set_once",on="$unset",sn="$add",an="$append",cn="$union",un="$remove",ln={set_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[rn]=n,r},unset_action:function(e){var t={},r=[];return cr.isArray(e)||(e=[e]),cr.each(e,(function(e){this._is_reserved_property(e)||r.push(e)}),this),t[on]=r,t},set_once_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[nn]=n,r},union_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=cr.isArray(e)?e:[e])}),this):n[e]=cr.isArray(t)?t:[t],r[cn]=n,r},append_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[an]=n,r},remove_action:function(e,t){var r={},n={};return cr.isObject(e)?cr.each(e,(function(e,t){this._is_reserved_property(t)||(n[t]=e)}),this):n[e]=t,r[un]=n,r},delete_action:function(){var e={$delete:""};return e}},pn=function(){};cr.extend(pn.prototype,ln),pn.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r},pn.prototype.set=Tr((function(e,t,r){var n=this.set_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),pn.prototype.set_once=Tr((function(e,t,r){var n=this.set_once_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),pn.prototype.unset=Tr((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),pn.prototype.union=Tr((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)})),pn.prototype.delete=Tr((function(e){var t=this.delete_action();return this._send_request(t,e)})),pn.prototype.remove=Tr((function(e,t,r){var n=this.remove_action(e,t);return this._send_request(n,r)})),pn.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var r=cr.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},pn.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},pn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},pn.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},pn.prototype.remove=pn.prototype.remove,pn.prototype.set=pn.prototype.set,pn.prototype.set_once=pn.prototype.set_once,pn.prototype.union=pn.prototype.union,pn.prototype.unset=pn.prototype.unset,pn.prototype.toString=pn.prototype.toString;var dn=function(){};cr.extend(dn.prototype,ln),dn.prototype._init=function(e){this._mixpanel=e},dn.prototype.set=Or((function(e,t,r){var n=this.set_action(e,t);return cr.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[rn]=cr.extend({},cr.info.people_properties(),n[rn]),this._send_request(n,r)})),dn.prototype.set_once=Or((function(e,t,r){var n=this.set_once_action(e,t);return cr.isObject(e)&&(r=t),this._send_request(n,r)})),dn.prototype.unset=Or((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),dn.prototype.increment=Or((function(e,t,r){var n={},o={};return cr.isObject(e)?(cr.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void ur.error("Invalid increment value passed to mixpanel.people.increment - must be a number");o[t]=e}}),this),r=t):(cr.isUndefined(t)&&(t=1),o[e]=t),n[sn]=o,this._send_request(n,r)})),dn.prototype.append=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.append_action(e,t);return this._send_request(n,r)})),dn.prototype.remove=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.remove_action(e,t);return this._send_request(n,r)})),dn.prototype.union=Or((function(e,t,r){cr.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)})),dn.prototype.track_charge=Or((function(e,t,r){if(cr.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",cr.extend({$amount:e},t),r);ur.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),dn.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},dn.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}ur.error("mixpanel.people.delete_user() requires you to call identify() first")},dn.prototype.toString=function(){return this._mixpanel.toString()+".people"},dn.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(e.$device_id=r),n&&(e.$user_id=n),o&&(e.$had_persisted_distinct_id=o);var i=cr.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:i,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),cr.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),cr.truncate(i,255))},dn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},dn.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},dn.prototype._enqueue=function(e){rn in e?this._mixpanel.persistence._add_to_people_queue(rn,e):nn in e?this._mixpanel.persistence._add_to_people_queue(nn,e):on in e?this._mixpanel.persistence._add_to_people_queue(on,e):sn in e?this._mixpanel.persistence._add_to_people_queue(sn,e):an in e?this._mixpanel.persistence._add_to_people_queue(an,e):un in e?this._mixpanel.persistence._add_to_people_queue(un,e):cn in e?this._mixpanel.persistence._add_to_people_queue(cn,e):ur.error("Invalid call to _enqueue():",e)},dn.prototype._flush_one_queue=function(e,t,r,n){var o=this,i=cr.extend({},this._mixpanel.persistence.load_queue(e)),s=i;cr.isUndefined(i)||!cr.isObject(i)||cr.isEmptyObject(i)||(o._mixpanel.persistence._pop_from_people_queue(e,i),o._mixpanel.persistence.save(),n&&(s=n(i)),t.call(o,s,(function(t,n){0===t&&o._mixpanel.persistence._add_to_people_queue(e,i),cr.isUndefined(r)||r(t,n)})))},dn.prototype._flush=function(e,t,r,n,o,i,s){var a=this;this._flush_one_queue(rn,this.set,e),this._flush_one_queue(nn,this.set_once,n),this._flush_one_queue(on,this.unset,i,(function(e){return cr.keys(e)})),this._flush_one_queue(sn,this.increment,t),this._flush_one_queue(cn,this.union,o);var c=this._mixpanel.persistence.load_queue(an);if(!cr.isUndefined(c)&&cr.isArray(c)&&c.length)for(var u,l=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(an,u),cr.isUndefined(r)||r(e,t)},p=c.length-1;p>=0;p--)c=this._mixpanel.persistence.load_queue(an),u=c.pop(),a._mixpanel.persistence.save(),cr.isEmptyObject(u)||a.append(u,l);var d=this._mixpanel.persistence.load_queue(un);if(!cr.isUndefined(d)&&cr.isArray(d)&&d.length)for(var h,f=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(un,h),cr.isUndefined(s)||s(e,t)},m=d.length-1;m>=0;m--)d=this._mixpanel.persistence.load_queue(un),h=d.pop(),a._mixpanel.persistence.save(),cr.isEmptyObject(h)||a.remove(h,f)},dn.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},dn.prototype.set=dn.prototype.set,dn.prototype.set_once=dn.prototype.set_once,dn.prototype.unset=dn.prototype.unset,dn.prototype.increment=dn.prototype.increment,dn.prototype.append=dn.prototype.append,dn.prototype.remove=dn.prototype.remove,dn.prototype.union=dn.prototype.union,dn.prototype.track_charge=dn.prototype.track_charge,dn.prototype.clear_charges=dn.prototype.clear_charges,dn.prototype.delete_user=dn.prototype.delete_user,dn.prototype.toString=dn.prototype.toString;var hn,fn="__mps",mn="__mpso",_n="__mpus",gn="__mpa",yn="__mpap",vn="__mpr",bn="__mpu",Sn="$people_distinct_id",kn="__alias",wn="__timers",In=[fn,mn,_n,gn,yn,vn,bn,Sn,kn,wn],Mn=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(ur.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&cr.localStorage.is_supported()?this.storage=cr.localStorage:this.storage=cr.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Mn.prototype.properties=function(){var e={};return this.load(),cr.each(this.props,(function(t,r){cr.include(In,r)||(e[r]=t)})),e},Mn.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=cr.extend({},e))}},Mn.prototype.upgrade=function(){var e,t;this.storage===cr.localStorage?(e=cr.cookie.parse(this.name),cr.cookie.remove(this.name),cr.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===cr.cookie&&(t=cr.localStorage.parse(this.name),cr.localStorage.remove(this.name),t&&this.register_once(t))},Mn.prototype.save=function(){this.disabled||this.storage.set(this.name,cr.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Mn.prototype.load_prop=function(e){return this.load(),this.props[e]},Mn.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Mn.prototype.clear=function(){this.remove(),this.props={}},Mn.prototype.register_once=function(e,t,r){return!!cr.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===r?this.default_expiry:r,this.load(),cr.each(e,(function(e,r){this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e)}),this),this.save(),!0)},Mn.prototype.register=function(e,t){return!!cr.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),cr.extend(this.props,e),this.save(),!0)},Mn.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Mn.prototype.update_search_keyword=function(e){this.register(cr.info.searchInfo(e))},Mn.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:cr.info.referringDomain(e)||"$direct"},"")},Mn.prototype.get_referrer_info=function(){return cr.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Mn.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Mn.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Mn.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Mn.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Mn.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Mn.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Mn.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Mn.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),n=t[e],o=this._get_or_create_queue(rn),i=this._get_or_create_queue(nn),s=this._get_or_create_queue(on),a=this._get_or_create_queue(sn),c=this._get_or_create_queue(cn),u=this._get_or_create_queue(un,[]),l=this._get_or_create_queue(an,[]);r===fn?(cr.extend(o,n),this._pop_from_people_queue(sn,n),this._pop_from_people_queue(cn,n),this._pop_from_people_queue(on,n)):r===mn?(cr.each(n,(function(e,t){t in i||(i[t]=e)})),this._pop_from_people_queue(on,n)):r===_n?cr.each(n,(function(e){cr.each([o,i,a,c],(function(t){e in t&&delete t[e]})),cr.each(l,(function(t){e in t&&delete t[e]})),s[e]=!0})):r===gn?(cr.each(n,(function(e,t){t in o?o[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue(on,n)):r===bn?(cr.each(n,(function(e,t){cr.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(on,n)):r===vn?(u.push(n),this._pop_from_people_queue(an,n)):r===yn&&(l.push(n),this._pop_from_people_queue(on,n)),ur.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ur.log(t),this.save()},Mn.prototype._pop_from_people_queue=function(e,t){var r=this.props[this._get_queue_key(e)];cr.isUndefined(r)||cr.each(t,(function(t,n){e===an||e===un?cr.each(r,(function(e){e[n]===t&&delete e[n]})):delete r[n]}),this)},Mn.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Mn.prototype._get_queue_key=function(e){return e===rn?fn:e===nn?mn:e===on?_n:e===sn?gn:e===an?yn:e===un?vn:e===cn?bn:void ur.error("Invalid queue:",e)},Mn.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=cr.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)},Mn.prototype.set_event_timer=function(e,t){var r=this.load_prop(wn)||{};r[e]=t,this.props[wn]=r,this.save()},Mn.prototype.remove_event_timer=function(e){var t=(this.load_prop(wn)||{})[e];return cr.isUndefined(t)||(delete this.props[wn][e],this.save()),t};var Cn,xn=function(e,t){throw new Error(e+" not available in this build.")},En=function(e){return e},On=function(){},Tn="mixpanel",Rn="base64",Nn="$device:",Dn=ct.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Ln=!Dn&&-1===tr.indexOf("MSIE")&&-1===tr.indexOf("Mozilla"),An=null;Xt.sendBeacon&&(An=function(){return Xt.sendBeacon.apply(Xt,arguments)});var qn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Pn={api_host:"https://api-js.mixpanel.com",api_routes:qn,api_method:"POST",api_transport:"XHR",api_payload_format:Rn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:On,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:On,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:$t,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Fn=!1,Un=function(){},jn=function(e,t,r){var n,o=r===Tn?Cn:Cn[r];if(o&&0===hn)n=o;else{if(o&&!cr.isArray(o))return void ur.error("You have already initialized "+r);n=new Un}if(n._cached_groups={},n._init(e,t,r),n.people=new dn,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var i=cr.info.campaignParams(null),s={},a=!1;cr.each(i,(function(e,t){s["initial_"+t]=e,e&&(a=!0)})),a&&n.people.set_once(s)}return pt.DEBUG=pt.DEBUG||n.get_config("debug"),!cr.isUndefined(o)&&cr.isArray(o)&&(n._execute_array.call(n.people,o.people),n._execute_array(o)),n};Un.prototype.init=function(e,t,r){if(cr.isUndefined(r))this.report_error("You must name your new library: init(token, config, name)");else{if(r!==Tn){var n=jn(e,t,r);return Cn[r]=n,n._loaded(),n}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Un.prototype._init=function(e,t,r){t=t||{},this.__loaded=!0,this.config={};var n={};"api_payload_format"in t||(t.api_host||Pn.api_host).match(/\.mixpanel\.com/)&&(n.api_payload_format="json");if(this.set_config(cr.extend({},Pn,n,t,{name:r,token:e,callback_fn:(r===Tn?r:Tn+"."+r)+"._jsc"})),this._jsc=On,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(cr.localStorage.is_supported(!0)&&Dn){if(this.init_batchers(),An&&ct.addEventListener){var o=cr.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);ct.addEventListener("pagehide",(function(e){e.persisted&&o()})),ct.addEventListener("visibilitychange",(function(){"hidden"===Yt.visibilityState&&o()}))}}else this._batch_requests=!1,ur.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),cr.each(this.get_batcher_configs(),(function(e){ur.log("Clearing batch queue "+e.queue_key),cr.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new Mn(this.config),this.unpersisted_superprops={},this._gdpr_init();var i=cr.UUID();this.get_distinct_id()||this.register_once({distinct_id:Nn+i,$device_id:i},"");var s=this.get_config("track_pageview");s&&this._init_url_change_tracking(s),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},Un.prototype.start_session_recording=Er((function(){if(ct.MutationObserver){var e=cr.bind((function(){this._recorder=this._recorder||new ct.__mp_recorder(this),this._recorder.startRecording()}),this);cr.isUndefined(ct.__mp_recorder)?xn(this.get_config("recorder_src"),e):e()}else ur.critical("Browser does not support MutationObserver; skipping session recording")})),Un.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():ur.critical("Session recorder module not loaded")},Un.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},Un.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+cr.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},Un.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},Un.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=cr.info.campaignParams(null);cr.each(e,function(e,t){this.unregister(t)}.bind(this))}},Un.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Yt.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(cr.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Yt.referrer)},Un.prototype._dom_loaded=function(){cr.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||cr.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},Un.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Fn)return this.__dom_loaded_queue.push([e,t]),!1;var r=(new e).init(this);return r.track.apply(r,t)},Un.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=cr.info.currentUrl()),cr.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){ct.addEventListener("popstate",(function(){ct.dispatchEvent(new Event("mp_locationchange"))})),ct.addEventListener("hashchange",(function(){ct.dispatchEvent(new Event("mp_locationchange"))}));var r=ct.history.pushState;"function"==typeof r&&(ct.history.pushState=function(e,t,n){r.call(ct.history,e,t,n),ct.dispatchEvent(new Event("mp_locationchange"))});var n=ct.history.replaceState;"function"==typeof n&&(ct.history.replaceState=function(e,t,r){n.call(ct.history,e,t,r),ct.dispatchEvent(new Event("mp_locationchange"))}),ct.addEventListener("mp_locationchange",function(){var r=cr.info.currentUrl(),n=!1;("full-url"===e?n=r!==t:"url-with-path-and-query-string"===e?n=r.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(n=r.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),n)&&(this.track_pageview()&&(t=r))}.bind(this))}},Un.prototype._prepare_callback=function(e,t){if(cr.isUndefined(e))return null;if(Dn){return function(r){e(r,t)}}var r=this._jsc,n=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+n+"]";return r[n]=function(o){delete r[n],e(o,t)},o},Un.prototype._send_request=function(e,t,r,n){var o=!0;if(Ln)return this.__request_queue.push(arguments),o;var i={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;n||!cr.isFunction(r)&&"string"!=typeof r||(n=r,r=null),r=cr.extend(i,r||{}),Dn||(r.method="GET");var a="POST"===r.method,c=An&&a&&"sendbeacon"===r.transport.toLowerCase(),u=r.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),Dn||(n?t.callback=n:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+cr.HTTPBuildQuery(t);var l=this;if("img"in t){var p=Yt.createElement("img");p.src=e,Yt.body.appendChild(p)}else if(c){try{o=An(e,s)}catch(e){l.report_error(e),o=!1}try{n&&n(o?1:0)}catch(e){l.report_error(e)}}else if(Dn)try{var d=new XMLHttpRequest;d.open(r.method,e,!0);var h=this.get_config("xhr_headers");if(a&&(h["Content-Type"]="application/x-www-form-urlencoded"),cr.each(h,(function(e,t){d.setRequestHeader(t,e)})),r.timeout_ms&&void 0!==d.timeout){d.timeout=r.timeout_ms;var f=(new Date).getTime()}d.withCredentials=!0,d.onreadystatechange=function(){var e;if(4===d.readyState)if(200===d.status){if(n)if(u){var t;try{t=cr.JSONDecode(d.responseText)}catch(e){if(l.report_error(e),!r.ignore_json_errors)return;t=d.responseText}n(t)}else n(Number(d.responseText))}else if(e=d.timeout&&!d.status&&(new Date).getTime()-f>=d.timeout?"timeout":"Bad HTTP status: "+d.status+" "+d.statusText,l.report_error(e),n)if(u){var o=d.responseHeaders||{};n({status:0,httpStatusCode:d.status,error:e,retryAfter:o["Retry-After"]})}else n(0)},d.send(s)}catch(e){l.report_error(e),o=!1}else{var m=Yt.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var _=Yt.getElementsByTagName("script")[0];_.parentNode.insertBefore(m,_)}return o},Un.prototype._execute_array=function(e){var t,r=[],n=[],o=[];cr.each(e,(function(e){e&&(t=e[0],cr.isArray(t)?o.push(e):"function"==typeof e?e.call(this):cr.isArray(e)&&"alias"===t?r.push(e):cr.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?o.push(e):n.push(e))}),this);var i=function(e,t){cr.each(e,(function(e){if(cr.isArray(e[0])){var r=t;cr.each(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};i(r,this),i(n,this),i(o,this)},Un.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Un.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},Un.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=cr.bind((function(e){return new Vr(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:cr.bind((function(t,r,n){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),r,this._prepare_callback(n,t))}),this),beforeSendHook:cr.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:cr.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},Un.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,cr.each(this.request_batchers,(function(e){e.start()})))},Un.prototype.stop_batch_senders=function(){this._batch_requests=!1,cr.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},Un.prototype.push=function(e){this._execute_array([e])},Un.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Un.prototype._encode_data_for_request=function(e){var t=cr.JSONEncode(e);return this.get_config("api_payload_format")===Rn&&(t=cr.base64Encode(t)),{data:t}},Un.prototype._track_or_batch=function(e,t){var r=cr.truncate(e.data,255),n=e.endpoint,o=e.batcher,i=e.should_send_immediately,s=e.send_request_options||{};t=t||On;var a=!0,c=cr.bind((function(){return s.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(ur.log("MIXPANEL REQUEST:"),ur.log(r),this._send_request(n,this._encode_data_for_request(r),s,this._prepare_callback(t,r))):null}),this);return this._batch_requests&&!i?o.enqueue(r).then((function(e){e?t(1,r):c()})):a=c(),a&&r},Un.prototype.track=Er((function(e,t,r,n){n||"function"!=typeof r||(n=r,r=null);var o=(r=r||{}).transport;o&&(r.transport=o);var i=r.send_immediately;if("function"!=typeof n&&(n=On),cr.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=cr.extend({},t)).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!cr.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?cr.info.marketingParams():{};t=cr.extend({},cr.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");cr.isArray(u)?cr.each(u,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+u);var l={event:e,properties:t};return this._track_or_batch({type:"events",data:l,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:i,send_request_options:r},n)}n(0)}})),Un.prototype.set_group=Er((function(e,t,r){cr.isArray(t)||(t=[t]);var n={};return n[e]=t,this.register(n),this.people.set(e,t,r)})),Un.prototype.add_group=Er((function(e,t,r){var n=this.get_property(e),o={};return void 0===n?(o[e]=[t],this.register(o)):-1===n.indexOf(t)&&(n.push(t),o[e]=n,this.register(o)),this.people.union(e,t,r)})),Un.prototype.remove_group=Er((function(e,t,r){var n=this.get_property(e);if(void 0!==n){var o=n.indexOf(t);o>-1&&(n.splice(o,1),this.register({group_key:n})),0===n.length&&this.unregister(e)}return this.people.remove(e,t,r)})),Un.prototype.track_with_groups=Er((function(e,t,r,n){var o=cr.extend({},t||{});return cr.each(r,(function(e,t){null!=e&&(o[t]=e)})),this.track(e,o,n)})),Un.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Un.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Un.prototype.get_group=function(e,t){var r=this._create_map_key(e,t),n=this._cached_groups[r];return void 0!==n&&n._group_key===e&&n._group_id===t||((n=new pn)._init(this,e,t),this._cached_groups[r]=n),n},Un.prototype.track_pageview=Er((function(e,t){"object"!=typeof e&&(e={});var r=(t=t||{}).event_name||"$mp_web_page_view",n=cr.extend(cr.info.mpPageViewProperties(),cr.info.campaignParams(),cr.info.clickParams()),o=cr.extend({},n,e);return this.track(r,o)})),Un.prototype.track_links=function(){return this._track_dom.call(this,en,arguments)},Un.prototype.track_forms=function(){return this._track_dom.call(this,tn,arguments)},Un.prototype.time_event=function(e){cr.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Bn={persistent:!0},$n=function(e){var t;return t=cr.isObject(e)?e:cr.isUndefined(e)?{}:{days:e},cr.extend({},Bn,t)};Un.prototype.register=function(e,t){var r=$n(t);r.persistent?this.persistence.register(e,r.days):cr.extend(this.unpersisted_superprops,e)},Un.prototype.register_once=function(e,t,r){var n=$n(r);n.persistent?this.persistence.register_once(e,t,n.days):(void 0===t&&(t="None"),cr.each(e,(function(e,r){this.unpersisted_superprops.hasOwnProperty(r)&&this.unpersisted_superprops[r]!==t||(this.unpersisted_superprops[r]=e)}),this))},Un.prototype.unregister=function(e,t){(t=$n(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},Un.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)},Un.prototype.identify=function(e,t,r,n,o,i,s,a){var c=this.get_distinct_id();if(e&&c!==e){if("string"==typeof e&&0===e.indexOf(Nn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==c&&e!==this.get_property(kn)&&(this.unregister(kn),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,r,n,o,i,s,a),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},Un.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=cr.UUID();this.register_once({distinct_id:Nn+e,$device_id:e},"")},Un.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Un.prototype.alias=function(e,t){if(e===this.get_property(Sn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return cr.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(kn,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){r.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Un.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Un.prototype.set_config=function(e){cr.isObject(e)&&(cr.extend(this.config,e),e.batch_size&&cr.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),pt.DEBUG=pt.DEBUG||this.get_config("debug"))},Un.prototype.get_config=function(e){return this.config[e]},Un.prototype._run_hook=function(e){var t=(this.config.hooks[e]||En).apply(this,Gt.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},Un.prototype.get_property=function(e){return this.persistence.load_prop([e])},Un.prototype.toString=function(){var e=this.get_config("name");return e!==Tn&&(e=Tn+"."+e),e},Un.prototype._event_is_disabled=function(e){return cr.isBlockedUA(tr)||this._flags.disable_all_events||cr.include(this.__disabled_events,e)},Un.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&cr.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!cr.cookie.get("mp_optout")||(cr.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Un.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},Un.prototype._gdpr_call_func=function(e,t){return t=cr.extend({track:cr.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),cr.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},Un.prototype.opt_in_tracking=function(e){e=cr.extend({enable_persistence:!0},e),this._gdpr_call_func(Ir,e),this._gdpr_update_persistence(e)},Un.prototype.opt_out_tracking=function(e){(e=cr.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Mr,e),this._gdpr_update_persistence(e)},Un.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(Cr,e)},Un.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(xr,e)},Un.prototype.clear_opt_in_out_tracking=function(e){e=cr.extend({enable_persistence:!0},e),this._gdpr_call_func(Rr,e),this._gdpr_update_persistence(e)},Un.prototype.report_error=function(e,t){ur.error.apply(ur.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){ur.error(t)}},Un.prototype.init=Un.prototype.init,Un.prototype.reset=Un.prototype.reset,Un.prototype.disable=Un.prototype.disable,Un.prototype.time_event=Un.prototype.time_event,Un.prototype.track=Un.prototype.track,Un.prototype.track_links=Un.prototype.track_links,Un.prototype.track_forms=Un.prototype.track_forms,Un.prototype.track_pageview=Un.prototype.track_pageview,Un.prototype.register=Un.prototype.register,Un.prototype.register_once=Un.prototype.register_once,Un.prototype.unregister=Un.prototype.unregister,Un.prototype.identify=Un.prototype.identify,Un.prototype.alias=Un.prototype.alias,Un.prototype.name_tag=Un.prototype.name_tag,Un.prototype.set_config=Un.prototype.set_config,Un.prototype.get_config=Un.prototype.get_config,Un.prototype.get_property=Un.prototype.get_property,Un.prototype.get_distinct_id=Un.prototype.get_distinct_id,Un.prototype.toString=Un.prototype.toString,Un.prototype.opt_out_tracking=Un.prototype.opt_out_tracking,Un.prototype.opt_in_tracking=Un.prototype.opt_in_tracking,Un.prototype.has_opted_out_tracking=Un.prototype.has_opted_out_tracking,Un.prototype.has_opted_in_tracking=Un.prototype.has_opted_in_tracking,Un.prototype.clear_opt_in_out_tracking=Un.prototype.clear_opt_in_out_tracking,Un.prototype.get_group=Un.prototype.get_group,Un.prototype.set_group=Un.prototype.set_group,Un.prototype.add_group=Un.prototype.add_group,Un.prototype.remove_group=Un.prototype.remove_group,Un.prototype.track_with_groups=Un.prototype.track_with_groups,Un.prototype.start_batch_senders=Un.prototype.start_batch_senders,Un.prototype.stop_batch_senders=Un.prototype.stop_batch_senders,Un.prototype.start_session_recording=Un.prototype.start_session_recording,Un.prototype.stop_session_recording=Un.prototype.stop_session_recording,Un.prototype.get_session_recording_properties=Un.prototype.get_session_recording_properties,Un.prototype.get_session_replay_url=Un.prototype.get_session_replay_url,Un.prototype.DEFAULT_API_ROUTES=qn,Mn.prototype.properties=Mn.prototype.properties,Mn.prototype.update_search_keyword=Mn.prototype.update_search_keyword,Mn.prototype.update_referrer_info=Mn.prototype.update_referrer_info,Mn.prototype.get_cross_subdomain=Mn.prototype.get_cross_subdomain,Mn.prototype.clear=Mn.prototype.clear;var zn={},Wn=function(){Cn.init=function(e,t,r){if(r)return Cn[r]||(Cn[r]=zn[r]=jn(e,t,r),Cn[r]._loaded()),Cn[r];var n=Cn;zn[Tn]?n=zn[Tn]:e&&((n=jn(e,t,Tn))._loaded(),zn[Tn]=n),Cn=n,1===hn&&(ct[Tn]=Cn),cr.each(zn,(function(e,t){t!==Tn&&(Cn[t]=e)})),Cn._=cr}};var Vn=(xn=function(e,t){t()},hn=0,Cn=new Un,Wn(),Cn.init(),function(){function e(){e.done||(e.done=!0,Fn=!0,Ln=!1,cr.each(zn,(function(e){e._dom_loaded()})))}if(Yt.addEventListener)"complete"===Yt.readyState?e():Yt.addEventListener("DOMContentLoaded",e,!1);else if(Yt.attachEvent){Yt.attachEvent("onreadystatechange",e);var t=!1;try{t=null===ct.frameElement}catch(e){}Yt.documentElement.doScroll&&t&&function t(){try{Yt.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}()}cr.register_event(ct,"load",e,!0)}(),Cn);const Hn="rid",Gn="rozmovaAnalyticsParams",Jn=["utm_source","utm_medium","utm_campaign","utm_campaign_id","utm_advertiser_id","utm_adset_id","utm_adset_name","utm_ad_id","utm_ad_name","utm_keyword"],Qn="G-GYQLL028VQ",Kn="https://tagging.clearly.help",Xn=["en","uk","pl","es","ru"],Yn=e=>new URLSearchParams(window.location.search).get(e);function Zn(){const e=navigator.userAgent;return e.indexOf("Edg")>-1?"Microsoft Edge":e.indexOf("Chrome")>-1?"Chrome":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("Safari")>-1?"Safari":e.indexOf("Opera")>-1?"Opera":e.indexOf("Trident")>-1||e.indexOf("MSIE")>-1?"Internet Explorer":"Unknown"}function eo(){const e=navigator.userAgent;return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)?"Mobile":"Desktop"}function to(){const e=navigator.userAgent;return e.includes("Win")?"Windows":e.includes("Mac")?"macOS":e.includes("X11")||e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("like Mac")?"iOS":"Unknown OS"}const ro=()=>{const e=window.location.hostname.split("."),t=e.length;return 1===e.length?e[0]:e.slice(t-2,t).join(".")},no=()=>{const e=document.referrer;if(e){if(new URL(e).hostname.includes(ro()))return null}return e};function oo(){const e=no();if(!e)return null;const t={"google.com":"q","bing.com":"q","yahoo.com":"p","duckduckgo.com":"q","ask.com":"q","baidu.com":"wd","yandex.com":"text"},r=new URL(e);for(const[e,n]of Object.entries(t))if(r.hostname.includes(e)){const e=r.searchParams.get(n);return e?decodeURIComponent(e):null}return null}const io=()=>{const e=n.get("_ga");if(!e)return"";const t=e.split(".");return t[2]+"."+t[3]};function so(){const e=document.cookie.match(/_ga_GYQLL028VQ=GS\d\.\d\.(.+?)(?:;|$)/),t=e?.[1].split(".");return t?t[0]:null}const ao=()=>{const e=window.location.pathname.split("/")[1];return Xn.includes(e)?e:window.location.hostname.includes("clearly")?"en":"uk"};const co=e=>{const t=ro();n.set(Hn,e,{domain:t}),localStorage.setItem(Hn,e)},uo=()=>{const e=((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))();return co(e),e},lo=()=>{const e=Yn(Hn);return e&&co(e),e||localStorage.getItem(Hn)||n.get(Hn)||uo()};var po=new class{initialized=!1;locale="uk";platform="web";dataLayer=[];init(e,t){if(this.initialized)return;!function(){const e=document.createElement("script");e.type="text/javascript",e.text='\n (function(){\n var analytics = window.analytics = window.analytics || [];\n if (!analytics.initialize) \n if (analytics.invoked) \n window.console && console.error && console.error("Snippet included twice.");\n else {\n analytics.invoked = !0;\n analytics.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on", "addSourceMiddleware", "addIntegrationMiddleware", "setAnonymousId", "addDestinationMiddleware"];\n analytics.factory = function(e) {\n return function() {\n var t = Array.prototype.slice.call(arguments);\n t.unshift(e);\n analytics.push(t);\n return analytics;\n }\n };\n for (var e = 0; e < analytics.methods.length; e++) {\n var key = analytics.methods[e];\n analytics[key] = analytics.factory(key);\n }\n analytics.load = function(key, e) {\n var t = document.createElement("script");\n t.type = "text/javascript";\n t.async = !0;\n t.src = "https://cdp-eu.customer.io/v1/analytics-js/snippet/" + key + "/analytics.min.js";\n var n = document.getElementsByTagName("script")[0];\n n.parentNode.insertBefore(t, n);\n analytics._writeKey = key;\n analytics._loadOptions = e;\n };\n analytics.SNIPPET_VERSION = "4.15.3";\n analytics.load("e6d009719c77519432c3");\n analytics.page();\n }\n })();\n ',document.head.appendChild(e)}(),(()=>{const e=Yn("geo");if(e){const t=ro();n.set("geo",e,{domain:t})}})();const r=lo();(navigator.userAgent||navigator.vendor||window.opera).match(/FBAN|FBAV|Instagram/i)&&((e,t)=>{const r=new URL(window.location.href);r.searchParams.set(e,t),window.history.replaceState({path:r.toString()},"",r.toString())})(Hn,r),Vn.init("9d4cb3d213e5aee689ea01dd68ad65ad",{debug:!1,track_pageview:"url-with-path",persistence:"cookie"}),this.locale=e||ao(),t&&(this.platform=t);const o=this.getCommonParams();for(Vn.register(o),gtag("config",Qn,{user_properties:o,server_container_url:Kn}),this.initialized=!0;this.dataLayer.length>0;){const e=this.dataLayer.shift();this.trackEvent(e?.eventName,e?.eventParams)}}trackEvent(e,t){if(!this.initialized)return void this.dataLayer.push({eventName:e,eventParams:t});const r={...this.getCommonParams(),...t};try{Vn.track(e,r)}catch(e){console.log(e)}try{gtag("event",e,r)}catch(e){console.log(e)}try{window.analytics.track(e,r)}catch(e){console.log(e)}}setUser(e,t){if(!this.initialized)return void console.warn("Analytics is not initialized.");const{email:r,name:n}=t;Vn.identify(e),Vn.people.set({$email:r,name:n}),gtag("config",Qn,{user_properties:this.getCommonParams(),user_id:e,server_container_url:Kn}),window.analytics.identify(e,t)}getCommonParams(){return{...(()=>{const e=n.get(Gn),t=e?JSON.parse(e):{},r=new URLSearchParams(window.location.search),o={...Jn.some((e=>r.get(e)&&r.get(e)!==t[e]))?Jn.reduce(((e,t)=>({...e,[t]:r.get(t)})),{}):Jn.reduce(((e,r)=>({...e,[r]:t[r]})),{}),referrer:no()||t.referrer,search_query:oo()||t.search_query,landing_page_url:t.landing_page_url||window.location.href};return n.set(Gn,JSON.stringify(o),{domain:ro()}),o})(),fbc:n.get("_fbc"),fbp:n.get("_fbp"),session_id:so(),user_pseudo_id:io(),rid:lo(),funnel_name:n.get("funnel_name"),funnel_type:n.get("funnel_type"),language:window.navigator.language,platform:this.platform,url:window.location.href,device:eo(),browser:Zn(),system:to(),locale:this.locale}}setLocale(e){this.locale=e}resetUser(){this.initialized?(Vn.reset(),window.analytics.reset(),uo(),this.init()):console.warn("Analytics is not initialized.")}getUserId=lo};return po}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rozmova-analytics",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "A collection of JavaScript functions for Rozmova analytics",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",