posthog-js 1.187.0 → 1.187.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -10
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -10
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -10
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -10
- package/dist/array.no-external.js.map +1 -1
- package/dist/dead-clicks-autocapture.js +1 -1
- package/dist/dead-clicks-autocapture.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/external-scripts-loader.js +1 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/main.js +1 -10
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -10
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -10
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -10
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.js +1 -10
- package/dist/module.no-external.js.map +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/dist/tracing-headers.js +1 -1
- package/dist/tracing-headers.js.map +1 -1
- package/dist/web-vitals.js +1 -1
- package/dist/web-vitals.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/dist/array.full.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var e,t=Object.defineProperty,n=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i),i=Object.defineProperty,r=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),o=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(o||{});const s={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};function c(e){if(l[e])return l[e];const t=globalThis[e],n=t.prototype,i=e in s?s[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in a?a[e]:void 0,c=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&c)return l[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?l[e]=o:n}catch{return n}}const u={};function d(e,t,n){var i;const r=`${e}.${String(n)}`;if(u[r])return u[r].call(t);const o=c(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(u[r]=s,s.call(t)):t[n]}const h={};function p(e,t,n){const i=`${e}.${String(n)}`;if(h[i])return h[i].bind(t);const r=c(e)[n];return"function"!=typeof r?t[n]:(h[i]=r,r.bind(t))}const g={childNodes:function(e){return d("Node",e,"childNodes")},parentNode:function(e){return d("Node",e,"parentNode")},parentElement:function(e){return d("Node",e,"parentElement")},textContent:function(e){return d("Node",e,"textContent")},contains:function(e,t){return p("Node",e,"contains")(t)},getRootNode:function(e){return p("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?d("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?d("Element",e,"shadowRoot"):null},querySelector:function(e,t){return d("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return d("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return c("MutationObserver").constructor}};function f(e){return e.nodeType===e.ELEMENT_NODE}function m(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function _(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function v(e){try{const n=e.rules||e.cssRules;if(!n)return null;const i=Array.from(n,(t=>y(t,e.href))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function y(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=v(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?A(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?A(n,t):n}}function b(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let w=class{constructor(){r(this,"idNodeMap",new Map),r(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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 n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function S(e){let{element:t,maskInputOptions:n,tagName:i,type:r,value:o,maskInputFn:s}=e,a=o||"";const l=r&&C(r);return(n[i.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function C(e){return e.toLowerCase()}const I="__rrweb_original__";function k(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?C(t):null}function E(e,t){var n;let i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==r?void 0:r[1])&&void 0!==n?n:null}const x=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,T=/^(?:[a-z+]+:)?\/\//i,M=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(x,((e,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return e;if(T.test(a)||M.test(a))return`url(${l}${a}${l})`;if(R.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${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}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}let N=1;const F=new RegExp("[^a-z0-9-_:]"),O=-2;function L(){return N++}let P,D;const $=/^[^ \t\n\r\u000c]+/,B=/^[, \t\n\r\u000c]+/;const H=new WeakMap;function q(e,t){return t&&""!==t.trim()?V(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function V(e,t){let n=H.get(e);if(n||(n=e.createElement("a"),H.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Z(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?q(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function i(e){let i;const r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(B),!(n>=t.length);){let o=i($);if(","===o.slice(-1))o=q(e,o.substring(0,o.length-1)),r.push(o);else{let i="";o=q(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((o+i).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,r.push((o+i).trim());break}"("===e&&(s=!0)}i+=e,n+=1}}}return r.join(", ")}(e,i):"style"===n?A(i,V(e)):"object"===t&&"data"===n?q(e,i):i:q(e,i):i}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function U(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&U(g.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&U(g.parentNode(e),t,n)}function z(e,t,n,i){let r;if(f(e)){if(r=e,!g.childNodes(r).length)return!1}else{if(null===g.parentElement(e))return!1;r=g.parentElement(e)}try{if("string"==typeof t){if(i){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(U(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(e){}return!1}function j(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:o.Document,childNodes:[],compatMode:e.compatMode}:{type:o.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:f}=t,m=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,r),_=function(e){if(e instanceof HTMLFormElement)return"form";const t=C(e.tagName);return F.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const i=e.attributes[t];G(_,i.name,i.value)||(y[i.name]=Z(n,_,C(i.name),i.value))}if("link"===_&&s){const t=e.href;let i=b(n,t);if(!i&&t.includes(".css")){i=b(n,window.location.origin+"/"+t.replace(window.location.href,""))}let r=null;i&&(r=v(i)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===_&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){const t=v(e.sheet);t&&(y._cssText=t)}if("input"===_||"textarea"===_||"select"===_){const t=e.value,n=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=S({element:e,type:k(e),tagName:_,value:t,maskInputOptions:a,maskInputFn:l}):n&&(y.checked=n)}"option"===_&&(e.selected&&!a.select?y.selected=!0:delete y.selected);"dialog"===_&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===_&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let i=0;i<e.height;i+=50){const r=t.getImageData,o=I in r?r[I]:r;if(new Uint32Array(o.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=e.width,i.height=e.height;t!==i.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===_&&u){P||(P=n.createElement("canvas"),D=P.getContext("2d"));const t=e,i=t.currentSrc||t.getAttribute("src")||"<unknown-src>",r=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{P.width=t.naturalWidth,P.height=t.naturalHeight,D.drawImage(t,0,0),y.rr_dataURL=P.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${i}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(r?y.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===_||"video"===_){const t=y;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}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==_||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let E;try{customElements.get(_)&&(E=!0)}catch(e){}return{type:o.Element,tagName:_,attributes:y,childNodes:[],isSVG:W(e)||void 0,needBlock:m,rootId:f,isCustom:E}}(e,{doc:n,blockClass:r,blockSelector:s,inlineStylesheet:l,maskInputOptions:c,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_,rootId:y});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:i,maskTextFn:r,rootId:s}=t,a=g.parentNode(e),l=a&&a.tagName;let c=g.textContent(e);const u="STYLE"===l||void 0,d="SCRIPT"===l||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null==(n=a.sheet)?void 0:n.cssRules)&&(c=v(a.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}c=A(c,V(t.doc))}d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&i&&(c=r?r(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:o.Text,textContent:c||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:u,rootId:y});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:o.Comment,textContent:g.textContent(e)||"",rootId:y};default:return!1}}function Y(e){return null==e?"":e.toLowerCase()}function X(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:M=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:A=!0}=t;if(!R){R=z(e,a,l,void 0===R)}const N=j(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:T,newlyAddedElement:M});if(!N)return console.warn(e,"not serialized"),null;let F;F=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===o.Comment)return!0;if(e.type===o.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"===E(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}(N,v)&&(A||N.type!==o.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?L():O;const P=Object.assign(N,{id:F});if(i.add(e,P),F===O)return null;S&&S(e);let D=!c;if(P.type===o.Element){D=D&&!P.needBlock,delete P.needBlock;const t=g.shadowRoot(e);t&&_(t)&&(P.isShadowHost=!0)}if((P.type===o.Document||P.type===o.Element)&&D){v.headWhitespace&&P.type===o.Element&&"head"===P.tagName&&(A=!1);const t={doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T};if(P.type===o.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(g.childNodes(e))){const e=X(n,t);e&&P.childNodes.push(e)}let m=null;if(f(e)&&(m=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(m))){const n=X(e,t);n&&(_(m)&&(n.isShadow=!0),P.childNodes.push(n))}}const $=g.parentNode(e);return $&&m($)&&_($)&&(P.isShadow=!0),P.type===o.Element&&"iframe"===P.tagName&&function(e,t,n){const i=e.contentWindow;if(!i)return;let r,o=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){const i=setTimeout((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}const s="about:blank";if(i.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&&C){const n=X(t,{doc:t,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});n&&C(e,n)}}),I),P.type===o.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===E(P.attributes.href))&&function(e,t,n){let i,r=!1;try{i=e.sheet}catch(e){return}if(i)return;const o=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),r=!0,t()}))}(e,(()=>{if(k){const t=X(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});t&&k(e,t)}}),x),P}let J=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};const K={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Q={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ee={};function te(e){if(ee[e])return ee[e];const t=globalThis[e],n=t.prototype,i=e in K?K[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Q?Q[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return ee[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?ee[e]=o:n}catch{return n}}const ne={};function ie(e,t,n){var i;const r=`${e}.${String(n)}`;if(ne[r])return ne[r].call(t);const o=te(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(ne[r]=s,s.call(t)):t[n]}const re={};function oe(e,t,n){const i=`${e}.${String(n)}`;if(re[i])return re[i].bind(t);const r=te(e)[n];return"function"!=typeof r?t[n]:(re[i]=r,r.bind(t))}function se(){return te("MutationObserver").constructor}const ae={childNodes:function(e){return ie("Node",e,"childNodes")},parentNode:function(e){return ie("Node",e,"parentNode")},parentElement:function(e){return ie("Node",e,"parentElement")},textContent:function(e){return ie("Node",e,"textContent")},contains:function(e,t){return oe("Node",e,"contains")(t)},getRootNode:function(e){return oe("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ie("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ie("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ie("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ie("Element",e,"querySelectorAll")(t)},mutationObserver:se};function le(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}const ce="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 ue={map:{},getId:()=>(console.error(ce),-1),getNode:()=>(console.error(ce),null),removeNodeFromMap(){console.error(ce)},has:()=>(console.error(ce),!1),reset(){console.error(ce)}};function de(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}}function he(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const o=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>he(e,t,o||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ue=new Proxy(ue,{get:(e,t,n)=>("map"===t&&console.error(ce),Reflect.get(e,t,n))}));let ge=Date.now;function fe(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ae.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=ae.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}}function me(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ve(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ae.parentElement(e)}function ye(e,t,n,i){if(!e)return!1;const r=ve(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(U(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function be(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===O}function we(e,t){if(m(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const i=ae.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||we(i,t))}function Se(e){return Boolean(e.changedTouches)}function Ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ie(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ke(e){return!!e&&(e instanceof J&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ae.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ge=()=>(new Date).getTime());let Ee=class{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(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 n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 xe(e){var t;let n=null;return"getRootNode"in e&&(null==(t=ae.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ae.host(ae.getRootNode(e))&&(n=ae.host(ae.getRootNode(e))),n}function Te(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=xe(n);)n=t;return n}(e);return ae.contains(t,n)}function Me(e){const t=e.ownerDocument;return!!t&&(ae.contains(t,e)||Te(e))}var Re=(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))(Re||{}),Ae=(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))(Ae||{}),Ne=(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))(Ne||{}),Fe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Fe||{}),Oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Oe||{}),Le=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Le||{});function Pe(e){return"__ln"in e}class De{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)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&&Pe(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Pe(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;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 $e=(e,t)=>`${e}@${t}`;class Be{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),n(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new De,i=e=>{let t=e,n=O;for(;n===O;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{const o=ae.parentNode(r);if(!o||!Me(r)||"TEXTAREA"===o.tagName)return;const s=m(o)?this.mirror.getId(xe(r)):this.mirror.getId(o),a=i(r);if(-1===s||-1===a)return n.addNode(r);const l=X(r,{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=>{Ce(e,this.mirror)&&this.iframeManager.addIframe(e),Ie(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ke(r)&&this.shadowDomManager.addShadowRoot(ae.shadowRoot(r),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)qe(this.removes,e,this.mirror)&&!this.movedSet.has(ae.parentNode(e))||r(e);for(const e of this.addedSet)We(this.droppedSet,e)||qe(this.removes,e,this.mirror)?We(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(ae.parentNode(o.value)),n=i(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(ae.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,i=ae.parentNode(t);if(i&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ae.host(i);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),r(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,n=ae.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{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 n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+i).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};(s.texts.length||s.attributes.length||s.removes.length||s.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(s))})),n(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(ae.childNodes(e),(e=>ae.textContent(e)||"")).join("")})),n(this,"processMutation",(e=>{if(!be(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ae.textContent(e.target);ye(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:z(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ve(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){const e=k(t);i=S({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(ye(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let r=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(t.contentDocument)return;n="rr_src"}if(r||(r={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(e.target,r)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!G(t.tagName,n))if(r.attributes[n]=Z(this.doc,C(t.tagName),C(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const i=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);i!==n.style.getPropertyValue(e)||o!==n.style.getPropertyPriority(e)?r.styleDiff[e]=""===o?i:[i,o]:r._unchangedStyles[e]=[i,o]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":if(ye(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 n=this.mirror.getId(t),i=m(e.target)?this.mirror.getId(ae.host(e.target)):this.mirror.getId(e.target);ye(e.target,this.blockClass,this.blockSelector,!1)||be(t,this.mirror,this.slimDOMOptions)||!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===n||we(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$e(n,i)]?He(this.movedSet,t):this.removes.push({parentId:i,id:n,isShadow:!(!m(e.target)||!_(e.target))||void 0})),this.mapRemoves.push(t))}))}})),n(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(be(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[$e(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ye(e,this.blockClass,this.blockSelector,!1)||(ae.childNodes(e).forEach((e=>this.genAdds(e))),ke(e)&&ae.childNodes(ae.shadowRoot(e)).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),ae.childNodes(t).forEach((t=>He(e,t)))}function qe(e,t,n){return 0!==e.length&&function(e,t,n){let i=ae.parentNode(t);for(;i;){const t=n.getId(i);if(e.some((e=>e.id===t)))return!0;i=ae.parentNode(i)}return!1}(e,t,n)}function We(e,t){return 0!==e.size&&Ve(e,t)}function Ve(e,t){const n=ae.parentNode(t);return!!n&&(!!e.has(n)||Ve(e,n))}let Ze;const Ge=e=>{if(!Ze)return e;return function(){try{return e(...arguments)}catch(e){if(Ze&&!0===Ze(e))return;throw e}}},Ue=[];function ze(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{}return e&&e.target}function je(e,t){const n=new Be;Ue.push(n),n.init(e);const i=new(se())(Ge(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ye(e){let{mouseInteractionCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let c=null;return Object.keys(Ne).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=C(e);const a=(e=>n=>{const s=ze(n);if(ye(s,r,o,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=Fe.Mouse;break;case"touch":a=Fe.Touch;break;case"pen":a=Fe.Pen}a===Fe.Touch?Ne[e]===Ne.MouseDown?l="TouchStart":Ne[e]===Ne.MouseUp&&(l="TouchEnd"):Fe.Pen}else Se(n)&&(a=Fe.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Fe.Touch||l.startsWith("Mouse")&&a===Fe.Mouse)&&(a=null)):Ne[e]===Ne.Click&&(a=c,c=null);const u=Se(n)?n.changedTouches[0]:n;if(!u)return;const d=i.getId(s),{clientX:h,clientY:p}=u;Ge(t)({type:Ne[l],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(Ne[e]){case Ne.MouseDown:case Ne.MouseUp:s=s.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}l.push(le(s,a,n))})),Ge((()=>{l.forEach((e=>e()))}))}function Xe(e){let{scrollCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,sampling:s}=e;return le("scroll",Ge(de(Ge((e=>{const s=ze(e);if(!s||ye(s,r,o,!0))return;const a=i.getId(s);if(s===n&&n.defaultView){const e=fe(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})})),s.scroll||100)),n)}const Je=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Qe(e){return function(e,t){if(it("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||it("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||it("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||it("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function et(e,t,n){let i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function tt(e,t){let{mirror:n,stylesheetManager:i}=e;var r,o,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(ae.host(t));const l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(s=null==(o=t.ownerDocument)?void 0:o.defaultView)?void 0:s.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{i.adoptStyleSheets(e,a)}catch(e){}return n}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let i;!function(e,t){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),r(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(i=je(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:i,mirror:r}=e;if(!1===n.mousemove)return()=>{};const o="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=de(Ge((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=Ge(de(Ge((e=>{const t=ze(e),{clientX:n,clientY:i}=Se(e)?e.changedTouches[0]:e;a||(a=ge()),l.push({x:n,y:i,id:r.getId(t),timeOffset:ge()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ae.Drag:e instanceof MouseEvent?Ae.MouseMove:Ae.TouchMove)})),o,{trailing:!1})),d=[le("mousemove",u,i),le("touchmove",u,i),le("drag",u,i)];return Ge((()=>{d.forEach((e=>e()))}))}(e),o=Ye(e),s=Xe(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:i}=t,r=-1,o=-1;return le("resize",Ge(de(Ge((()=>{const e=me(),t=_e();r===e&&o===t||(n({width:Number(t),height:Number(e)}),r=e,o=t)})),200)),i)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function h(e){let t=ze(e);const i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=ae.parentElement(t)),!t||!u||Je.indexOf(u)<0||ye(t,r,o,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let h=t.value,g=!1;const f=k(t)||"";"radio"===f||"checkbox"===f?g=t.checked:(l[u.toLowerCase()]||l[f])&&(h=S({element:t,maskInputOptions:l,tagName:u,type:f,value:h,maskInputFn:c})),p(t,d?{text:h,isChecked:g,userTriggered:i}:{text:h,isChecked:g});const m=t.name;"radio"===f&&m&&g&&n.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==t){const t=e.value;p(e,d?{text:t,isChecked:!g,userTriggered:!1}:{text:t,isChecked:!g})}}))}function p(e,n){const r=Ke.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){Ke.set(e,n);const r=i.getId(e);Ge(t)({...n,id:r})}}const g=("last"===u.input?["change"]:["input","change"]).map((e=>le(e,Ge(h),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>he(e[0],e[1],{set(){Ge(h)({target:this,isTrusted:!1})}},!1,f)))),Ge((()=>{g.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:i,mirror:r,sampling:o,doc:s}=e;const a=Ge((e=>de(Ge((o=>{const s=ze(o);if(!s||ye(s,n,i,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:r.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),o.media||500))),l=[le("play",a(Le.Play),s),le("pause",a(Le.Pause),s),le("seeked",a(Le.Seeked),s),le("volumechange",a(Le.VolumeChange),s),le("ratechange",a(Le.RateChange),s)];return Ge((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:i,stylesheetManager:r}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};const s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length;const i=`${e} { ${t} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const a=o.CSSStyleSheet.prototype.deleteRule;let l,c;o.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(l=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));const u={};rt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(rt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),rt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),rt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t.parentStyleSheet,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Qe(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t.parentStyleSheet,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Qe(t),s]}]}),e.apply(t,o)}))})})),Ge((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=a,l&&(o.CSSStyleSheet.prototype.replace=l),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),d=tt(e,e.doc),h=function(e,t){let{styleDeclarationCb:n,mirror:i,ignoreCSSAttributes:r,stylesheetManager:o}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ge(((e,t,s)=>{var l;const[c,u,d]=s;if(r.has(c))return a.apply(t,[c,u,d]);const{id:h,styleId:p}=et(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:Qe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,s)=>{var a;const[c]=s;if(r.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=et(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Qe(t.parentRule)}),e.apply(t,s)}))}),Ge((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(p=function(e){let{fontCb:t,doc:n}=e;const i=n.defaultView;if(!i)return()=>{};const r=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,n){const i=new s(e,t,n);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};const a=pe(n.fonts,"add",(function(e){return function(n){return setTimeout(Ge((()=>{const e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{i.FontFace=s})),r.push(a),Ge((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=e;let s=!0;const a=Ge((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=o;ye(s,i,r,!0)||ye(c,i,r,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}o({ranges:a})}));return a(),le("selectionchange",a)}(e),f=function(e){let{doc:t,customElementCb:n}=e;const i=t.defaultView;if(!i||!i.customElements)return()=>{};const r=pe(i.customElements,"define",(function(e){return function(t,i,r){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,i,r])}}));return r}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Ge((()=>{Ue.forEach((e=>e.reset())),null==i||i.disconnect(),r(),o(),s(),a(),l(),c(),u(),d(),h(),p(),g(),f(),m.forEach((e=>e()))}))}function it(e){return void 0!==window[e]}function rt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ot{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,i){const r=n||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,i)))}getRemoteId(e,t,n){const i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=i.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}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 st{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new ot(L)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ot(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 n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.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 n=this.crossOriginIframeMap.get(e.source);if(!n)return;const i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Re.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Re.IncrementalSnapshot,data:{source:Ae.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Re.Meta:case Re.Load:case Re.DomContentLoaded:return!1;case Re.Plugin:return t;case Re.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Re.IncrementalSnapshot:switch(t.data.source){case Ae.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 Ae.Drag:case Ae.TouchMove:case Ae.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ae.ViewportResize:return!1;case Ae.MediaInteraction:case Ae.MouseInteraction:case Ae.Scroll:case Ae.CanvasMutation:case Ae.Input:return this.replaceIds(t.data,e,["id"]),t;case Ae.StyleSheetRule:case Ae.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ae.Font:return t;case Ae.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ae.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,i){for(const r of i)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===o.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class at{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(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(!_(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=je({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Xe({...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(ae.host(e))),this.restoreHandlers.push(tt({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 n=this;this.restoreHandlers.push(pe(e.prototype,"attachShadow",(function(e){return function(i){const r=e.call(this,i),o=ae.shadowRoot(this);return o&&Me(this)&&n.addShadowRoot(o,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ut=0;ut<64;ut++)ct[lt.charCodeAt(ut)]=ut;const dt=new Map;const ht=(e,t,n)=>{if(!e||!ft(e,t)&&"object"!=typeof e)return;const i=function(e,t){let n=dt.get(e);return n||(n=new Map,dt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r};function pt(e,t,n){if(e instanceof Array)return e.map((e=>pt(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),i=n.length,r="";for(t=0;t<i;t+=3)r+=lt[n[t]>>2],r+=lt[(3&n[t])<<4|n[t+1]>>4],r+=lt[(15&n[t+1])<<2|n[t+2]>>6],r+=lt[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[pt(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[pt(e.data,t,n),e.width,e.height]}}if(ft(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ht(e,t,n)}}return e}const gt=(e,t,n)=>e.map((e=>pt(e,t,n))),ft=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function mt(e,t,n,i){const r=[];try{const o=pe(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!ye(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),i&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[r,...s])}}));r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function _t(e,t,n,i,r,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=pe(e,l,(function(e){return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];const u=e.apply(this,a);if(ht(u,o,this),"tagName"in this.canvas&&!ye(this.canvas,i,r,!0)){const e=gt(a,o,this),i={type:t,property:l,args:e};n(this.canvas,i)}return u}}));s.push(a)}catch{const i=he(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(i)}return s}const vt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",yt="undefined"!=typeof window&&window.Blob&&new Blob([(bt=vt,Uint8Array.from(atob(bt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var bt;function wt(e){let t;try{if(t=yt&&(window.URL||window.webkitURL).createObjectURL(yt),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+vt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class St{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(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:i,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(i,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,i,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,i,r){const o=mt(t,n,i,!0),s=new Map,a=new wt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:r,height:o}=e.data;this.mutationCb({id:t,type:Oe["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],r=t=>{t.querySelectorAll("canvas").forEach((t=>{ye(t,n,i,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&r(e.shadowRoot)}))};return r(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=e.clientWidth||e.width,o=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:i,resizeHeight:o});a.postMessage({id:n,bitmap:l,width:i,height:o,dataURLOptions:r.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=mt(e,t,n,!1),r=function(e,t,n,i){const r=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=pe(t.CanvasRenderingContext2D.prototype,s,(function(r){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ye(this.canvas,n,i,!0)||setTimeout((()=>{const n=gt(a,t,this);e(this.canvas,{type:Oe["2D"],property:s,args:n})}),0),r.apply(this,a)}}));r.push(o)}catch{const n=he(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Oe["2D"],property:s,args:[t],setter:!0})}});r.push(n)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,i){const r=[];return r.push(..._t(t.WebGLRenderingContext.prototype,Oe.WebGL,e,n,i,t)),void 0!==t.WebGL2RenderingContext&&r.push(..._t(t.WebGL2RenderingContext.prototype,Oe.WebGL2,e,n,i,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{i(),r(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const{type:t,...n}=e;return n})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}class Ct{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(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 n={id:t,styleIds:[]},i=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,n)=>({rule:y(e,t.href),index:n})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class It{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let kt,Et,xt,Tt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}const Mt=new w;function Rt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:N}=e;Ze=N;const F=!I||window.parent===window;let O=!1;if(!F)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!O)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),Mt.reset();const L=!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},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let D;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}();let $=0;const B=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!O&&(e=_(e)),e};kt=(e,r)=>{var o;const s=e;if(s.timestamp=ge(),!(null==(o=Ue[0])?void 0:o.isFrozen())||s.type===Re.FullSnapshot||s.type===Re.IncrementalSnapshot&&s.data.source===Ae.Mutation||Ue.forEach((e=>e.unfreeze())),F)null==t||t(B(s),r);else if(O){const e={type:"rrweb",event:B(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(e,"*")}if(s.type===Re.FullSnapshot)D=s,$=0;else if(s.type===Re.IncrementalSnapshot){if(s.data.source===Ae.Mutation&&s.data.isAttachIframe)return;$++;const e=i&&$>=i,t=n&&s.timestamp-D.timestamp>n;(e||t)&&Et(!0)}};const H=e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Mutation,...e}})},q=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Scroll,...e}}),W=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.CanvasMutation,...e}}),V=new Ct({mutationCb:H,adoptedStyleSheetCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.AdoptedStyleSheet,...e}})}),Z=new st({mirror:Mt,mutationCb:H,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:kt});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Mt,crossOriginIframeMirror:Z.crossOriginIframeMirror,crossOriginIframeStyleMirror:Z.crossOriginIframeStyleMirror});const G=new It;xt=new St({recordCanvas:C,mutationCb:W,win:window,blockClass:r,blockSelector:o,mirror:Mt,sampling:v.canvas,dataURLOptions:y});const U=new at({mutationCb:H,scrollCb:q,bypassOptions:{blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:y,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:T,sampling:v,slimDOMOptions:P,iframeManager:Z,stylesheetManager:V,canvasManager:xt,keepIframeSrcFn:R,processedNodeManager:G},mirror:Mt});Et=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!S)return;kt({type:Re.Meta,data:{href:window.location.href,width:_e(),height:me()}},e),V.reset(),U.init(),Ue.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new w,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:g,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return X(e,{doc:e,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:Mt,blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:f,maskInputFn:g,slimDOM:P,dataURLOptions:y,recordCanvas:C,inlineImages:T,onSerialize:e=>{Ce(e,Mt)&&Z.addIframe(e),Ie(e,Mt)&&V.trackLinkElement(e),ke(e)&&U.addShadowRoot(ae.shadowRoot(e),document)},onIframeLoad:(e,t)=>{Z.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kt({type:Re.FullSnapshot,data:{node:t,initialOffset:fe(window)}},e),Ue.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Mt.getId(document))};try{const e=[],t=e=>{var t;return Ge(nt)({mutationCb:H,mousemoveCb:(e,t)=>kt({type:Re.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.ViewportResize,...e}}),inputCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Input,...e}}),mediaInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MediaInteraction,...e}}),styleSheetRuleCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleSheetRule,...e}}),styleDeclarationCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Font,...e}}),selectionCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Selection,...e}})},customElementCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.CustomElement,...e}})},blockClass:r,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:T,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:P,dataURLOptions:y,mirror:Mt,iframeManager:Z,stylesheetManager:V,shadowDomManager:U,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:A,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Re.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};Z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{Et(),e.push(t(document)),Tt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(le("DOMContentLoaded",(()=>{kt({type:Re.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(le("load",(()=>{kt({type:Re.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),G.destroy(),Tt=!1,Ze=void 0}}catch(e){console.warn(e)}}var At,Nt;Rt.addCustomEvent=(e,t)=>{if(!Tt)throw new Error("please add custom event after start recording");kt({type:Re.Custom,data:{tag:e,payload:t}})},Rt.freezePage=()=>{Ue.forEach((e=>e.freeze()))},Rt.takeFullSnapshot=e=>{if(!Tt)throw new Error("please take full snapshot after start recording");Et(e)},Rt.mirror=Mt,(Nt=At||(At={}))[Nt.NotStarted=0]="NotStarted",Nt[Nt.Running=1]="Running",Nt[Nt.Stopped=2]="Stopped";var Ft,Ot=Object.defineProperty,Lt=(e,t,n)=>((e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Pt=Object.defineProperty,Dt=(e,t,n)=>((e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),$t=Object.defineProperty,Bt=(e,t,n)=>((e,t,n)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const Ht={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wt={};function Vt(e){if(Wt[e])return Wt[e];const t=globalThis[e],n=t.prototype,i=e in Ht?Ht[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in qt?qt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return Wt[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?Wt[e]=o:n}catch{return n}}const Zt={};function Gt(e,t,n){var i;const r=`${e}.${String(n)}`;if(Zt[r])return Zt[r].call(t);const o=Vt(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(Zt[r]=s,s.call(t)):t[n]}const Ut={};function zt(e,t,n){const i=`${e}.${String(n)}`;if(Ut[i])return Ut[i].bind(t);const r=Vt(e)[n];return"function"!=typeof r?t[n]:(Ut[i]=r,r.bind(t))}const jt={childNodes:function(e){return Gt("Node",e,"childNodes")},parentNode:function(e){return Gt("Node",e,"parentNode")},parentElement:function(e){return Gt("Node",e,"parentElement")},textContent:function(e){return Gt("Node",e,"textContent")},contains:function(e,t){return zt("Node",e,"contains")(t)},getRootNode:function(e){return zt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Gt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Gt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Gt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Vt("MutationObserver").constructor}};class Yt{constructor(){Bt(this,"idNodeMap",new Map),Bt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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 n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Xt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Xt(jt.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&Xt(jt.parentNode(e),t,n)}class Jt{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Jt))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Kt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},en={};function tn(e){if(en[e])return en[e];const t=globalThis[e],n=t.prototype,i=e in Kt?Kt[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Qt?Qt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return en[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?en[e]=o:n}catch{return n}}const nn={};function rn(e,t,n){var i;const r=`${e}.${String(n)}`;if(nn[r])return nn[r].call(t);const o=tn(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(nn[r]=s,s.call(t)):t[n]}const on={};function sn(e,t,n){const i=`${e}.${String(n)}`;if(on[i])return on[i].bind(t);const r=tn(e)[n];return"function"!=typeof r?t[n]:(on[i]=r,r.bind(t))}const an={childNodes:function(e){return rn("Node",e,"childNodes")},parentNode:function(e){return rn("Node",e,"parentNode")},parentElement:function(e){return rn("Node",e,"parentElement")},textContent:function(e){return rn("Node",e,"textContent")},contains:function(e,t){return sn("Node",e,"contains")(t)},getRootNode:function(e){return sn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?rn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?rn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return rn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return rn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return tn("MutationObserver").constructor}};const ln="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 cn={map:{},getId:()=>(console.error(ln),-1),getNode:()=>(console.error(ln),null),removeNodeFromMap(){console.error(ln)},has:()=>(console.error(ln),!1),reset(){console.error(ln)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get:(e,t,n)=>("map"===t&&console.error(ln),Reflect.get(e,t,n))}));let un=Date.now;function dn(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:an.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(un=()=>(new Date).getTime());function hn(e){var t;let n=null;return"getRootNode"in e&&(null==(t=an.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&an.host(an.getRootNode(e))&&(n=an.host(an.getRootNode(e))),n}function pn(e){let t,n=e;for(;t=hn(n);)n=t;return n}function gn(e){const t=e.ownerDocument;if(!t)return!1;const n=pn(e);return an.contains(t,n)}const fn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Dt(this,"id",1),Dt(this,"styleIDMap",new WeakMap),Dt(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 n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return cn},closestElementOfNode:dn,getBaseDimension:function e(t,n){var i,r;const o=null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,n),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const i=t[n[0]];return 1===n.length?i:e(i.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:pn,getShadowHost:hn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=an.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=an.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Jt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(an.shadowRoot(e)))},hookSetter:function e(t,n,i,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,r?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(an.contains(t,e)||gn(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&jt.host(e)||null;return Boolean(t&&"shadowRoot"in t&&jt.shadowRoot(t)===e)}(t))return!1;const i=n.getId(t);if(!n.has(i))return!0;const r=an.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n))},isBlocked:function(e,t,n,i){if(!e)return!1;const r=dn(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(Xt(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let i=t.children.length-1;i>=0;i--)e(t.children[i],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return un},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}},polyfill:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const r of e){const{nextId:e,parentId:o}=r;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(r,o.parent))}else{const e=i.indexOf(o);i.splice(e,0,n(r,null))}}else if(o in t){const e=t[o];e.children.push(n(r,e))}else i.push(n(r,null))}return i},shadowHostInDom:gn,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let i=e.length;i--;){const r=e[i];t.has(r.id)||(n.push(r),t.add(r.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vn=0;vn<64;vn++)_n[mn.charCodeAt(vn)]=vn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Ft=e.contentWindow)?void 0:Ft.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var yn;new Yt,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(yn||(yn={}));class bn{constructor(e){Lt(this,"fileName"),Lt(this,"functionName"),Lt(this,"lineNumber"),Lt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const wn=/(^|@)\S+:\d+/,Sn=/^\s*at .*(\S+:\d+|\(native\))/m,Cn=/^(eval@)?(\[native code])?$/,In={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Sn)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Sn)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const i=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new bn({functionName:o,fileName:s,lineNumber:r[1],columnNumber:r[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Cn)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new bn({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new bn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(wn)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new bn({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function kn(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(let e=0;e<i.children.length;e++){const t=i.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=i}return t}function En(e){return"[object Object]"===Object.prototype.toString.call(e)}function xn(e,t){if(0===t)return!0;const n=Object.keys(e);for(const i of n)if(En(e[i])&&xn(e[i],t-1))return!0;return!1}function Tn(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const i=[],r=[];return JSON.stringify(e,(function(e,t){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(En(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(En(e)&&xn(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const i=t[n];Array.isArray(i)?e[n]=kn(i.length?i[0]:null):e[n]=i}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Mn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Rn(e,t,n){const i=n?Object.assign({},Mn,n):Mn,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?t[r]:r;let s=0,a=!1;const l=[];if(i.level.includes("error")){const n=t=>{const n=t.message,r=t.error,o=In.parse(r).map((e=>e.toString())),s=[Tn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const r=t=>{let n,r;t.reason instanceof Error?(n=t.reason,r=[Tn(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Tn("Uncaught (in promise)",i.stringifyOptions),Tn(t.reason,i.stringifyOptions)]);const o=In.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",r),l.push((()=>{t.removeEventListener("unhandledrejection",r)}))}for(const e of i.level)l.push(c(o,e));return()=>{l.forEach((e=>e()))};function c(t,n){var r=this;return t[n]?fn.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{const t=In.parse(new Error).map((e=>e.toString())).splice(1),r=("assert"===n?l.slice(1):l).map((e=>Tn(e,i.stringifyOptions)));s++,s<i.lengthThreshold?e({level:n,trace:t,payload:r}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Tn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const An=e=>({name:"rrweb/console@1",observer:Rn,options:e});const Nn={DEBUG:!1,LIB_VERSION:"1.187.0"},Fn="undefined"!=typeof window?window:void 0,On="undefined"!=typeof globalThis?globalThis:Fn,Ln=Array.prototype,Pn=Ln.forEach,Dn=Ln.indexOf,$n=null==On?void 0:On.navigator,Bn=null==On?void 0:On.document,Hn=null==On?void 0:On.location,qn=null==On?void 0:On.fetch,Wn=null!=On&&On.XMLHttpRequest&&"withCredentials"in new On.XMLHttpRequest?On.XMLHttpRequest:void 0,Vn=null==On?void 0:On.AbortController,Zn=null==$n?void 0:$n.userAgent,Gn=null!=Fn?Fn:{},Un="[PostHog.js]",zn={_log:function(e){if(Fn&&(Nn.DEBUG||Gn.POSTHOG_DEBUG)&&!Ii(Fn.console)&&Fn.console){const r="__rrweb_original__"in Fn.console[e]?Fn.console[e].__rrweb_original__:Fn.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(Un,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];zn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];zn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];zn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(Un,...t)},uninitializedWarning:e=>{zn.error(`You must initialize PostHog before calling ${e}`)}},jn={},Yn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Xn(e,t,n){if(vi(e))if(Pn&&e.forEach===Pn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===jn)return}function Jn(e,t,n){if(!Ti(e)){if(vi(e))return Xn(e,t,n);if(Ni(e)){for(const i of e.entries())if(t.call(n,i[1],i[0])===jn)return}else for(const i in e)if(mi.call(e,i)&&t.call(n,e[i],i)===jn)return}}const Kn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Xn(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function Qn(e,t){return-1!==e.indexOf(t)}function ei(e){const t=Object.keys(e);let n=t.length;const i=new Array(n);for(;n--;)i[n]=[t[n],e[t[n]]];return i}const ti=function(e){try{return e()}catch{return}},ni=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){zn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),zn.critical(e)}}},ii=function(e){const t={};return Jn(e,(function(e,n){ki(e)&&e.length>0&&(t[n]=e)})),t},ri=function(e){return e.replace(/^\$/,"")};function oi(e,t){return function(e,t){const n=new Set;return function e(i,r){if(i!==Object(i))return t?t(i,r):i;if(n.has(i))return;let o;return n.add(i),vi(i)?(o=[],Xn(i,(t=>{o.push(e(t))}))):(o={},Jn(i,((t,i)=>{n.has(t)||(o[i]=e(t,i))}))),o}(e)}(e,(e=>ki(e)&&!xi(t)?e.slice(0,t):e))}const si=function(e){let t,n,i,r="",o=0;for(t=n=0,o=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<o;i++){const o=e.charCodeAt(i);let s=null;o<128?n++:s=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),xi(s)||(n>t&&(r+=e.substring(t,n)),r+=s,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},ai=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{const r="on"+n,o=t[r];t[r]=function(t,n,i){return function(r){if(!(r=r||e(null==Fn?void 0:Fn.event)))return;let o,s=!0;yi(i)&&(o=i(r));const a=n.call(t,r);return!1!==o&&!1!==a||(s=!1),s}}(t,i,o)}else zn.error("No valid element provided to register_event")}}();function li(e){const t=null==e?void 0:e.hostname;return!!ki(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}function ci(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}const ui="$copy_autocapture",di=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];let hi;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(hi||(hi={}));const pi=["fatal","error","warning","log","info","debug"],gi=Array.isArray,fi=Object.prototype,mi=fi.hasOwnProperty,_i=fi.toString,vi=gi||function(e){return"[object Array]"===_i.call(e)},yi=e=>"function"==typeof e,bi=e=>yi(e)&&-1!==e.toString().indexOf("[native code]"),wi=e=>{if(!yi(e))return!1;return Object.getOwnPropertyNames(e.prototype||{}).some((e=>e.indexOf("__zone")))},Si=e=>e===Object(e)&&!vi(e),Ci=e=>{if(Si(e)){for(const t in e)if(mi.call(e,t))return!1;return!0}return!1},Ii=e=>void 0===e,ki=e=>"[object String]"==_i.call(e),Ei=e=>ki(e)&&0===e.trim().length,xi=e=>null===e,Ti=e=>Ii(e)||xi(e),Mi=e=>"[object Number]"==_i.call(e),Ri=e=>"[object Boolean]"===_i.call(e),Ai=e=>e instanceof Document,Ni=e=>e instanceof FormData,Fi=e=>Qn(di,e),Oi=["localhost","127.0.0.1"],Li=e=>{const t=null==Bn?void 0:Bn.createElement("a");return Ii(t)?null:(t.href=e,t)},Pi=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},Di=function(e){let t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const r=[];return Jn(e,(function(e,i){Ii(e)||Ii(i)||"undefined"===i||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},$i=function(e,t){const n=((e.split("#")[0]||"").split("?")[1]||"").split("&");let i;for(let e=0;e<n.length;e++){const r=n[e].split("=");if(r[0]===t){i=r;break}}if(!vi(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{zn.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},Bi=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Hi="$people_distinct_id",qi="__alias",Wi="__timers",Vi="$autocapture_disabled_server_side",Zi="$heatmaps_enabled_server_side",Gi="$exception_capture_enabled_server_side",Ui="$web_vitals_enabled_server_side",zi="$dead_clicks_enabled_server_side",ji="$web_vitals_allowed_metrics",Yi="$session_recording_enabled_server_side",Xi="$console_log_recording_enabled_server_side",Ji="$session_recording_network_payload_capture",Ki="$session_recording_canvas_recording",Qi="$replay_sample_rate",er="$replay_minimum_duration",tr="$sesid",nr="$session_is_sampled",ir="$session_recording_url_trigger_activated_session",rr="$session_recording_event_trigger_activated_session",or="$enabled_feature_flags",sr="$early_access_features",ar="$stored_person_properties",lr="$stored_group_properties",cr="$surveys",ur="$surveys_activated",dr="$flag_call_reported",hr="$user_state",pr="$client_session_props",gr="$capture_rate_limit",fr="$initial_campaign_params",mr="$initial_referrer_info",_r="$initial_person_info",vr="$epp",yr="__POSTHOG_TOOLBAR__",br=[Hi,qi,"__cmpns",Wi,Yi,Zi,tr,or,hr,sr,lr,ar,cr,dr,pr,gr,fr,mr,vr];function wr(e){var t;return e.id===yr||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container"))}function Sr(e){return!!e&&1===e.nodeType}function Cr(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ir(e){return!!e&&3===e.nodeType}function kr(e){return!!e&&11===e.nodeType}function Er(e){return e?Yn(e).split(/\s+/):[]}function xr(e){const t=null==Fn?void 0:Fn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Tr(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Er(t)}function Mr(e){return Ti(e)?null:Yn(e).split(/(\s+)/).filter((e=>Vr(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rr(e){let t="";return Lr(e)&&!Pr(e)&&e.childNodes&&e.childNodes.length&&Jn(e.childNodes,(function(e){var n;Ir(e)&&e.textContent&&(t+=null!==(n=Mr(e.textContent))&&void 0!==n?n:"")})),Yn(t)}function Ar(e){return Ii(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}const Nr=["a","button","form","input","select","textarea","label"];function Fr(e){const t=e.parentNode;return!(!t||!Sr(t))&&t}function Or(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Fn||!e||Cr(e,"html")||!Sr(e))return!1;if(null!=n&&n.url_allowlist&&!xr(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&xr(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){const e=n.dom_event_allowlist;if(e&&!e.some((e=>t.type===e)))return!1}let o=!1;const s=[e];let a=!0,l=e;for(;l.parentNode&&!Cr(l,"body");)if(kr(l.parentNode))s.push(l.parentNode.host),l=l.parentNode.host;else{if(a=Fr(l),!a)break;if(i||Nr.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{const e=Fn.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(o=!0)}s.push(a),l=a}if(!function(e,t){const n=null==t?void 0:t.element_allowlist;if(Ii(n))return!0;for(const t of e)if(n.some((e=>t.tagName.toLowerCase()===e)))return!0;return!1}(s,n))return!1;if(!function(e,t){const n=null==t?void 0:t.css_selector_allowlist;if(Ii(n))return!0;for(const t of e)if(n.some((e=>t.matches(e))))return!0;return!1}(s,n))return!1;const c=Fn.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return o?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Nr.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function Lr(e){for(let t=e;t.parentNode&&!Cr(t,"body");t=t.parentNode){const e=Tr(t);if(Qn(e,"ph-sensitive")||Qn(e,"ph-no-capture"))return!1}if(Qn(Tr(e),"ph-include"))return!0;const t=e.type||"";if(ki(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(ki(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Pr(e){return!!(Cr(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Cr(e,"select")||Cr(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const Dr="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",$r=new RegExp(`^(?:${Dr})$`),Br=new RegExp(Dr),Hr="\\d{3}-?\\d{2}-?\\d{4}",qr=new RegExp(`^(${Hr})$`),Wr=new RegExp(`(${Hr})`);function Vr(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ti(e))return!1;if(ki(e)){e=Yn(e);if((t?$r:Br).test((e||"").replace(/[- ]/g,"")))return!1;if((t?qr:Wr).test(e))return!1}return!0}function Zr(e){let t=Rr(e);return t=`${t} ${Gr(e)}`.trim(),Vr(t)?t:""}function Gr(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Jn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Rr(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${Gr(e)}`.trim())}catch(e){zn.error(e)}})),t}function Ur(e){return function(e){const t=e.map((e=>{var t,n;let i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)i+=`.${t.replace(/"/g,"")}`}const r={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},o={};return ei(r).sort(((e,t)=>{let[n]=e,[i]=t;return n.localeCompare(i)})).forEach((e=>{let[t,n]=e;return o[zr(t.toString())]=zr(n.toString())})),i+=":",i+=ei(r).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),i}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:jr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ei(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return i.attributes[t]=n})),i}))}(e))}function zr(e){return e.replace(/"|\\"/g,'\\"')}function jr(e){const t=e.attr__class;return t?vi(t)?t:Er(t):void 0}const Yr="[SessionRecording]",Xr="redacted",Jr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},Kr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Qr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],eo=["/s/","/e/","/i/"];function to(e,t,n,i){if(Ti(e))return e;let r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return ki(r)&&(r=parseInt(r)),r>n?Yr+` ${i} body too large to record (${r} bytes)`:e}function no(e,t){if(Ti(e))return e;let n=e;return Vr(n,!1)||(n=Yr+" "+t+" body "+Xr),Jn(Qr,(e=>{var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Yr+" "+t+" body "+Xr+" as might contain: "+e)})),n}const io=(e,t)=>{const n={payloadSizeLimitBytes:Jr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Jr.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Jr.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,r=!1!==e.session_recording.recordBody&&t.recordBody,o=!1!==e.capture_performance&&t.recordPerformance,s=(e=>{var t;const n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=to(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=to(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>s((e=>{const t=Li(e.name);if(!(t&&t.pathname&&eo.some((e=>0===t.pathname.indexOf(e)))))return e})((e=>{const t=e.requestHeaders;return Ti(t)||Jn(Object.keys(null!=t?t:{}),(e=>{Kr.includes(e.toLowerCase())&&(t[e]=Xr)})),e})(e))),l=yi(e.session_recording.maskNetworkRequestFn);return l&&yi(e.session_recording.maskCapturedNetworkRequestFn)&&zn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{const n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=yi(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,i,r;const o=a(t);return o&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,o))&&void 0!==n?n:void 0}:e=>function(e){if(!Ii(e))return e.requestBody=no(e.requestBody,"Request"),e.responseBody=no(e.responseBody,"Response"),e}(a(e)),{...Jr,...n,recordHeaders:i,recordBody:r,recordPerformance:o,recordInitialRequests:o}};function ro(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return yi(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}function oo(e,t){var n;const i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),r={hostname:i,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==i||!i.trim().length)return r;for(const e of t.payloadHostDenyList)if(i.endsWith(e))return{hostname:i,isHostDenied:!0};return r}const so=e=>"navigation"===e.entryType,ao=e=>"resource"===e.entryType;function lo(e,t,n){if(n.recordInitialRequests){const i=t.performance.getEntries().filter((e=>so(e)||ao(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>fo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const i=new t.PerformanceObserver((t=>{const i=t.getEntries().filter((e=>so(e)||ao(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>fo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),r=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:r}),()=>{i.disconnect()}}function co(e,t){return!!t&&(Ri(t)||t[e])}function uo(e){let{type:t,recordBody:n,headers:i}=e;function r(e){const t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),n=t&&i[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Ri(n))return!0;if(vi(n))return r(n);const o=n[t];return Ri(o)?o:r(o)}async function ho(e,t,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return zn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const s=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>ao(e)&&e.initiatorType===t&&(Ii(i)||e.startTime>=i)&&(Ii(r)||e.startTime<=r)));return s||(await new Promise((e=>setTimeout(e,50*o))),ho(e,t,n,i,r,o+1))}function po(e){let{body:t,options:n,url:i}=e;if(Ti(t))return null;const{hostname:r,isHostDenied:o}=oo(i,n);if(o)return r+" is in deny list";if(ki(t))return t;if(Ai(t))return t.textContent;if(Ni(t))return Di(t);if(Si(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const go=e=>!xi(e)&&("navigation"===e.entryType||"resource"===e.entryType);function fo(e){let{entry:t,method:n,status:i,networkRequest:r,isInitial:o,start:s,end:a,url:l,initiatorType:c}=e;s=t?t.startTime:s,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(s||0)),h=[{...t?t.toJSON():{name:l},startTime:Ii(s)?void 0:Math.round(s),endTime:Ii(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o}];if(go(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const mo=["video/","audio/"];function _o(e){return new Promise(((t,n)=>{const i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(i)))}catch{clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}async function vo(e){let{r:t,options:n,url:i}=e;const r=function(e){var t;let{r:n,options:i,url:r}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=mo.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return`Content-Type ${o} is not supported`;const{hostname:a,isHostDenied:l}=oo(r,i);return l?a+" is in deny list":null}({r:t,options:n,url:i});return xi(r)?_o(t):Promise.resolve(r)}function yo(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=co("request",n.recordHeaders),r=co("response",n.recordHeaders),o=ro(t,"fetch",(o=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),i&&(u.requestHeaders=e),uo({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:i}=e;const{hostname:r,isHostDenied:o}=oo(i,n);return o?Promise.resolve(r+" is in deny list"):_o(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await o(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),r&&(u.responseHeaders=a),uo({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await vo({r:c,options:n,url:s})),c}finally{ho(t,"fetch",l.url,d,h).then((t=>{var n;const i=fo({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:h,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return()=>{o()}}let bo=null;function wo(e,t,n){if(!("performance"in t))return()=>{};if(bo)return zn.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Jr,n):Jr,r=t=>{const n=[];t.requests.forEach((e=>{const t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},o=lo(r,t,i);let s=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=co("request",n.recordHeaders),r=co("response",n.recordHeaders),o=ro(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,h=new Request(a),p={};let g,f;const m={},_=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,_(e,t)),i&&(p.requestHeaders=m);const v=d.send.bind(d);d.send=e=>(uo({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(p.requestBody=po({body:e,options:n,url:a})),g=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;f=t.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");n&&(i[n]=r)})),r&&(p.responseHeaders=i),uo({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(p.responseBody=po({body:d.response,options:n,url:a})),ho(t,"xmlhttprequest",h.url,g,f).then((t=>{const n=fo({entry:t,method:s,status:null==d?void 0:d.status,networkRequest:p,start:g,end:f,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),o.call(d,s,a,l,c,u)}));return()=>{o()}}(r,t,i),a=yo(r,t,i)),bo=()=>{o(),s(),a()},bo}const So=e=>({name:"rrweb/network@1",observer:wo,options:e});let Co,Io,ko;Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:An,getRecordNetworkPlugin:So},Gn.__PosthogExtensions__.rrweb={record:Rt,version:"v2"},Gn.rrweb={record:Rt,version:"v2"},Gn.rrwebConsoleRecord={getRecordConsolePlugin:An},Gn.getRecordNetworkPlugin=So,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Co||(Co={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Io||(Io={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(ko||(ko={}));var Eo,xo,To,Mo,Ro,Ao,No,Fo,Oo={},Lo=[],Po=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Do=Array.isArray;function $o(e,t){for(var n in t)e[n]=t[n];return e}function Bo(e){var t=e.parentNode;t&&t.removeChild(e)}function Ho(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Eo.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return qo(e,s,i,r,null)}function qo(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++To:r,__i:-1,__u:0};return null==r&&null!=xo.vnode&&xo.vnode(o),o}function Wo(e){return e.children}function Vo(e,t){this.props=e,this.context=t}function Zo(e,t){if(null==t)return e.__?Zo(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Zo(e):null}function Go(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Go(e)}}function Uo(e){(!e.__d&&(e.__d=!0)&&Mo.push(e)&&!zo.__r++||Ro!==xo.debounceRendering)&&((Ro=xo.debounceRendering)||Ao)(zo)}function zo(){var e,t,n,i,r,o,s,a,l;for(Mo.sort(No);e=Mo.shift();)e.__d&&(t=Mo.length,i=void 0,o=(r=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((i=$o({},r)).__v=r.__v+1,xo.vnode&&xo.vnode(i),ts(s,i,r,n.__n,void 0!==s.ownerSVGElement,32&r.__u?[o]:null,a,null==o?Zo(r):o,!!(32&r.__u),l),i.__.__k[i.__i]=i,ns(a,i,l),i.__e!=o&&Go(i)),Mo.length>t&&Mo.sort(No));zo.__r=0}function jo(e,t,n,i,r,o,s,a,l,c,u){var d,h,p,g,f,m=i&&i.__k||Lo,_=t.length;for(n.__d=l,function(e,t,n){var i,r,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],i=0;i<l;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?qo(null,r,null,null,r):Do(r)?qo(Wo,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?qo(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Xo(r,n,s=i+d,u),r.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Zo(o)),rs(o,o,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(o=n[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Zo(o)),rs(o,o))}(n,t,m),l=n.__d,d=0;d<_;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Oo:m[p.__i]||Oo,p.__i=d,ts(e,p,h,r,o,s,a,l,c,u),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&is(h.ref,null,p),u.push(p.ref,p.__c||g,p)),null==f&&null!=g&&(f=g),65536&p.__u||h.__k===p.__k?l=Yo(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=f}function Yo(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Yo(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Xo(e,t,n,i){var r=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&r==l.key&&o===l.type)return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&r==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&r==l.key&&o===l.type)return a;a++}}return-1}function Jo(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Po.test(t)?n:n+"px"}function Ko(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Jo(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Jo(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?es:Qo,o)):e.removeEventListener(t,o?es:Qo,o);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Qo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(xo.event?xo.event(e):e)}function es(e){return this.l[e.type+!0](xo.event?xo.event(e):e)}function ts(e,t,n,i,r,o,s,a,l,c){var u,d,h,p,g,f,m,_,v,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=xo.__b)&&u(t);e:if("function"==typeof k)try{if(_=t.props,v=(u=k.contextType)&&i[u.__c],y=u?v?v.props.value:u.__:i,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(_,y):(t.__c=d=new Vo(_,y),d.constructor=k,d.render=os),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=$o({},d.__s)),$o(d.__s,k.getDerivedStateFromProps(_,d.__s))),p=d.props,g=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,f)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,w=xo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=$o($o({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(p,g)),jo(e,Do(I=null!=u&&u.type===Wo&&null==u.key?u.props.children:u)?I:[I],t,n,i,r,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),xo.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a,l){var c,u,d,h,p,g,f,m=n.props,_=t.props,v=t.type;if("svg"===v&&(r=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!v&&(v?p.localName===v:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===v)return document.createTextNode(_);e=r?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,_.is&&_),o=null,a=!1}if(null===v)m===_||a&&e.data===_||(e.data=_);else{if(o=o&&Eo.call(e.childNodes),m=n.props||Oo,!a&&null!=o)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)p=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in _||Ko(e,c,null,p,r));for(c in _)p=_[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?g=p:"checked"==c?f=p:"key"===c||a&&"function"!=typeof p||m[c]===p||Ko(e,c,p,m[c],r);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),jo(e,Do(h)?h:[h],t,n,i,r&&"foreignObject"!==v,o,s,o?o[0]:n.__k&&Zo(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&Bo(o[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===v&&!g||"option"===v&&g!==m[c])&&Ko(e,c,g,m[c],!1),c="checked",void 0!==f&&f!==e[c]&&Ko(e,c,f,m[c],!1))}return e}(n.__e,t,n,i,r,o,s,l,c);(u=xo.diffed)&&u(t)}function ns(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)is(n[i],n[++i],n[++i]);xo.__c&&xo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){xo.__e(e,t.__v)}}))}function is(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){xo.__e(e,n)}}function rs(e,t,n){var i,r;if(xo.unmount&&xo.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||is(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){xo.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&rs(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Bo(e.__e),e.__=e.__e=e.__d=void 0}function os(e,t,n){return this.constructor(e,n)}function ss(e,t,n){var i,r,o,s;xo.__&&xo.__(e,t),r=(i="function"==typeof n)?null:t.__k,o=[],s=[],ts(t,e=(!i&&n||t).__k=Ho(Wo,null,[e]),r||Oo,Oo,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Eo.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),ns(o,e,s)}function as(e,t,n){var i,r,o,s,a=$o({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Eo.call(arguments,2):n),qo(e.type,a,i||e.key,r||e.ref,null)}Eo=Lo.slice,xo={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},To=0,Vo.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$o({},this.state),"function"==typeof e&&(e=e($o({},n),this.props)),e&&$o(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Uo(this))},Vo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Uo(this))},Vo.prototype.render=Wo,Mo=[],Ao="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,No=function(e,t){return e.__v.__b-t.__v.__b},zo.__r=0,Fo=0;const ls=Fn,cs=Bn,us="seenSurvey_",ds=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${ps((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function hs(e){if("#"===e[0]){const t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ps(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fs;"#"===t[0]&&(e=hs(t)),t.startsWith("rgb")&&(e=t);const n=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(n&&(e=hs(n)),!e)return"black";const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const gs={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},fs="#eeeded",ms=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(Ss(n),"true"),i.capture("survey sent",{$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i),...t,$set:{[Cs(n,"responded")]:!0}}),ls.dispatchEvent(new Event("PHSurveySent")))},_s=(e,t,n)=>{var i;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:{[Cs(e,"dismissed")]:!0}}),localStorage.setItem(Ss(e),"true"),ls.dispatchEvent(new Event("PHSurveyClosed")))},vs=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ys=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,bs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?ys(e.questions,vs(e.questions)):e.questions),ws=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,i,r,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},Ss=e=>{let t=`${us}${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`${us}${e.id}_${e.current_iteration}`),t},Cs=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},Is=function(e,t){var n={__c:t="__cC"+Fo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Uo(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),ks=e=>{let{component:t,children:n,renderAsHtml:i,style:r}=e;return as(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},Es=Bn;var xs,Ts,Ms,Rs,As=0,Ns=[],Fs=[],Os=xo.__b,Ls=xo.__r,Ps=xo.diffed,Ds=xo.__c,$s=xo.unmount;function Bs(e,t){xo.__h&&xo.__h(Ts,e,As||t),As=0;var n=Ts.__H||(Ts.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Fs}),n.__[e]}function Hs(e){return As=1,function(e,t,n){var i=Bs(xs++,2);if(i.t=e,!i.__c&&(i.__=[Js(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Ts,!Ts.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Ts.u=!0;var o=Ts.shouldComponentUpdate,s=Ts.componentWillUpdate;Ts.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},Ts.shouldComponentUpdate=r}return i.__N||i.__}(Js,e)}function qs(e,t){var n=Bs(xs++,3);!xo.__s&&Xs(n.__H,t)&&(n.__=e,n.i=t,Ts.__H.__h.push(n))}function Ws(e){return As=5,Vs((function(){return{current:e}}),[])}function Vs(e,t){var n=Bs(xs++,7);return Xs(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Zs(e){var t=Ts.context[e.__c],n=Bs(xs++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Ts)),t.props.value):e.__}function Gs(){for(var e;e=Ns.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(js),e.__H.__h.forEach(Ys),e.__H.__h=[]}catch(t){e.__H.__h=[],xo.__e(t,e.__v)}}xo.__b=function(e){Ts=null,Os&&Os(e)},xo.__r=function(e){Ls&&Ls(e),xs=0;var t=(Ts=e.__c).__H;t&&(Ms===Ts?(t.__h=[],Ts.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Fs,e.__N=e.i=void 0}))):(t.__h.forEach(js),t.__h.forEach(Ys),t.__h=[],xs=0)),Ms=Ts},xo.diffed=function(e){Ps&&Ps(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ns.push(t)&&Rs===xo.requestAnimationFrame||((Rs=xo.requestAnimationFrame)||zs)(Gs)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Fs&&(e.__=e.__V),e.i=void 0,e.__V=Fs}))),Ms=Ts=null},xo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(js),e.__h=e.__h.filter((function(e){return!e.__||Ys(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],xo.__e(n,e.__v)}})),Ds&&Ds(e,t)},xo.unmount=function(e){$s&&$s(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{js(e)}catch(e){t=e}})),n.__H=void 0,t&&xo.__e(t,n.__v))};var Us="function"==typeof requestAnimationFrame;function zs(e){var t,n=function(){clearTimeout(i),Us&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);Us&&(t=requestAnimationFrame(n))}function js(e){var t=Ts,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ts=t}function Ys(e){var t=Ts;e.__c=e.__(),Ts=t}function Xs(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Js(e,t){return"function"==typeof t?t(e):t}var Ks=0;function Qs(e,t,n,i,r,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ks,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return xo.vnode&&xo.vnode(c),c}const ea=Qs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qs("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ta=Qs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qs("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),na=Qs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qs("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ia=Qs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qs("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),ra=Qs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qs("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),oa=Qs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qs("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),sa=Qs("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Qs("g",{"clip-path":"url(#clip0_2415_6911)",children:[Qs("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Qs("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Qs("g",{mask:"url(#mask0_2415_6911)",children:[Qs("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Qs("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Qs("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Qs("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Qs("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Qs("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Qs("defs",{children:Qs("clipPath",{id:"clip0_2415_6911",children:Qs("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),aa=Qs("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qs("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function la(){return Qs("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",sa]})}function ca(e){let{text:t,submitDisabled:n,appearance:i,onSubmit:r,link:o}=e;const{isPreviewMode:s,isPopup:a}=Zs(Is),l=i.submitButtonTextColor||ps(i.submitButtonColor||gs.submitButtonColor);return Qs("div",{className:"bottom-section",children:[Qs("div",{className:"buttons",children:Qs("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(o&&(null==Fn||Fn.open(o)),r())},children:t})}),!i.whiteLabel&&Qs(la,{})]})}function ua(e){let{question:t,description:n,descriptionContentType:i,backgroundColor:r,forceDisableHtml:o}=e;const{isPopup:s}=Zs(Is);return Qs("div",{style:s?{backgroundColor:r||gs.backgroundColor}:{},children:[Qs("div",{className:"survey-question",children:t}),n&&ks({component:Ho("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==i})]})}function da(e){let{onClick:t}=e;const{isPreviewMode:n}=Zs(Is);return Qs("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:Qs("button",{className:"form-cancel",onClick:t,disabled:n,children:oa})})}function ha(e){let{header:t,description:n,contentType:i,forceDisableHtml:r,appearance:o,onClose:s,styleOverrides:a}=e;const l=ps(o.backgroundColor||gs.backgroundColor),{isPopup:c}=Zs(Is);return Qs(Wo,{children:Qs("div",{className:"thank-you-message",style:{...a},children:Qs("div",{className:"thank-you-message-container",children:[c&&Qs(da,{onClick:()=>s()}),Qs("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&ks({component:Ho("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:l}}),c&&Qs(ca,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})})})}function pa(e){var t;const n=Ws(null),[i,r]=Hs(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return qs((()=>{if(n.current){const e=function(e){const t=ls.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const i=parseInt(n[1]),r=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+o*o*.114)>127.5?"black":"white"}(n.current);r(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function ga(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;const o=Ws(null),[s,a]=Hs("");return Qs("div",{ref:o,children:[Qs(ua,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),Qs("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>a(e.currentTarget.value)}),Qs(ca,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:i,onSubmit:()=>r(s)})]})}function fa(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;return Qs(Wo,{children:[Qs(ua,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Qs(ca,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>r("link clicked")})]})}function ma(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=Hs(null);return Qs(Wo,{children:[Qs(ua,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Qs("div",{className:"rating-section",children:[Qs("div",{className:"rating-options",children:["emoji"===t.display&&Qs("div",{className:"rating-options-emoji",children:(3===t.scale?ya:ba).map(((e,t)=>{const n=t+1===l;return Qs("button",{className:`ratings-emoji question-${i}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&Qs("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:Ia(t.scale).map(((e,t)=>Qs(_a,{displayQuestionIndex:i,active:l===e,appearance:r,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),Qs("div",{className:"rating-text",children:[Qs("div",{children:t.lowerBoundLabel}),Qs("div",{children:t.upperBoundLabel})]})]}),Qs(ca,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:xi(l)&&!t.optional,appearance:r,onSubmit:()=>o(l)})]})}function _a(e){let{num:t,active:n,displayQuestionIndex:i,appearance:r,setActiveNumber:o}=e;const{textColor:s,ref:a}=pa({appearance:r,defaultTextColor:"black",forceUpdate:n});return Qs("button",{ref:a,className:`ratings-number question-${i}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function va(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=Ws(null),a=Vs((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const i=ys(t,vs(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i})(t)),[t]),[l,c]=Hs(t.type===Io.MultipleChoice?[]:null),[u,d]=Hs(!1),[h,p]=Hs(""),g=t.type===Io.SingleChoice?"radio":"checkbox";return Qs("div",{ref:s,children:[Qs(ua,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Qs("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let r="choice-option";const o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(r+=" choice-option-open"),Qs("div",{className:r,children:[Qs("input",{type:g,id:`surveyQuestion${i}Choice${n}`,name:`question${i}`,value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===Io.SingleChoice?c(o):t.type===Io.MultipleChoice&&vi(l)?l.includes(o)?c(l.filter((e=>e!==o))):c([...l,o]):void 0}),Qs("label",{htmlFor:`surveyQuestion${i}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?Qs(Wo,{children:[Qs("span",{children:[s,":"]}),Qs("input",{type:"text",id:`surveyQuestion${i}Choice${n}Open`,name:`question${i}`,onInput:e=>{const n=e.currentTarget.value;return t.type===Io.SingleChoice?c(n):t.type===Io.MultipleChoice&&vi(l)?p(n):void 0}})]}):s}),Qs("span",{className:"choice-check",style:{color:"black"},children:aa})]})}))}),Qs(ca,{text:t.buttonText||"Submit",submitDisabled:(xi(l)||vi(l)&&!u&&0===l.length||vi(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:r,onSubmit:()=>{u&&t.type===Io.MultipleChoice?vi(l)&&o([...l,h]):o(l)}})]})}const ya=[na,ta,ea],ba=[ia,na,ta,ea,ra],wa=[1,2,3,4,5],Sa=[1,2,3,4,5,6,7],Ca=[0,1,2,3,4,5,6,7,8,9,10];function Ia(e){switch(e){case 5:default:return wa;case 7:return Sa;case 10:return Ca}}const ka=Fn,Ea=Bn;class xa{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=Ea.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,i=localStorage.getItem("lastSeenSurveyDate");if(n&&i){const e=new Date,t=Math.abs(e.getTime()-new Date(i).getTime());if(Math.ceil(t/864e5)<n)return}const r=(e=>!!localStorage.getItem(Ss(e))&&!ws(e))(e);if(!r){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const i=cs.createElement("div");i.className=`PostHogSurvey${t}`;const r=i.attachShadow({mode:"open"});if(e){const t=Object.assign(cs.createElement("style"),{innerText:e});r.appendChild(t)}return cs.body.appendChild(i),r})(ds(null==e?void 0:e.appearance),e.id);ss(Qs(Ra,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=Es.createElement("div");n.className=`PostHogWidget${e.id}`;const i=n.attachShadow({mode:"open"}),r=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return i.append(Object.assign(Es.createElement("style"),{innerText:r})),Es.body.appendChild(n),i}(e),n=ds(e.appearance);t.appendChild(Object.assign(Ea.createElement("style"),{innerText:n})),ss(Qs(Na,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Ea.querySelector(e.appearance.widgetSelector);if(n)if(0===Ea.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===Ea.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var i,r;const t=null===(i=Ea.querySelector(`.PostHogWidget${e.id}`))||void 0===i||null===(r=i.shadowRoot)||void 0===r?void 0:r.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,i;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=Co.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{ss(Qs(Ra,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(xi(e.surveyInFocus)){var n,i,r;if(t.type===Co.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===Ea.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)&&null!==(r=t.appearance)&&void 0!==r&&r.widgetSelector&&e.handleWidgetSelector(t);t.type===Co.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{xi(this.surveyInFocus)||zn.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&zn.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function Ta(e){if(!Ea||!ka)return;const t=new xa(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function Ma(e,t,n,i,r){const[o,s]=Hs(i||0===n),[a,l]=Hs(!1);return qs((()=>{if(i||!t)return;const o=()=>{r(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(r(e.id),s(!1))},c=()=>{var n;s(!0),ka.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return ka.addEventListener("PHSurveyClosed",o),ka.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),ka.removeEventListener("PHSurveyClosed",o),ka.removeEventListener("PHSurveySent",a)}})():(c(),()=>{ka.removeEventListener("PHSurveyClosed",o),ka.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}function Ra(e){var t,n,i,r,o,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:h,isPopup:p}=e;const g=Number.isInteger(d),f=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:_,setIsPopupVisible:v}=Ma(a,c,f,g,h),y=_||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&Mi(null===(i=u)||void 0===i?void 0:i.left)?{left:u.left-40}:{};return g&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?Qs(Is.Provider,{value:{isPreviewMode:g,previewPageIndex:d,handleCloseSurveyPopup:()=>_s(a,c,g),isPopup:p||!1},children:y?Qs(ha,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||gs,styleOverrides:{...u,...b},onClose:()=>v(!1)}):Qs(Aa,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):Qs(Wo,{})}function Aa(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,styleOverrides:s}=e;const a=ps((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||gs.backgroundColor),[l,c]=Hs({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:h,isPopup:p}=Zs(Is),[g,f]=Hs(d||0),m=Vs((()=>bs(i)),[i]);qs((()=>{f(null!=d?d:0)}),[d]);return Qs("form",{className:"survey-form",style:p?{color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?g===s:g===t)&&Qs("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||gs.backgroundColor}:{},children:[p&&Qs(da,{onClick:()=>h()}),Fa({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||gs,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:r}=e;if(!o)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!o.getNextSurveyStep)return void(r===i.questions.length-1?ms({...l,[s]:t},i,o):f(r+1));const a=o.getNextSurveyStep(i,r,t);a===ko.End?ms({...l,[s]:t},i,o):f(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function Na(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=Hs(!1),[u,d]=Hs({}),h=Ws(null);return qs((()=>{var e,t;if(!s&&o){if("tab"===(null===(e=i.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n;const e=h.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=i.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)){const e=Ea.querySelector(i.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),Qs(Wo,{children:["tab"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)&&Qs("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:ps(i.appearance.widgetColor)},children:[Qs("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=i.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&Qs(Ra,{posthog:o,survey:i,forceDisableHtml:r,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const Fa=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s={[Io.Open]:ga,[Io.Link]:fa,[Io.Rating]:ma,[Io.SingleChoice]:va,[Io.MultipleChoice]:va},a={question:t,forceDisableHtml:n,appearance:r,onSubmit:o},l={[Io.Open]:{},[Io.Link]:{},[Io.Rating]:{displayQuestionIndex:i},[Io.SingleChoice]:{displayQuestionIndex:i},[Io.MultipleChoice]:{displayQuestionIndex:i}};return Qs(s[t.type],{...{...a,...l[t.type]}})};function Oa(e){return!Ii(Event)&&La(e,Event)}function La(e,t){try{return e instanceof t}catch{return!1}}function Pa(e){return xi(e)||!Si(e)&&!yi(e)}function Da(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function $a(e){return Da(e,"DOMError")}Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.canActivateRepeatedly=ws,Gn.__PosthogExtensions__.generateSurveys=Ta,Gn.extendPostHogWithSurveys=Ta;const Ba=/\(error: (.*)\)/,Ha=50,qa="?";function Wa(e,t,n,i){const r={platform:"javascript",filename:e,function:"<anonymous>"===t?qa:t,in_app:!0};return Ii(n)||(r.lineno=n),Ii(i)||(r.colno=i),r}const Va=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Za=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ga=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ua=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,za=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ja=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],r=e.split("\n");for(let e=t;e<r.length;e++){const t=r[e];if(t.length>1024)continue;const o=Ba.test(t)?t.replace(Ba,"$1"):t;if(!o.match(/\S*Error: /)){for(const e of i){const t=e(o);if(t){n.push(t);break}}if(n.length>=Ha)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Ha).map((e=>({...e,filename:e.filename||Ya(t).filename,function:e.function||qa})))}(n)}}(...[[30,e=>{const t=Va.exec(e);if(t){const[,e,n,i]=t;return Wa(e,qa,+n,+i)}const n=Za.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=Ga.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Xa(n[1]||qa,n[2]);return Wa(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=Ua.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=za.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||qa;return[n,e]=Xa(n,e),Wa(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Ya(e){return e[e.length-1]||{}}const Xa=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:qa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ja=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Ka(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",i=function(e){if(e&&Qa.test(e.message))return 1;return 0}(e);try{const e=ja(n,i);return e.slice(0,e.length-t)}catch{}return[]}const Qa=/Minified React error #\d+;/i;function el(e,t){var n,i;const r=Ka(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function tl(e,t){var n,i,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){const e=Ka(t.syntheticException,1);e.length&&(a.stacktrace={frames:e,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function nl(e){return ki(e)&&!Ei(e)&&pi.indexOf(e)>=0}function il(e,t){var n,i;const r=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Oa(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(null!=t&&t.syntheticException){const e=Ka(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e,type:"raw"})}return{$exception_list:[l],$exception_level:nl(e.level)?e.level:"error"}}function rl(e,t){let[n,i,r,o,s]=e,a={$exception_list:[]};const l=s||n;if($a(l)||function(e){return Da(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=el(l,t);else{const n=e.name||($a(e)?"DOMError":"DOMException"),i=e.message?`${n}: ${e.message}`:n,r=$a(e)?"DOMError":"DOMException";a=tl(i,{...t,overrideExceptionType:r,defaultExceptionMessage:i})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Da(e,"ErrorEvent")}(l)&&l.error)return el(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return La(e,Error)}}(l))return el(l,t);if(function(e){return Da(e,"Object")}(l)||Oa(l)){return il(l,t)}if(Ii(s)&&ki(n)){let e="Error",i=n;const r=n.match(Ja);return r&&(e=r[1],i=r[2]),tl(i,{...t,overrideExceptionType:e,defaultExceptionMessage:i})}return tl(l,t)}function ol(e){let[t]=e;const n=function(e){if(Pa(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return Pa(n)?tl(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):rl([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const sl={wrapOnError:e=>{const t=Fn;t||zn.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];const s=rl(r);return e(s),null!==(t=null==n?void 0:n(...r))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=Fn;t||zn.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];const a=ol(o);return e(a),null!==(i=null==n?void 0:n.apply(t,o))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.errorWrappingFunctions=sl,Gn.__PosthogExtensions__.parseErrorAsProperties=rl,Gn.posthogErrorWrappingFunctions=sl,Gn.parseErrorAsProperties=rl;const al=(e,t)=>{const{sessionId:n,windowId:i}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",i)};Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{};const ll={_patchFetch:e=>ro(Fn,"fetch",(t=>async function(n,i){const r=new Request(n,i);return al(e,r),t(r)})),_patchXHR:e=>ro(Fn.XMLHttpRequest.prototype,"open",(t=>function(n,i){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(i);return al(e,a),t.call(this,n,a.url,r,o,s)}))};Gn.__PosthogExtensions__.tracingHeadersPatchFns=ll,Gn.postHogTracingHeadersPatchFns=ll;var cl,ul,dl,hl=-1,pl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(hl=t.timeStamp,e(t))}),!0)},gl=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},fl=function(){var e=gl();return e&&e.activationStart||0},ml=function(e,t){var n=gl(),i="navigate";return hl>=0?i="back-forward-cache":n&&(document.prerendering||fl()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},_l=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},vl=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},yl=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},bl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},wl=function(e){var t=!1;return function(){t||(e(),t=!0)}},Sl=-1,Cl=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Il=function(e){"hidden"===document.visibilityState&&Sl>-1&&(Sl="visibilitychange"===e.type?e.timeStamp:0,El())},kl=function(){addEventListener("visibilitychange",Il,!0),addEventListener("prerenderingchange",Il,!0)},El=function(){removeEventListener("visibilitychange",Il,!0),removeEventListener("prerenderingchange",Il,!0)},xl=function(){return Sl<0&&(Sl=Cl(),kl(),pl((function(){setTimeout((function(){Sl=Cl(),kl()}),0)}))),{get firstHiddenTime(){return Sl}}},Tl=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ml=[1800,3e3],Rl=function(e,t){t=t||{},Tl((function(){var n,i=xl(),r=ml("FCP"),o=_l("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-fl(),0),r.entries.push(e),n(!0)))}))}));o&&(n=vl(e,r,Ml,t.reportAllChanges),pl((function(i){r=ml("FCP"),n=vl(e,r,Ml,t.reportAllChanges),yl((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Al=[.1,.25],Nl=[2500,4e3],Fl={},Ol=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ll=function(e){if("loading"===document.readyState)return"loading";var t=Ol();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Pl=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Dl=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:Pl(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},$l=-1,Bl=function(e,t){var n=Ol(),i="navigate";return $l>=0?i="back-forward-cache":n&&(document.prerendering||function(){var e=Ol();return e&&e.activationStart||0}()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Hl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},ql=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Wl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Vl=0,Zl=1/0,Gl=0,Ul=function(e){e.forEach((function(e){e.interactionId&&(Zl=Math.min(Zl,e.interactionId),Gl=Math.max(Gl,e.interactionId),Vl=Gl?(Gl-Zl)/7+1:0)}))},zl=function(){"interactionCount"in performance||cl||(cl=Hl("event",Ul,{type:"event",buffered:!0,durationThreshold:0}))},jl=[],Yl=new Map,Xl=0,Jl=function(){return(cl?Vl:performance.interactionCount||0)-Xl},Kl=[],Ql=function(e){if(Kl.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=jl[jl.length-1],n=Yl.get(e.interactionId);if(n||jl.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Yl.set(i.id,i),jl.push(i)}jl.sort((function(e,t){return t.latency-e.latency})),jl.length>10&&jl.splice(10).forEach((function(e){return Yl.delete(e.id)}))}}},ec=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Wl(e)),n},tc=[200,500],nc=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;zl();var i,r=Bl("INP"),o=function(e){ec((function(){e.forEach(Ql);var t,n=(t=Math.min(jl.length-1,Math.floor(Jl()/50)),jl[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())}))},s=Hl("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=ql(e,r,tc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Wl((function(){o(s.takeRecords()),i(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&($l=t.timeStamp,e(t))}),!0)}((function(){Xl=0,jl.length=0,Yl.clear(),r=Bl("INP"),i=ql(e,r,tc,t.reportAllChanges)})))})))},ic=[],rc=[],oc=new WeakMap,sc=new Map,ac=-1,lc=function(e){ic=ic.concat(e),cc()},cc=function(){ac<0&&(ac=ec(uc))},uc=function(){sc.size>10&&sc.forEach((function(e,t){Yl.has(t)||sc.delete(t)}));var e=jl.map((function(e){return oc.get(e.entries[0])})),t=rc.length-50;rc=rc.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<rc.length;i++){var r=rc[i];dc(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=ic[ic.length-1-o];if(!s||s.startTime<dl)break;n.add(s)}ic=Array.from(n),ac=-1};Kl.push((function(e){e.interactionId&&e.target&&!sc.has(e.interactionId)&&sc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;dl=Math.max(dl,e.processingEnd);for(var i=rc.length-1;i>=0;i--){var r=rc[i];if(Math.abs(n-r.renderTime)<=8){(t=r).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},rc.push(t)),(e.interactionId||"first-input"===e.entryType)&&oc.set(e,t),cc()}));var dc=function(e,t){for(var n,i=[],r=0;n=ic[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i};const hc={onLCP:function(e,t){t=t||{},Tl((function(){var n,i=xl(),r=ml("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-fl(),0),r.entries=[e],n())}))},s=_l("largest-contentful-paint",o);if(s){n=vl(e,r,Nl,t.reportAllChanges);var a=wl((function(){Fl[r.id]||(o(s.takeRecords()),s.disconnect(),Fl[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=wl(e),"hidden"===document.visibilityState?e():(n=t(e),bl(e)),n}(a)}),!0)})),bl(a),pl((function(i){r=ml("LCP"),n=vl(e,r,Nl,t.reportAllChanges),yl((function(){r.value=performance.now()-i.timeStamp,Fl[r.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Rl(wl((function(){var n,i=ml("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=_l("layout-shift",s);a&&(n=vl(e,i,Al,t.reportAllChanges),bl((function(){s(a.takeRecords()),n(!0)})),pl((function(){r=0,i=ml("CLS",0),n=vl(e,i,Al,t.reportAllChanges),yl((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Rl,onINP:function(e,t){ul||(ul=Hl("long-animation-frame",lc)),nc((function(t){var n=function(e){var t=e.entries[0],n=oc.get(t),i=t.processingStart,r=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=dc(t.startTime,r),a=e.entries.find((function(e){return e.target})),l=a&&a.target||sc.get(t.interactionId),c=[t.startTime+t.duration,r].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Dl(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(u-r,0),loadState:Ll(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.postHogWebVitalsCallbacks=hc,Gn.postHogWebVitalsCallbacks=hc;class pc{constructor(){this.clicks=[]}isRageClick(e,t,n){const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}function gc(e,t){return t.length>e?t.slice(0,e)+"...":t}function fc(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!Sr(t));return t}function mc(e,t,n,i){const r=e.tagName.toLowerCase(),o={tag_name:r};Nr.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=gc(1024,Zr(e)):o.$el_text=gc(1024,Rr(e)));const s=Tr(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Jn(e.attributes,(function(n){var r;if((!Pr(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==i||!i.includes(n.name))&&!t&&Vr(n.value)&&(r=n.name,!ki(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){let e=n.value;"class"===n.name&&(e=Er(e).join(" ")),o["attr__"+n.name]=gc(1024,e)}}));let a=1,l=1,c=e;for(;c=fc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function _c(e,t){var n,i;let{e:r,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t;const c=[e];let u=e;for(;u.parentNode&&!Cr(u,"body");)kr(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);const d=[],h={};let p,g=!1,f=!1;if(Jn(c,(e=>{const t=Lr(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&Vr(g)&&g);Qn(Tr(e),"ph-no-capture")&&(f=!0),d.push(mc(e,o,s,a));const n=function(e){if(!Lr(e))return{};const t={};return Jn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&Vr(i)&&(t[n]=i)}})),t}(e);Kn(h,n)})),f)return{props:{},explicitNoCapture:f};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?d[0].$el_text=Zr(e):d[0].$el_text=Rr(e)),g){var m,_;d[0].attr__href=g;const e=null===(m=Li(g))||void 0===m?void 0:m.host,t=null==Fn||null===(_=Fn.location)||void 0===_?void 0:_.host;e&&t&&e!==t&&(p=g)}return{props:Kn({$event_type:r.type,$ce_version:1},l?{$elements_chain:Ur(d)}:{$elements:d},null!==(n=d[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=d[0])||void 0===i?void 0:i.$el_text}:{},p&&"click"===r.type?{$external_click_url:p}:{},h)}}class vc{_initialized=!1;_isDisabledServerSide=null;rageclicks=new pc;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;const n=Si(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void zn.info("Disabling Automatic Event Collection because this browser is not supported");if(!Fn||!Bn)return;const e=e=>{e=e||(null==Fn?void 0:Fn.event);try{this._captureEvent(e)}catch(e){zn.error("Failed to capture event",e)}},t=e=>{e=e||(null==Fn?void 0:Fn.event),this._captureEvent(e,ui)};ai(Bn,"submit",e,!1,!0),ai(Bn,"change",e,!1,!0),ai(Bn,"click",e,!1,!0),this.config.capture_copied_text&&(ai(Bn,"copy",t,!1,!0),ai(Bn,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Vi]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;const n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{const i=null==Bn?void 0:Bn.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&n.push(t)}))})),n}get isEnabled(){var e,t;const n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Vi],i=this._isDisabledServerSide;if(xi(i)&&!Ri(n)&&!this.instance.config.advanced_disable_decide)return!1;const r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=Ar(e);var i;(Ir(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)&&(this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick"));const r=t===ui;if(n&&Or(n,e,this.config,r,r?["copy","cut"]:void 0)){const{props:i,explicitNoCapture:r}=_c(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(r)return!1;const s=this.getElementSelectors(n);if(s&&s.length>0&&(i.$element_selectors=s),t===ui){var o;const t=Mr(null==Fn||null===(o=Fn.getSelection())||void 0===o?void 0:o.toString()),n=e.type||"clipboard";if(!t)return!1;i.$selected_content=t,i.$copy_type=n}return this.instance.capture(t,i),!0}}isBrowserSupported(){return yi(null==Bn?void 0:Bn.querySelectorAll)}}const yc={};function bc(e){return function(e,t){const n=yc[e];if(n)return n;let i=t[e];if(bi(i)&&!wi(i))return yc[e]=i.bind(t);const r=t.document;if(r&&yi(r.createElement))try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const n=t.contentWindow;n&&n[e]&&(i=n[e]),r.head.removeChild(t)}catch(t){zn.warn(`Could not create sandbox iframe for ${e} check, bailing to assignableWindow.${e}: `,t)}return i&&yi(i)?yc[e]=i.bind(t):i}("MutationObserver",e)}function wc(e,t){return Mi(e)&&e>=t}class Sc{_clicks=[];_defaultConfig=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e});asRequiredConfig(e){var t,n,i,r;const o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==e?void 0:e.mutation_threshold_ms)&&void 0!==r?r:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){const t=bc(Gn);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,Gn.removeEventListener("click",this._onClick),Gn.removeEventListener("scroll",this._onScroll,!0),Gn.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){Gn.addEventListener("click",this._onClick)}_onClick=e=>{const t=function(e){const t=Ar(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);xi(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Ii(this._checkClickTimer)&&(this._checkClickTimer=Gn.setTimeout((()=>{this._checkClicks()}),1e3))};_startScrollObserver(){Gn.addEventListener("scroll",this._onScroll,!0)}_onScroll=()=>{const e=Date.now();e%50==0&&this._clicks.forEach((t=>{Ii(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))};_startSelectionChangedObserver(){Gn.addEventListener("selectionchange",this._onSelectionChange)}_onSelectionChange=()=>{this._lastSelectionChanged=Date.now()};_ignoreClick(e){if(!e)return!0;if(wr(e.node))return!0;const t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Cr(e.node,"html")&&Sr(e.node)&&!Nr.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(!this._clicks.length)return;clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;const e=this._clicks;this._clicks=[];for(const n of e){var t;n.mutationDelayMs=null!==(t=n.mutationDelayMs)&&void 0!==t?t:this._lastMutation&&n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp,n.selectionChangedDelayMs=this._lastSelectionChanged&&n.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-n.timestamp:void 0;const e=wc(n.scrollDelayMs,this._config.scroll_threshold_ms),i=wc(n.selectionChangedDelayMs,this._config.selection_change_threshold_ms),r=wc(n.mutationDelayMs,this._config.mutation_threshold_ms),o=wc(n.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),s=Mi(n.scrollDelayMs)&&n.scrollDelayMs<this._config.scroll_threshold_ms,a=Mi(n.mutationDelayMs)&&n.mutationDelayMs<this._config.mutation_threshold_ms,l=Mi(n.selectionChangedDelayMs)&&n.selectionChangedDelayMs<this._config.selection_change_threshold_ms;s||a||l||(e||r||o||i?this._onCapture(n,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:n.timestamp,$dead_click_scroll_timeout:e,$dead_click_mutation_timeout:r,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i}):n.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(n))}this._clicks.length&&Ii(this._checkClickTimer)&&(this._checkClickTimer=Gn.setTimeout((()=>{this._checkClicks()}),1e3))}_captureDeadClick(e,t){this.instance.capture("$dead_click",{...t,..._c(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props,$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs},{timestamp:new Date(e.timestamp)})}}Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Sc(e,t);const Cc=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return zn.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const i=()=>{if(!Bn)return n("document not found");const e=Bn.createElement("script");e.type="text/javascript",e.crossOrigin="anonymous",e.src=t,e.onload=e=>n(void 0,e),e.onerror=e=>n(e);const i=Bn.querySelectorAll("body > script");var r;i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):Bn.body.appendChild(e)};null!=Bn&&Bn.body?i():null==Bn||Bn.addEventListener("DOMContentLoaded",i)};Gn.__PosthogExtensions__=Gn.__PosthogExtensions__||{},Gn.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{let i=`/static/${t}.js?v=${e.version}`;if("toolbar"===t){const e=3e5;i=`${i}&t=${Math.floor(Date.now()/e)*e}`}const r=e.requestRouter.endpointFor("assets",i);Cc(e,r,n)},Gn.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{const i=e.requestRouter.endpointFor("api",t);Cc(e,i,n)};const Ic="$active_feature_flags",kc="$override_feature_flags",Ec="$feature_flag_payloads",xc=e=>{const t={};for(const[n,i]of ei(e||{}))i&&(t[n]=i);return t};class Tc{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){const e=this.instance.get_property(or),t=this.instance.get_property(kc);if(!t)return e||{};const n=Kn({},e),i=Object.keys(t);for(let e=0;e<i.length;e++)n[i[e]]=t[i[e]];return this._override_warning||(zn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(Ec)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);const e=this.instance.config.token,t=this.instance.get_property(ar),n=this.instance.get_property(lr),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:hi.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void zn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");const n=this.getFlagVariants()[e],i=`${n}`,r=this.instance.get_property(dr)||{};var o;!t.send_event&&"send_event"in t||(e in r&&r[e].includes(i)||(vi(r[e])?r[e].push(i):r[e]=[i],null===(o=this.instance.persistence)||void 0===o||o.register({[dr]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})));return n}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);zn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;const n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=e.featureFlags,o=e.featureFlagPayloads;if(!r)return;if(vi(r)){const e={};if(r)for(let t=0;t<r.length;t++)e[r[t]]=!0;return void(t&&t.register({[Ic]:r,[or]:e}))}let s=r,a=o;e.errorsWhileComputingFlags&&(s={...n,...s},a={...i,...a}),t&&t.register({[Ic]:Object.keys(xc(s)),[or]:s||{},[Ec]:a||{}})}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return zn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(kc);else if(vi(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[kc]:t})}else this.instance.persistence.register({[kc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;const i={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);const r={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[Ic]:Object.keys(xc(r)),[or]:r}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.instance.get_property(sr);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;const i=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[sr]:i}),e(i)}})}_prepareFeatureFlagsForCallbacks(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(ar)||{};this.instance.register({[ar]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ar)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(lr)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((t=>{n[t]={...n[t],...e[t]},delete e[t]})),this.instance.register({[lr]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.instance.get_property(lr)||{};this.instance.register({[lr]:{...t,[e]:{}}})}else this.instance.unregister(lr)}}
|
|
2
|
-
/**
|
|
3
|
-
* uuidv7: An experimental implementation of the proposed UUID Version 7
|
|
4
|
-
*
|
|
5
|
-
* @license Apache-2.0
|
|
6
|
-
* @copyright 2021-2023 LiosK
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*
|
|
9
|
-
* from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts
|
|
10
|
-
*/Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Mi(e)&&isFinite(e)&&Math.floor(e)===e});const Mc="0123456789abcdef";class Rc{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||e<0||t<0||n<0||i<0||e>0xffffffffffff||t>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/Math.pow(2,8),r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|n>>>24,r[9]=n>>>16,r[10]=n>>>8,r[11]=n,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i,new Rc(r)}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e=e+Mc.charAt(this.bytes[t]>>>4)+Mc.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Rc(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){const n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Ac{timestamp=0;counter=0;random=new Oc;generate(){const e=this.generateOrAbort();if(Ii(e)){this.timestamp=0;const e=this.generateOrAbort();if(Ii(e))throw new Error("Could not generate UUID after timestamp reset");return e}return e}generateOrAbort(){const e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Rc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}let Nc,Fc=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Fn&&!Ii(Fn.crypto)&&crypto.getRandomValues&&(Fc=e=>crypto.getRandomValues(e));class Oc{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(Fc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}const Lc=()=>Pc().toString(),Pc=()=>(Nc||(Nc=new Ac)).generate(),Dc="Thu, 01 Jan 1970 00:00:00 GMT";let $c="";const Bc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Hc(e,t){if(t){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bn;if($c)return $c;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";const n=e.split(".");let i=Math.min(n.length,8);const r="dmn_chk_"+Lc(),o=new RegExp("(^|;)\\s*"+r+"=1");for(;!$c&&i--;){const e=n.slice(i).join("."),s=r+"=1;domain=."+e;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+Dc,$c=e)}return $c}(e);if(!t){const n=(e=>{const t=e.match(Bc);return t?t[0]:""})(e);n!==t&&zn.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}const qc={is_supported:()=>!!Bn,error:function(e){zn.error("cookieStore error: "+e)},get:function(e){if(Bn){try{const t=e+"=",n=Bn.cookie.split(";").filter((e=>e.length));for(let e=0;e<n.length;e++){let i=n[e];for(;" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){let t;try{t=JSON.parse(qc.get(e))||{}}catch{}return t},set:function(e,t,n,i,r){if(Bn)try{let o="",s="";const a=Hc(Bn.location.hostname,i);if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}r&&(s="; secure");const l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&zn.warn("cookieStore warning: large cookie, len="+l.length),Bn.cookie=l,l}catch{return}},remove:function(e,t){try{qc.set(e,"",-1,t)}catch{return}}};let Wc=null;const Vc={is_supported:function(){if(!xi(Wc))return Wc;let e=!0;if(Ii(Fn))e=!1;else try{const t="__mplssupport__",n="xyz";Vc.set(t,n),'"xyz"'!==Vc.get(t)&&(e=!1),Vc.remove(t)}catch{e=!1}return e||zn.error("localStorage unsupported; falling back to cookie store"),Wc=e,e},error:function(e){zn.error("localStorage error: "+e)},get:function(e){try{return null==Fn?void 0:Fn.localStorage.getItem(e)}catch(e){Vc.error(e)}return null},parse:function(e){try{return JSON.parse(Vc.get(e))||{}}catch{}return null},set:function(e,t){try{null==Fn||Fn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Vc.error(e)}},remove:function(e){try{null==Fn||Fn.localStorage.removeItem(e)}catch(e){Vc.error(e)}}},Zc=["distinct_id",tr,nr,vr],Gc={...Vc,parse:function(e){try{let t={};try{t=qc.parse(e)||{}}catch{}const n=Kn(t,JSON.parse(Vc.get(e)||"{}"));return Vc.set(e,n),n}catch{}return null},set:function(e,t,n,i,r,o){try{Vc.set(e,t,void 0,void 0,o);const s={};Zc.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&qc.set(e,s,n,i,r,o)}catch(e){Vc.error(e)}},remove:function(e,t){try{null==Fn||Fn.localStorage.removeItem(e),qc.remove(e,t)}catch(e){Vc.error(e)}}},Uc={},zc={is_supported:function(){return!0},error:function(e){zn.error("memoryStorage error: "+e)},get:function(e){return Uc[e]||null},parse:function(e){return Uc[e]||null},set:function(e,t){Uc[e]=t},remove:function(e){delete Uc[e]}};let jc=null;const Yc={is_supported:function(){if(!xi(jc))return jc;if(jc=!0,Ii(Fn))jc=!1;else try{const e="__support__",t="xyz";Yc.set(e,t),'"xyz"'!==Yc.get(e)&&(jc=!1),Yc.remove(e)}catch{jc=!1}return jc},error:function(e){zn.error("sessionStorage error: ",e)},get:function(e){try{return null==Fn?void 0:Fn.sessionStorage.getItem(e)}catch(e){Yc.error(e)}return null},parse:function(e){try{return JSON.parse(Yc.get(e))||null}catch{}return null},set:function(e,t){try{null==Fn||Fn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Yc.error(e)}},remove:function(e){try{null==Fn||Fn.sessionStorage.removeItem(e)}catch(e){Yc.error(e)}}},Xc="Mobile",Jc="iOS",Kc="Android",Qc="Tablet",eu=Kc+" "+Qc,tu="iPad",nu="Apple",iu=nu+" Watch",ru="Safari",ou="BlackBerry",su="Samsung",au=su+"Browser",lu=su+" Internet",cu="Chrome",uu=cu+" OS",du=cu+" "+Jc,hu="Internet Explorer",pu=hu+" "+Xc,gu="Opera",fu=gu+" Mini",mu="Edge",_u="Microsoft "+mu,vu="Firefox",yu=vu+" "+Jc,bu="Nintendo",wu="PlayStation",Su="Xbox",Cu=Kc+" "+Xc,Iu=Xc+" "+ru,ku="Windows",Eu=ku+" Phone",xu="Nokia",Tu="Ouya",Mu="Generic",Ru=Mu+" "+Xc.toLowerCase(),Au=Mu+" "+Qc.toLowerCase(),Nu="Konqueror",Fu="(\\d+(\\.\\d+)?)",Ou=new RegExp("Version/"+Fu),Lu=new RegExp(Su,"i"),Pu=new RegExp(wu+" \\w+","i"),Du=new RegExp(bu+" \\w+","i"),$u=new RegExp(ou+"|PlayBook|BB10","i"),Bu={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};const Hu=(e,t)=>t&&Qn(t,nu)||function(e){return Qn(e,ru)&&!Qn(e,cu)&&!Qn(e,Kc)}(e),qu=function(e,t){return t=t||"",Qn(e," OPR/")&&Qn(e,"Mini")?fu:Qn(e," OPR/")?gu:$u.test(e)?ou:Qn(e,"IE"+Xc)||Qn(e,"WPDesktop")?pu:Qn(e,au)?lu:Qn(e,mu)||Qn(e,"Edg/")?_u:Qn(e,"FBIOS")?"Facebook "+Xc:Qn(e,"UCWEB")||Qn(e,"UCBrowser")?"UC Browser":Qn(e,"CriOS")?du:Qn(e,"CrMo")?cu:Qn(e,Kc)&&Qn(e,ru)?Cu:Qn(e,cu)?cu:Qn(e,"FxiOS")?yu:Qn(e.toLowerCase(),Nu.toLowerCase())?Nu:Hu(e,t)?Qn(e,Xc)?Iu:ru:Qn(e,vu)?vu:Qn(e,"MSIE")||Qn(e,"Trident/")?hu:Qn(e,"Gecko")?vu:""},Wu={[pu]:[new RegExp("rv:"+Fu)],[_u]:[new RegExp(mu+"?\\/"+Fu)],[cu]:[new RegExp("("+cu+"|CrMo)\\/"+Fu)],[du]:[new RegExp("CriOS\\/"+Fu)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Fu)],[ru]:[Ou],[Iu]:[Ou],[gu]:[new RegExp("(Opera|OPR)\\/"+Fu)],[vu]:[new RegExp(vu+"\\/"+Fu)],[yu]:[new RegExp("FxiOS\\/"+Fu)],[Nu]:[new RegExp("Konqueror[:/]?"+Fu,"i")],[ou]:[new RegExp(ou+" "+Fu),Ou],[Cu]:[new RegExp("android\\s"+Fu,"i")],[lu]:[new RegExp(au+"\\/"+Fu)],[hu]:[new RegExp("(rv:|MSIE )"+Fu)],Mozilla:[new RegExp("rv:"+Fu)]},Vu=[[new RegExp(Su+"; "+Su+" (.*?)[);]","i"),e=>[Su,e&&e[1]||""]],[new RegExp(bu,"i"),[bu,""]],[new RegExp(wu,"i"),[wu,""]],[$u,[ou,""]],[new RegExp(ku,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Eu,""];if(new RegExp(Xc).test(t)&&!/IEMobile\b/.test(t))return[ku+" "+Xc,""];const n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){const e=n[1];let i=Bu[e]||"";return/arm/i.test(t)&&(i="RT"),[ku,i]}return[ku,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){const t=[e[3],e[4],e[5]||"0"];return[Jc,t.join(".")]}return[Jc,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=Ii(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Kc+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Kc+")","i"),e=>{if(e&&e[2]){const t=[e[2],e[3],e[4]||"0"];return[Kc,t.join(".")]}return[Kc,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];if(e&&e[1]){const n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[uu,""]],[/Linux|debian/i,["Linux",""]]],Zu=function(e){return Du.test(e)?bu:Pu.test(e)?wu:Lu.test(e)?Su:new RegExp(Tu,"i").test(e)?Tu:new RegExp("("+Eu+"|WPDesktop)","i").test(e)?Eu:/iPad/.test(e)?tu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?iu:$u.test(e)?ou:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(xu,"i").test(e)?xu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Xc).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Kc:eu:Kc:new RegExp("(pda|"+Xc+")","i").test(e)?Ru:new RegExp(Qc,"i").test(e)&&!new RegExp(Qc+" pc","i").test(e)?Au:""},Gu="https?://(.*)",Uu=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],zu={campaignParams:function(e){return Bn?this._campaignParamsFromUrl(Bn.URL,e):{}},_campaignParamsFromUrl:function(e,t){const n=Uu.concat(t||[]),i={};return Jn(n,(function(t){const n=$i(e,t);i[t]=n||null})),i},_searchEngine:function(e){return e?0===e.search(Gu+"google.([^/?]*)")?"google":0===e.search(Gu+"bing.com")?"bing":0===e.search(Gu+"yahoo.com")?"yahoo":0===e.search(Gu+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){const t=zu._searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(!xi(t)){i.$search_engine=t;const e=Bn?$i(Bn.referrer,n):"";e.length&&(i.ph_keyword=e)}return i},searchInfo:function(){const e=null==Bn?void 0:Bn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:qu,browserVersion:function(e,t){const n=qu(e,t),i=Wu[n];if(Ii(i))return null;for(let t=0;t<i.length;t++){const n=i[t],r=e.match(n);if(r)return parseFloat(r[r.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(let t=0;t<Vu.length;t++){const[n,i]=Vu[t],r=n.exec(e),o=r&&(yi(i)?i(r,e):i);if(o)return o}return["",""]},device:Zu,deviceType:function(e){const t=Zu(e);return t===tu||t===eu||"Kobo"===t||"Kindle Fire"===t||t===Au?Qc:t===bu||t===Su||t===wu||t===Tu?"Console":t===iu?"Wearable":t?Xc:"Desktop"},referrer:function(){return(null==Bn?void 0:Bn.referrer)||"$direct"},referringDomain:function(){var e;return null!=Bn&&Bn.referrer&&(null===(e=Li(Bn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==Hn?void 0:Hn.href}},initialPersonPropsFromInfo:function(e){var t;const{r:n,u:i}=e,r={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=Li(n))||void 0===t?void 0:t.host};if(i){r.$initial_current_url=i;const e=Li(i);r.$initial_host=null==e?void 0:e.host,r.$initial_pathname=null==e?void 0:e.pathname;Jn(this._campaignParamsFromUrl(i),(function(e,t){r["$initial_"+ri(t)]=e}))}if(n){Jn(this._searchInfoFromReferrer(n),(function(e,t){r["$initial_"+ri(t)]=e}))}return r},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},properties:function(){if(!Zn)return{};const[e,t]=zu.os(Zn);return Kn(ii({$os:e,$os_version:t,$browser:zu.browser(Zn,navigator.vendor),$device:zu.device(Zn),$device_type:zu.deviceType(Zn),$timezone:zu.timezone()}),{$current_url:null==Hn?void 0:Hn.href,$host:null==Hn?void 0:Hn.host,$pathname:null==Hn?void 0:Hn.pathname,$raw_user_agent:Zn.length>1e3?Zn.substring(0,997)+"...":Zn,$browser_version:zu.browserVersion(Zn,navigator.vendor),$browser_language:zu.browserLanguage(),$screen_height:null==Fn?void 0:Fn.screen.height,$screen_width:null==Fn?void 0:Fn.screen.width,$viewport_height:null==Fn?void 0:Fn.innerHeight,$viewport_width:null==Fn?void 0:Fn.innerWidth,$lib:"web",$lib_version:Nn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Zn)return{};const[e,t]=zu.os(Zn);return Kn(ii({$os:e,$os_version:t,$browser:zu.browser(Zn,navigator.vendor)}),{$browser_version:zu.browserVersion(Zn,navigator.vendor)})}},ju=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Yu{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&zn.info("Persistence loaded",e.persistence,{...this.props}),this.update_config(e,e),this.save()}buildStorage(e){let t;-1===ju.indexOf(e.persistence.toLowerCase())&&(zn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const n=e.persistence.toLowerCase();return t="localstorage"===n&&Vc.is_supported()?Vc:"localstorage+cookie"===n&&Gc.is_supported()?Gc:"sessionstorage"===n&&Yc.is_supported()?Yc:"memory"===n?zc:"cookie"===n?qc:Gc.is_supported()?Gc:qc,t}properties(){const e={};return Jn(this.props,(function(t,n){if(n===or&&Si(t)){const n=Object.keys(t);for(let i=0;i<n.length;i++)e[`$feature/${n[i]}`]=t[n[i]]}else(function(e,t){let n=!1;return xi(e)?n:Dn&&e.indexOf===Dn?-1!=e.indexOf(t):(Jn(e,(function(e){if(n||(n=e===t))return jn})),n)})(br,n)||(e[n]=t)})),e}load(){if(this.disabled)return;const e=this.storage.parse(this.name);e&&(this.props=Kn({},e))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Si(e)){Ii(t)&&(t="None"),this.expire_days=Ii(n)?this.default_expiry:n;let i=!1;if(Jn(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Si(e)){this.expire_days=Ii(t)?this.default_expiry:t;let n=!1;if(Jn(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){const e=zu.campaignParams(this.config.custom_campaign_params);Ci(ii(e))||this.register(zu.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0}}update_search_keyword(){this.register(zu.searchInfo())}update_referrer_info(){this.register_once(zu.referrerInfo(),void 0)}set_initial_person_info(){this.props[fr]||this.props[mr]||this.register_once({[_r]:zu.initialPersonInfo()},void 0)}get_referrer_info(){return ii({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){const e={};Jn([mr,fr],(t=>{const n=this.props[t];n&&Jn(n,(function(t,n){e["$initial_"+ri(n)]=t}))}));const t=this.props[_r];if(t){const n=zu.initialPersonPropsFromInfo(t);Kn(e,n)}return e}safe_merge(e){return Jn(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){const t=this.buildStorage(e),n=this.props;this.clear(),this.storage=t,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){const n=this.props[Wi]||{};n[e]=t,this.props[Wi]=n,this.save()}remove_event_timer(e){const t=(this.props[Wi]||{})[e];return Ii(t)||(delete this.props[Wi][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function Xu(e){var t;return(null===(t=JSON.stringify(e,function(){const e=[];return function(t,n){if(Si(n)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}return n}}()))||void 0===t?void 0:t.length)||0}function Ju(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){const t=Math.floor(e.data.length/2),n=e.data.slice(0,t),i=e.data.slice(t);return[Ju({size:Xu(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),Ju({size:Xu(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Ku=(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))(Ku||{}),Qu=(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))(Qu||{});function ed(e,t,n,i){return t>n&&(zn.warn("min cannot be greater than max."),t=n),Mi(e)?e>n?(i&&zn.warn(i+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(i&&zn.warn(i+" cannot be less than min: "+t+". Using min value instead."),t):e:(i&&zn.warn(i+" must be a number. Defaulting to max value:"+n),n)}class td{bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=e,this.options=i,this.refillRate=ed(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=ed(null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))};getNodeOrRelevantParent=e=>{const t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){const e=t.closest("svg");if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]};numberOfChanges=e=>{var t,n,i,r,o,s,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)};throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;const t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t;const[n,i]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[n])return!1;var r,o;(this.mutationBuckets[n]=null!==(t=this.mutationBuckets[n])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),0===this.mutationBuckets[n])&&(this.loggedTracker[n]||(this.loggedTracker[n]=!0,null===(r=(o=this.options).onBlockedNode)||void 0===r||r.call(o,n,i)));return e})));const i=this.numberOfChanges(t);return 0!==i||n===i?e:void 0}}var nd=Uint8Array,id=Uint16Array,rd=Uint32Array,od=new nd([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sd=new nd([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ad=new nd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ld=function(e,t){for(var n=new id(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new rd(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},cd=ld(od,2),ud=cd[0],dd=cd[1];ud[28]=258,dd[258]=28;for(var hd=ld(sd,0)[1],pd=new id(32768),gd=0;gd<32768;++gd){var fd=(43690&gd)>>>1|(21845&gd)<<1;fd=(61680&(fd=(52428&fd)>>>2|(13107&fd)<<2))>>>4|(3855&fd)<<4,pd[gd]=((65280&fd)>>>8|(255&fd)<<8)>>>1}var md=function(e,t,n){for(var i=e.length,r=0,o=new id(t);r<i;++r)++o[e[r]-1];var s,a=new id(t);for(r=0;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new id(1<<t);var l=15-t;for(r=0;r<i;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[pd[d]>>>l]=c}else for(s=new id(i),r=0;r<i;++r)s[r]=pd[a[e[r]-1]++]>>>15-e[r];return s},_d=new nd(288);for(gd=0;gd<144;++gd)_d[gd]=8;for(gd=144;gd<256;++gd)_d[gd]=9;for(gd=256;gd<280;++gd)_d[gd]=7;for(gd=280;gd<288;++gd)_d[gd]=8;var vd=new nd(32);for(gd=0;gd<32;++gd)vd[gd]=5;var yd=md(_d,9,0),bd=md(vd,5,0),wd=function(e){return(e/8>>0)+(7&e&&1)},Sd=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof id?id:e instanceof rd?rd:nd)(n-t);return i.set(e.subarray(t,n)),i},Cd=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},Id=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},kd=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,o=n.slice();if(!r)return[new nd(0),0];if(1==r){var s=new nd(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(i=1;i<r;++i)o[i].s>h&&(h=o[i].s);var p=new id(h+1),g=Ed(n[u-1],p,0);if(g>t){i=0;var f=0,m=g-t,_=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<r;++i){var v=o[i].s;if(!(p[v]>t))break;f+=_-(1<<g-p[v]),p[v]=t}for(f>>>=m;f>0;){var y=o[i].s;p[y]<t?f-=1<<t-p[y]++-1:++i}for(;i>=0&&f;--i){var b=o[i].s;p[b]==t&&(--p[b],++f)}g=t}return[new nd(p),g]},Ed=function(e,t,n){return-1==e.s?Math.max(Ed(e.l,t,n+1),Ed(e.r,t,n+1)):t[e.s]=n},xd=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new id(++t),i=0,r=e[0],o=1,s=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=e[a]}return[n.subarray(0,i),t]},Td=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},Md=function(e,t,n){var i=n.length,r=wd(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var o=0;o<i;++o)e[r+o+4]=n[o];return 8*(r+4+i)},Rd=function(e,t,n,i,r,o,s,a,l,c,u){Cd(t,u++,n),++r[256];for(var d=kd(r,15),h=d[0],p=d[1],g=kd(o,15),f=g[0],m=g[1],_=xd(h),v=_[0],y=_[1],b=xd(f),w=b[0],S=b[1],C=new id(19),I=0;I<v.length;++I)C[31&v[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=kd(C,7),E=k[0],x=k[1],T=19;T>4&&!E[ad[T-1]];--T);var M,R,A,N,F=c+5<<3,O=Td(r,_d)+Td(o,vd)+s,L=Td(r,h)+Td(o,f)+s+14+3*T+Td(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=L)return Md(t,u,e.subarray(l,l+c));if(Cd(t,u,1+(L<O)),u+=2,L<O){M=md(h,p,0),R=h,A=md(f,m,0),N=f;var P=md(E,x,0);Cd(t,u,y-257),Cd(t,u+5,S-1),Cd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)Cd(t,u+3*I,E[ad[I]]);u+=3*T;for(var D=[v,w],$=0;$<2;++$){var B=D[$];for(I=0;I<B.length;++I){var H=31&B[I];Cd(t,u,P[H]),u+=E[H],H>15&&(Cd(t,u,B[I]>>>5&127),u+=B[I]>>>12)}}}else M=yd,R=_d,A=bd,N=vd;for(I=0;I<a;++I)if(i[I]>255){H=i[I]>>>18&31;Id(t,u,M[H+257]),u+=R[H+257],H>7&&(Cd(t,u,i[I]>>>23&31),u+=od[H]);var q=31&i[I];Id(t,u,A[q]),u+=N[q],q>3&&(Id(t,u,i[I]>>>5&8191),u+=sd[q])}else Id(t,u,M[i[I]]),u+=R[i[I]];return Id(t,u,M[256]),u+R[256]},Ad=new rd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nd=function(){for(var e=new rd(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Fd=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=Nd[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Od=function(e,t,n,i,r){return function(e,t,n,i,r,o){var s=e.length,a=new nd(i+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(i,a.length-r),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Md(l,c,e.subarray(u,d)):(l[u]=o,c=Md(l,c,e.subarray(u,s)))}else{for(var h=Ad[t-1],p=h>>>13,g=8191&h,f=(1<<n)-1,m=new id(32768),_=new id(f+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&f},w=new rd(25e3),S=new id(288),C=new id(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=_[M];if(m[R]=A,_[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=Rd(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,L=0,P=g,D=R-A&32767;if(N>2&&M==b(u-D))for(var $=Math.min(p,N)-1,B=Math.min(32767,u),H=Math.min(258,N);D<=B&&--P&&R!=A;){if(e[u+O]==e[u+O-D]){for(var q=0;q<H&&e[u+q]==e[u+q-D];++q);if(q>O){if(O=q,L=D,q>$)break;var W=Math.min(D,q-2),V=0;for(F=0;F<W;++F){var Z=u-D+F+32768&32767,G=Z-m[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=m[R])+32768&32767}if(L){w[E++]=268435456|dd[O]<<18|hd[L];var U=31&dd[O],z=31&hd[L];k+=od[U]+sd[z],++S[257+U],++C[z],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=Rd(e,l,o,w,S,C,k,E,T,u-T,c)}return Sd(a,0,i+wd(c)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!r)},Ld=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Pd=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ld(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},Dd=function(e){return 10+(e.filename&&e.filename.length+1||0)};function $d(e,t){void 0===t&&(t={});var n=Fd(),i=e.length;n.p(e);var r=Od(e,t,Dd(t),8),o=r.length;return Pd(r,t),Ld(r,o-8,n.d()),Ld(r,o-4,i),r}function Bd(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new nd(e.length+(e.length>>>1)),r=0,o=function(e){i[r++]=e},s=0;s<n;++s){if(r+5>i.length){var a=new nd(r+8+(n-s<<1));a.set(i),i=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return Sd(i,0,r)}const Hd=3e5,qd=[Qu.MouseMove,Qu.MouseInteraction,Qu.Scroll,Qu.ViewportResize,Qu.Input,Qu.TouchMove,Qu.MediaInteraction,Qu.Drag],Wd=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),Vd="[SessionRecording]";function Zd(e){return function(e,t){for(var n="",i=0;i<e.length;){var r=e[i++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[i++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[i++])<<6|63&e[i++]):(r=((15&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}($d(Bd(JSON.stringify(e))),!0)}function Gd(e){return e.type===Ku.Custom&&"sessionIdle"===e.data.tag}function Ud(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class zd{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_urlBlocklist=[];_urlBlocked=!1;_eventTriggers=[];_removeEventTriggerCaptureHook=void 0;_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==Gn||null===(e=Gn.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Vd+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:Hd}get isSampled(){const e=this.instance.get_property(nr);return Ri(e)?e:null}get sessionDuration(){var e,t;const n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-i:null}get isRecordingEnabled(){const e=!!this.instance.get_property(Yi),t=!this.instance.config.disable_session_recording;return Fn&&e&&t}get isConsoleLogCaptureEnabled(){const e=!!this.instance.get_property(Xi),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,n,i,r,o;const s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Ki),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(n=null!==(i=null==s?void 0:s.canvasFps)&&void 0!==i?i:null==a?void 0:a.fps)&&void 0!==n?n:0,u=null!==(r=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==r?r:0;return{enabled:l,fps:ed(c,0,12,"canvas recording fps"),quality:ed(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t;const n=this.instance.get_property(Ji),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),s=Si(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Ri(s)?s:null==n?void 0:n.capturePerformance);return r||o||a?{recordHeaders:r,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){const e=this.instance.get_property(Qi);return Mi(e)?e:null}get minimumDuration(){const e=this.instance.get_property(er);return Mi(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?Ti(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":this._urlBlocked?"paused":Ri(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;if(0===this._urlTriggers.length)return"trigger_disabled";return(null===(e=this.instance)||void 0===e?void 0:e.get_property(ir))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;if(0===this._eventTriggers.length)return"trigger_disabled";return(null===(e=this.instance)||void 0===e?void 0:e.get_property(rr))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){const e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw zn.error(Vd+" started without valid sessionManager"),new Error(Vd+" started without valid sessionManager. This is a bug.");const{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&zn.warn(Vd+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=Bn&&Bn.visibilityState){const e="window "+Bn.visibilityState;this._tryAddCustomEvent(e,{})}};startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==Fn||Fn.addEventListener("beforeunload",this._onBeforeUnload),null==Fn||Fn.addEventListener("offline",this._onOffline),null==Fn||Fn.addEventListener("online",this._onOnline),null==Fn||Fn.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Ti(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook((e=>{try{if("$pageview"===e){const e=Fn?this._maskUrl(Fn.location.href):"";if(!e)return;this._tryAddCustomEvent("$pageview",{href:e})}}catch(e){zn.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var i,r,o,s;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r||r.unregister(rr),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(ir))})))):this.stopRecording()}stopRecording(){var e,t,n,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==Fn||Fn.removeEventListener("beforeunload",this._onBeforeUnload),null==Fn||Fn.removeEventListener("offline",this._onOffline),null==Fn||Fn.removeEventListener("online",this._onOnline),null==Fn||Fn.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(i=this._samplingSessionListener)||void 0===i||i.call(this),this._samplingSessionListener=void 0,zn.info(Vd+" stopped"))}makeSamplingDecision(e){var t;const n=this.sessionId!==e,i=this.sampleRate;var r;if(!Mi(i))return void(null===(r=this.instance.persistence)||void 0===r||r.register({[nr]:null}));const o=this.isSampled;let s;const a=n||!Ri(o);if(a){s=Math.random()<i}else s=o;a&&(s?this._reportStarted("sampled"):zn.warn(Vd+` Sample rate (${i}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:s})),null===(t=this.instance.persistence)||void 0===t||t.register({[nr]:s})}afterDecideResponse(e){var t,n,i,r,o,s;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!Ti(this._linkedFlag)&&!this._linkedFlagSeen){const e=ki(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,t=ki(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((n,i)=>{const r=Si(i)&&e in i,o=t?i[e]===t:r;o&&this._reportStarted("linked_flag_matched",{linkedFlag:e,linkedVariant:t}),this._linkedFlagSeen=o}))}null!==(i=e.sessionRecording)&&void 0!==i&&i.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(r=e.sessionRecording)&&void 0!==r&&r.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Mi(this.sampleRate)&&Ti(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistDecideResponse(e){if(this.instance.persistence){var t;const n=this.instance.persistence,i=()=>{var t,i,r,o,s,a,l;const c=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate,u=Ti(c)?null:parseFloat(c),d=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[Yi]:!!e.sessionRecording,[Xi]:null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled,[Ji]:{capturePerformance:e.capturePerformance,...null===(o=e.sessionRecording)||void 0===o?void 0:o.networkPayloadCapture},[Ki]:{enabled:null===(s=e.sessionRecording)||void 0===s?void 0:s.recordCanvas,fps:null===(a=e.sessionRecording)||void 0===a?void 0:a.canvasFps,quality:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasQuality},[Qi]:u,[er]:Ii(d)?null:d})};i(),null===(t=this._persistDecideOnSessionListener)||void 0===t||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!Ii(Object.assign)&&!Ii(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=Gn.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"recorder",(e=>{if(e)return zn.error(Vd+" could not load recorder",e);this._onScriptLoaded()}));zn.info(Vd+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==qd.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){const t=this.isInteractiveEvent(e);if(!t&&!this.isIdle){e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer())}let n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),this.isIdle)return;const{windowId:i,sessionId:r}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==r,s=this.windowId!==i;this.windowId=i,this.sessionId=r,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):zn.warn(Vd+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Wd((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Wd((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e;const t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording;for(const[e,i]of Object.entries(n||{}))e in t&&("maskInputOptions"===e?t.maskInputOptions={password:!0,...i}:t[e]=i);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void zn.error(Vd+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new td(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{const n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;zn.info(n,{node:t}),this.log(Vd+" "+n,"warn")}});const i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:e=>{this.onRRwebEmit(e)},plugins:i,...t}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:i.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;const e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}_gatherRRWebPlugins(){var e,t,n,i;const r=[],o=null===(e=Gn.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&r.push(o());const s=null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.rrwebPlugins)||void 0===i?void 0:i.getRecordNetworkPlugin;if(this.networkPayloadCapture&&yi(s)){!Oi.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(s(io(this.instance.config,this.networkPayloadCapture))):zn.info(Vd+" NetworkCapture not started because we are on localhost.")}return r}onRRwebEmit(e){var t;if(this._processQueuedEvents(),!e||!Si(e))return;if(e.type===Ku.Meta){const t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),"paused"===this.status&&!function(e){return e.type===Ku.Custom&&"recording paused"===e.data.tag}(e))return;e.type===Ku.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Ku.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();const n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(!n)return;const i=function(e){const t=e;if(t&&Si(t)&&6===t.type&&Si(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));const n=[];for(let e=0;e<t.data.payload.payload.length;e++)t.data.payload.payload[e]&&t.data.payload.payload[e].length>2e3?n.push(t.data.payload.payload[e].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[e]);return t.data.payload.payload=n,e}return e}(n);if(this._updateWindowAndSessionIds(i),this.isIdle&&!Gd(i))return;if(Gd(i)){const e=i.data.payload;if(e){const t=e.lastActivityTimestamp,n=e.threshold;i.timestamp=t+n}}const r=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Xu(e)<1024)return e;try{if(e.type===Ku.FullSnapshot)return{...e,data:Zd(e.data),cv:"2024-10"};if(e.type===Ku.IncrementalSnapshot&&e.data.source===Qu.Mutation)return{...e,cv:"2024-10",data:{...e.data,texts:Zd(e.data.texts),attributes:Zd(e.data.attributes),removes:Zd(e.data.removes),adds:Zd(e.data.adds)}};if(e.type===Ku.IncrementalSnapshot&&e.data.source===Qu.StyleSheetRule)return{...e,cv:"2024-10",data:{...e.data,adds:Zd(e.data.adds),removes:Zd(e.data.removes)}}}catch(e){zn.error(Vd+" could not compress event - will use uncompressed event",e)}return e}(i):i,o={$snapshot_bytes:Xu(r),$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!Fn)return;const e=this._maskUrl(Fn.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){const e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){const t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n;let i={url:e};return i=t.maskNetworkRequestFn(i),null===(n=i)||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);const e=this.minimumDuration,t=this.sessionDuration,n=Mi(t)&&t>=0,i=Mi(e)&&n&&t<e;if("buffering"===this.status||i)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;if(this.buffer.data.length>0){Ju(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}))}return this.clearBuffer()}_captureSnapshotBuffered(e){var t;const n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0===Fn||!Fn.location.href)return;const e=Fn.location.href,t="paused"===this.status,n=Ud(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),Ud(e,this._urlTriggers)&&this._activateTrigger("url")}_activateTrigger(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({["url"===e?ir:rr]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;"paused"!==this.status&&(this._urlBlocked=!0,null==Bn||null===(e=Bn.body)||void 0===e||null===(t=e.classList)||void 0===t||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout((()=>{this._flushBuffer()}),100),zn.info(Vd+" recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;"paused"===this.status&&(this._urlBlocked=!1,null==Bn||null===(e=Bn.body)||void 0===e||null===(t=e.classList)||void 0===t||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),zn.info(Vd+" recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&Ti(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){zn.error(Vd+"Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[nr]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),zn.info(Vd+" "+e.replace("_"," "),t),Qn(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}class jd{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){const e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ar),group_properties:this.instance.get_property(lr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:hi.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();const t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},t),t)zn.error("Failed to fetch feature flags from PostHog.");else{if(!Bn||!Bn.body)return zn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps)for(const{id:t,url:o}of e.siteApps){var n,i,r;Gn[`__$$ph_site_app_${t}`]=this.instance,null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=(r=n).loadSiteApp)||void 0===i||i.call(r,this.instance,o,(e=>{if(e)return zn.error(`Error while initializing PostHog app with config id ${t}`,e)}))}else e.siteApps.length>0&&zn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}const Yd=null!=Fn&&Fn.location?Bi(Fn.location.hash,"__posthog")||Bi(location.hash,"state"):null,Xd="_postHogToolbarParams";var Jd;!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Jd||(Jd={}));class Kd{constructor(e){this.instance=e}setToolbarState(e){Gn.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=Gn.ph_toolbar_state)&&void 0!==e?e:Jd.UNINITIALIZED}maybeLoadToolbar(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Fn||!Bn)return!1;n=null!==(e=n)&&void 0!==e?e:Fn.location,r=null!==(t=r)&&void 0!==t?t:Fn.history;try{if(!i){try{Fn.localStorage.setItem("test","test"),Fn.localStorage.removeItem("test")}catch{return!1}i=null==Fn?void 0:Fn.localStorage}const e=Yd||Bi(n.hash,"__posthog")||Bi(n.hash,"state");let t;const o=e?ti((()=>JSON.parse(atob(decodeURIComponent(e)))))||ti((()=>JSON.parse(decodeURIComponent(e)))):null;return o&&"ph_authorize"===o.action?(t=o,t.source="url",t&&Object.keys(t).length>0&&(o.desiredHash?n.hash=o.desiredHash:r?r.replaceState(r.state,"",n.pathname+n.search):n.hash="")):(t=JSON.parse(i.getItem(Xd)||"{}"),t.source="localstorage",delete t.userIntent),!(!t.token||this.instance.config.token!==t.token)&&(this.loadToolbar(t),!0)}catch{return!1}}_callLoadToolbar(e){(Gn.ph_load_toolbar||Gn.ph_load_editor)(e,this.instance)}loadToolbar(e){const t=!(null==Bn||!Bn.getElementById(yr));if(!Fn||t)return!1;const n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i={token:this.instance.config.token,...e,apiURL:this.instance.requestRouter.endpointFor("ui"),...n?{instrument:!1}:{}};if(Fn.localStorage.setItem(Xd,JSON.stringify({...i,source:void 0})),this.getToolbarState()===Jd.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Jd.UNINITIALIZED){var r,o;this.setToolbarState(Jd.LOADING),null===(r=Gn.__PosthogExtensions__)||void 0===r||null===(o=r.loadExternalDependency)||void 0===o||o.call(r,this.instance,"toolbar",(e=>{if(e)return zn.error("Failed to load toolbar",e),void this.setToolbarState(Jd.UNINITIALIZED);this.setToolbarState(Jd.LOADED),this._callLoadToolbar(i)})),ai(Fn,"turbolinks:load",(()=>{this.setToolbarState(Jd.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class Qd{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(e){this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();const e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),n=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];n.map((e=>{this.sendRequest({...e,transport:"sendBeacon"})}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){const e=this.formatQueue();for(const t in e){const n=e[t],i=(new Date).getTime();n.data&&vi(n.data)&&Jn(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),this.sendRequest(n)}}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){const e={};return Jn(this.queue,(t=>{var n;const i=t,r=(i?i.batchKey:null)||i.url;Ii(e[r])&&(e[r]={...i,data:[]}),null===(n=e[r].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}const eh=!!Wn||!!qn,th="text/plain",nh=(e,t)=>{const[n,i]=e.split("?"),r={...t};null==i||i.split("&").forEach((e=>{const[t]=e.split("=");delete r[t]}));let o=Di(r);return o=o?(i?i+"&":"")+o:i,`${n}?${o}`},ih=e=>{let{data:t,compression:n}=e;if(!t)return;if(n===hi.GZipJS){const e=$d(Bd(JSON.stringify(t)),{mtime:0}),n=new Blob([e],{type:th});return{contentType:th,body:n,estimatedSize:n.size}}if(n===hi.Base64){const e=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n,i,r,o,s,a,l,c,u=0,d=0,h="";const p=[];if(!e)return e;e=si(e);do{n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),c=n<<16|i<<8|r,o=c>>18&63,s=c>>12&63,a=c>>6&63,l=63&c,p[d++]=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(l)}while(u<e.length);switch(h=p.join(""),e.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}(JSON.stringify(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)))(e);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}const i=JSON.stringify(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},rh=e=>{var t;const n=new Wn;n.open(e.method||"GET",e.url,!0);const{contentType:i,body:r}=null!==(t=ih(e))&&void 0!==t?t:{};Jn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t;const i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch{}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.send(r)},oh=e=>{var t,n;const{contentType:i,body:r,estimatedSize:o}=null!==(t=ih(e))&&void 0!==t?t:{},s=new Headers;Jn(e.headers,(function(e,t){s.append(t,e)})),i&&s.append("Content-Type",i);const a=e.url;let l=null;if(Vn){const t=new Vn;l={signal:t.signal,timeout:setTimeout((()=>t.abort()),e.timeout)}}qn(a,{method:(null==e?void 0:e.method)||"GET",headers:s,keepalive:"POST"===e.method&&(o||0)<52428.8,body:r,signal:null===(n=l)||void 0===n?void 0:n.signal}).then((t=>t.text().then((n=>{var i;const r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){zn.error(e)}null===(i=e.callback)||void 0===i||i.call(e,r)})))).catch((t=>{var n;zn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>l?clearTimeout(l.timeout):null))},sh=e=>{const t=nh(e.url,{beacon:"1"});try{var n;const{contentType:i,body:r}=null!==(n=ih(e))&&void 0!==n?n:{},o="string"==typeof r?new Blob([r],{type:i}):r;$n.sendBeacon(t,o)}catch{}},ah=[];Wn&&ah.push({transport:"XHR",method:rh}),qn&&ah.push({transport:"fetch",method:oh}),null!=$n&&$n.sendBeacon&&ah.push({transport:"sendBeacon",method:sh});class lh{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(e){this.instance=e,this.queue=[],this.areWeOnline=!0,!Ii(Fn)&&"onLine"in Fn.navigator&&(this.areWeOnline=Fn.navigator.onLine,Fn.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),Fn.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){let{retriesPerformedSoFar:t,...n}=e;Mi(t)&&t>0&&(n.url=nh(n.url,{retry_count:t})),this.instance._send_request({...n,callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue({retriesPerformedSoFar:t,...n}):null===(i=n.callback)||void 0===i||i.call(n,e)}})}enqueue(e){const t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;const n=function(e){const t=3e3*Math.pow(2,e),n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});let r=`Enqueued failed request for retry in ${n}`;navigator.onLine||(r+=" (Browser is offline)"),zn.warn(r),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){const e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(const{requestOptions:e}of n)this.retriableRequest(e)}unload(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);for(const{requestOptions:e}of this.queue)try{this.instance._send_request({...e,transport:"sendBeacon"})}catch(e){zn.error(e)}this.queue=[]}}class ch{_sessionIdChangedHandlers=[];constructor(e,t,n,i){var r;this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Lc,this._windowIdGenerator=i||Lc;const o=e.persistence_name||e.token,s=e.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ed(s,60,1800,"session_idle_timeout_seconds"),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){const e=Yc.parse(this._window_id_storage_key),t=Yc.parse(this._primary_window_exists_storage_key);e&&!t?this._windowId=e:Yc.remove(this._window_id_storage_key),Yc.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{const e=(e=>{const t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),e)}catch(e){zn.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Ii(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Yc.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Yc.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Yc.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[tr]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];const e=this.persistence.props[tr];return vi(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==Fn||Fn.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&Yc.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime();let[n,i,r]=this._getSessionId(),o=this._getWindowId();const s=Mi(r)&&r>0&&Math.abs(t-r)>864e5;let a=!1;const l=!i,c=!e&&Math.abs(t-n)>this.sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),o=this._windowIdGenerator(),zn.info("[SessionId] new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),r=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);const u=0===n||!e||s?t:n,d=0===r?(new Date).getTime():r;return this._setWindowId(o),this._setSessionId(i,u,d),a&&this._sessionIdChangedHandlers.forEach((e=>e(i,o,a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:n}}}let uh;!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(uh||(uh={}));const dh="i.posthog.com";class hh{_regionCache={};constructor(e){this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e;let t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${dh}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=uh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=uh.EU:this._regionCache[this.apiHost]=uh.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.uiHost+t;if(this.region===uh.CUSTOM)return this.apiHost+t;const n=dh+t;switch(e){case"assets":return`https://${this.region}-assets.${n}`;case"api":return`https://${this.region}.${n}`}}}const ph="posthog-js";function gh(e){let{organization:t,projectId:n,prefix:i,severityAllowList:r=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===r||r.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});const d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.map((e=>{e.stacktrace&&(e.stacktrace.type="raw")}));const p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags,$level:o.level};return t&&n&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class fh{constructor(e,t,n,i,r){this.name=ph,this.setupOnce=function(o){o(gh(e,{organization:t,projectId:n,prefix:i,severityAllowList:r}))}}}function mh(e,t){const n=e.config.segment;if(!n)return t();!function(e,t){const n=e.config.segment;if(!n)return t();const i=n=>{const i=()=>n.anonymousId()||Lc();e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(hr,"identified")),t()},r=n.user();"then"in r&&yi(r.then)?r.then((e=>i(e))):i(r)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||zn.warn("This browser does not have Promise support, and can not use the segment integration");const t=(t,n)=>{var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(zn.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(zn.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));const r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class _h{constructor(e){this._instance=e}doPageView(e){var t;const n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==Fn?void 0:Fn.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){const t=this._currentPath,n=this._prevPageviewTimestamp,i=this._instance.scrollManager.getContext();if(!n)return{};let r={};if(i){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:n,maxContentHeight:o,lastContentY:s,maxContentY:a}=i;if(!(Ii(e)||Ii(t)||Ii(n)||Ii(o)||Ii(s)||Ii(a))){e=Math.ceil(e),t=Math.ceil(t),n=Math.ceil(n),o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a);r={$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:e<=1?1:ed(t/e,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:e<=1?1:ed(n/e,0,1),$prev_pageview_last_content:s,$prev_pageview_last_content_percentage:o<=1?1:ed(s/o,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:o<=1?1:ed(a/o,0,1)}}}return t&&(r.$prev_pageview_pathname=t),n&&(r.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),r}}class vh{events={};constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(const n of this.events[e]||[])n(t);for(const n of this.events["*"]||[])n(e,t)}}class yh{_debugEventEmitter=new vh;constructor(e){this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!Ii(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;const e=(e,t)=>{this.on(e,t)};null===(t=this.instance)||void 0===t||t._addCaptureHook(e)}}register(e){var t,n;if(!Ii(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var i;const t=new Set;e.forEach((e=>{var n;null===(n=e.steps)||void 0===n||n.forEach((e=>{null!=e&&e.selector&&t.add(null==e?void 0:e.selector)}))})),null===(i=this.instance)||void 0===i||i.autocapture.setElementSelectors(t)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(const n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStep=(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t);checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event);checkStepUrl(e,t){if(null!=t&&t.url){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!i||"string"!=typeof i)return!1;if(!yh.matchString(i,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!Fn&&Pi(e,t);case"exact":return t===e;case"contains":const n=yh.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Pi(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if(null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text){if(!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!yh.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!yh.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!yh.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1}if(null!=t&&t.selector){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!i)return!1;if(!i.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class bh{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;Ii(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){const t=e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new yh(this.instance),this.actionMatcher.init();const e=e=>{this.onAction(e)};this.actionMatcher._addActionHook(e)}t.forEach((e=>{var t,n,i,r,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(i=n.actions)&&void 0!==i&&i.values&&(null===(r=e.conditions)||void 0===r||null===(o=r.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){const n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0===e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length)return;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,i;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i||i.forEach((t=>{if(t&&t.name){const n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}onEvent(e,t){var n,i;const r=(null===(n=this.instance)||void 0===n||null===(i=n.persistence)||void 0===i?void 0:i.props[ur])||[];if(bh.SURVEY_SHOWN_EVENT_NAME==e&&t&&r.length>0){var o;const e=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(e){const t=r.indexOf(e);t>=0&&(r.splice(t,1),this._updateActivatedSurveys(r))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n;const i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[ur])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[ur]:[...new Set(e)]})}getSurveys(){var e,t;const n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[ur];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}const wh="[Surveys]",Sh={icontains:e=>!!Fn&&Fn.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!Fn&&-1===Fn.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!Fn&&Pi(Fn.location.href,e),not_regex:e=>!!Fn&&!Pi(Fn.location.href,e),exact:e=>(null==Fn?void 0:Fn.location.href)===e,is_not:e=>(null==Fn?void 0:Fn.location.href)!==e};class Ch{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");const e=(()=>{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);null!=n&&n.startsWith(us)&&e.push(n)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){var e;const t=null==Gn||null===(e=Gn.__PosthogExtensions__)||void 0===e?void 0:e.generateSurveys;var n,i;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new bh(this.instance)),null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"surveys",(e=>{var t,n;if(e)return zn.error(wh,"Could not load surveys script",e);this._surveyManager=null===(t=Gn.__PosthogExtensions__)||void 0===t||null===(n=t.generateSurveys)||void 0===n?void 0:n.call(t,this.instance)})))}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new bh(this.instance));const n=this.instance.get_property(cr);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{var n;if(200!==t.statusCode||!t.json)return e([]);const i=t.json.surveys||[],r=i.filter((e=>{var t,n,i,r,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));var o;r.length>0&&(null===(o=this._surveyEventReceiver)||void 0===o||o.register(r));return null===(n=this.instance.persistence)||void 0===n||n.register({[cr]:i}),e(i)}})}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n;const i=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t,n,i,r;if(!e.conditions)return!0;const o=null===(t=e.conditions)||void 0===t||!t.url||Sh[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(r=e.conditions)||void 0===r||!r.selector||(null==Bn?void 0:Bn.querySelector(e.conditions.selector));return o&&s})),r=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),o=i.filter((e=>{var t,n,i,o,s,a,l,c,u,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;const h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(o=e.conditions)||void 0===o||null===(s=o.events)||void 0===s?void 0:s.values.length)>0,f=(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.values.length)>0,m=!g&&!f||(null==r?void 0:r.includes(e.id)),_=this._canActivateRepeatedly(e),v=!(e.internal_targeting_flag_key&&!_)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&p&&v&&m}));return e(o)}),t)}getNextSurveyStep(e,t,n){var i;const r=e.questions[t],o=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?ko.End:o;if(r.branching.type===ko.End)return ko.End;if(r.branching.type===ko.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===ko.ResponseBased){if(r.type===Io.SingleChoice){var s,a;const e=r.choices.indexOf(`${n}`);if(null!==(s=r.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===ko.End?ko.End:o}}else if(r.type===Io.Rating){var l,c;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,r.scale);if(null!==(l=r.branching)&&void 0!==l&&null!==(c=l.responseValues)&&void 0!==c&&c.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===ko.End?ko.End:o}}return o}return zn.warn(wh,"Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Ti(null===(t=Gn.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(zn.warn(wh,"canActivateRepeatedly is not defined, must init before calling"),!1):Gn.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Ti(this._surveyManager)?zn.warn(wh,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((t=>{const n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){Ti(this._surveyManager)?zn.warn(wh,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((n=>{const i=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(i,null==Bn?void 0:Bn.querySelector(t))}))}}class Ih{serverLimits={};lastEventRateLimited=!1;constructor(e){var t,n;this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const r=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(gr))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};o.tokens+=(r-o.last)/1e3*this.captureEventsPerSecond,o.last=r,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);const s=o.tokens<1;return s||i||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(gr,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}checkForLimiting=e=>{const t=e.text;if(t&&t.length)try{const e=JSON.parse(t);(e.quota_limited||[]).forEach((e=>{zn.info(`[RateLimiter] ${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void zn.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}}}const kh=()=>({initialPathName:(null==Hn?void 0:Hn.pathname)||"",referringDomain:zu.referringDomain(),...zu.campaignParams()});class Eh{constructor(e,t,n){this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=n||kh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[pr]}_onSessionIdCallback=e=>{const t=this._getStoredProps();if(t&&t.sessionId===e)return;const n={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[pr]:n})};getSessionProps(){var e;const t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}const xh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Th=function(e,t){if(!e)return!1;const n=e.toLowerCase();return xh.concat(t||[]).some((e=>{const t=e.toLowerCase();return-1!==n.indexOf(t)}))},Mh=function(e,t){if(!e)return!1;const n=e.userAgent;if(n&&Th(n,t))return!0;try{const n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>Th(null==e?void 0:e.brand,t))))return!0}catch{}return!!e.webdriver},Rh="[Dead Clicks]",Ah=()=>!0,Nh=e=>{var t;const n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(zi)),i=e.instance.config.capture_dead_clicks;return Ri(i)?i:n};class Fh{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}afterDecideResponse(e){this.instance.persistence&&this.instance.persistence.register({[zi]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,n,i;null!==(t=Gn.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"dead-clicks-autocapture",(t=>{t?zn.error(Rh+" failed to load script",t):e()}))}start(){var e;if(Bn){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=Gn.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){const e=Si(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Gn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this._lazyLoadedDeadClicksAutocapture.start(Bn),zn.info(`${Rh} starting...`)}}else zn.error(Rh+" `document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,zn.info(`${Rh} stopping...`))}}class Oh{rageclicks=new pc;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Zi]),null==Fn||Fn.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){let e=5e3;return Si(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ii(this.instance.config.capture_heatmaps)?Ii(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;zn.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}afterDecideResponse(e){const t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Zi]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){const e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){Fn&&Bn&&(ai(Bn,"click",(e=>this._onClick(e||(null==Fn?void 0:Fn.event))),!1,!0),ai(Bn,"mousemove",(e=>this._onMouseMove(e||(null==Fn?void 0:Fn.event))),!1,!0),this.deadClicksCapture=new Fh(this.instance,Ah,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){const n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),o=function(e,t,n){let i=e;for(;i&&Sr(i)&&!Cr(i,"body");){if(i===n)return!1;if(Qn(t,null==Fn?void 0:Fn.getComputedStyle(i).position))return!0;i=Fr(i)}return!1}(Ar(e),["fixed","sticky"],r);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:n),target_fixed:o,type:t}}_onClick(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(wr(e.target))return;const i=this._getProperties(e,n);null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture({...i,type:"rageclick"}),this._capture(i)}_onMouseMove(e){wr(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(!Fn)return;const t=Fn.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}flush(){this.buffer&&!Ci(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Lh{constructor(e){this.instance=e}getContext(){return this.context}resetContext(){const e=this.context;return setTimeout(this._updateScrollData,0),e}_updateScrollData=()=>{var e,t,n,i;this.context||(this.context={});const r=this.scrollElement(),o=this.scrollY(),s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=o+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(i=this.context.maxContentHeight)&&void 0!==i?i:0)};startMeasuringScrollPosition(){null==Fn||Fn.addEventListener("scroll",this._updateScrollData,!0),null==Fn||Fn.addEventListener("scrollend",this._updateScrollData,!0),null==Fn||Fn.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==Fn?void 0:Fn.document.documentElement;{const e=vi(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(const t of e){const e=null==Fn?void 0:Fn.document.querySelector(t);if(e)return e}}}scrollY(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollTop||0}return Fn&&(Fn.scrollY||Fn.pageYOffset||Fn.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollLeft||0}return Fn&&(Fn.scrollX||Fn.pageXOffset||Fn.document.documentElement.scrollLeft)||0}}class Ph{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(e){this.instance=e}_loadScript(e){var t,n,i;null!==(t=Gn.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"tracing-headers",(t=>{if(t)return zn.error("[TRACING-HEADERS] failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var e,t,n,i;Ii(this._restoreXHRPatch)&&(null===(e=Gn.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));Ii(this._restoreFetchPatch)&&(null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.tracingHeadersPatchFns)||void 0===i||i._patchFetch(this.instance.sessionManager))}}let Dh;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Dh||(Dh={}));class $h{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Dh.DENIED:this.storedConsent}isOptedOut(){return this.consent===Dh.DENIED||this.consent===Dh.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){const{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){const e=this.storage.get(this.storageKey);return"1"===e?Dh.GRANTED:"0"===e?Dh.DENIED:Dh.PENDING}get storage(){if(!this._storage){const e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Vc:qc;const t="localStorage"===e?qc:Vc;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!ci([null==$n?void 0:$n.doNotTrack,null==$n?void 0:$n.msDoNotTrack,Gn.doNotTrack],(e=>Qn([!0,1,"1","yes"],e)))}}const Bh="[Exception Autocapture]";class Hh{originalOnUnhandledRejectionHandler=void 0;constructor(e){var t;this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Gi]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==Fn||null===(e=Fn.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(zn.info(Bh+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=Gn.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return zn.error(Bh+" failed to load script",t);e()}))}startCapturing=()=>{var e,t,n,i;if(!Fn||!this.isEnabled||this.hasHandlers||this.isCapturing)return;const r=null===(e=Gn.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.errorWrappingFunctions)||void 0===i?void 0:i.wrapUnhandledRejection;if(r&&o)try{this.unwrapOnError=r(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){zn.error(Bh+" failed to start",e),this.stopCapturing()}else zn.error(Bh+" failed to load error wrapping functions - cannot start")};stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}afterDecideResponse(e){const t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Gi]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){const t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=`${t}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}}const qh=9e5,Wh="[Web Vitals]";class Vh{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Ui]),this.startIfEnabled()}get allowedMetrics(){var e,t;const n=Si(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return Ii(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ji])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Si(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){const e=Si(this.instance.config.capture_performance)&&Mi(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:qh;return 0<e&&e<=6e4?qh:e}get isEnabled(){const e=Si(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Ri(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(zn.info(Wh+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){const t=Si(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Si(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Ui]:t}),this.instance.persistence.register({[ji]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,i;null!==(t=Gn.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=Gn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"web-vitals",(t=>{t?zn.error(Wh+" failed to load script",t):e()}))}_currentURL(){const e=Fn?Fn.location.href:void 0;return e||zn.error(Wh+"Could not determine current URL"),e}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,t)=>({...e,[`$web_vitals_${t.name}_event`]:{...t},[`$web_vitals_${t.name}_value`]:t.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=e=>{var t;const n=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(Ii(n))return void zn.error(Wh+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};const i=this._currentURL();if(Ii(i))return;if(Ti(null==e?void 0:e.name)||Ti(null==e?void 0:e.value))return void zn.error(Wh+"Invalid metric received",e);if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)return void zn.error(Wh+"Ignoring metric with value >= "+this._maxAllowedValue,e);this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Ii(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=Ii(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...e,$current_url:i,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()};_startCapturing=()=>{let e,t,n,i;const r=Gn.__PosthogExtensions__;Ii(r)||Ii(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:i}=r.postHogWebVitalsCallbacks),e&&t&&n&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):zn.error(Wh+"web vitals callbacks not loaded - not starting")}}const Zh={icontains:(e,t)=>!!Fn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Fn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Fn&&Pi(t.href,e),not_regex:(e,t)=>!!Fn&&!Pi(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Gh{constructor(e){this.instance=e;const t=e=>{this.applyFeatureFlagChanges(e)};this.instance.onFeatureFlags&&this.instance.onFeatureFlags(t),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){Ti(this._flagToExperiments)||this.instance.config.disable_web_experiments||(Gh.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n;const t=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);t&&null!=i&&i.variants[t]&&this.applyTransforms(i.name,t,i.variants[t].transforms)}})))}afterDecideResponse(e){this._is_bot()?Gh.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){const e=Gh.getWindowLocation();if(null!=e&&e.search){const t=$i(null==e?void 0:e.search,"__experiment_id"),n=$i(null==e?void 0:e.search,"__experiment_variant");t&&n&&(Gh.logInfo(`previewing web experiments ${t} && ${n}`),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getWebExperiments((t=>{Gh.logInfo("retrieved web experiments from the server"),e._flagToExperiments=new Map,t.forEach((t=>{if(t.feature_flag_key&&e._featureFlags&&e._featureFlags[t.feature_flag_key]){var n;if(e._flagToExperiments)Gh.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(n=e._flagToExperiments)||void 0===n||n.set(t.feature_flag_key,t);const i=e._featureFlags[t.feature_flag_key];i&&t.variants[i]&&e.applyTransforms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(const n in t.variants){const i=t.variants[n];Gh.matchesTestVariant(i)&&e.applyTransforms(t.name,n,i.transforms)}}))}),t)}})();getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);const i=this.instance.get_property("$web_experiments");if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);const n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){const i=n.filter((t=>t.id===e));i&&i.length>0&&(Gh.logInfo(`Previewing web experiment [${i[0].name}] with variant [${t}]`),this.applyTransforms(i[0].name,t,i[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!Ti(e.conditions)&&(Gh.matchUrlConditions(e)&&Gh.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(Ti(e.conditions)||Ti(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;const n=Gh.getWindowLocation();if(n){var i,r,o;return null===(i=e.conditions)||void 0===i||!i.url||Zh[null!==(r=null===(o=e.conditions)||void 0===o?void 0:o.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,n)}return!1}static getWindowLocation(){return null==Fn?void 0:Fn.location}static matchUTMConditions(e){var t;if(Ti(e.conditions)||Ti(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;const n=zu.campaignParams();if(n.utm_source){var i,r,o,s,a,l,c,u,d,h,p,g,f,m,_,v;const t=null===(i=e.conditions)||void 0===i||null===(r=i.utm)||void 0===r||!r.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,y=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,b=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(g=p.utm)||void 0===g?void 0:g.utm_medium)==n.utm_medium,w=null===(f=e.conditions)||void 0===f||null===(m=f.utm)||void 0===m||!m.utm_term||(null===(_=e.conditions)||void 0===_||null===(v=_.utm)||void 0===v?void 0:v.utm_term)==n.utm_term;return t&&b&&w&&y}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];zn.info(`[WebExperiments] ${e}`,n)}applyTransforms(e,t,n,i){var r;this._is_bot()?Gh.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var r;Gh.logInfo(`applying transform of variant ${t} for experiment ${e} `,n);let s=0;const a=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);var o;if(null==a||a.forEach((e=>{const t=e;s+=1,n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})),this.instance&&this.instance.capture)this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:i,$web_experiment_document_url:null===(o=Gh.getWindowLocation())||void 0===o?void 0:o.href,$web_experiment_elements_modified:s})}})):(Gh.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:i,$web_experiment_variant:t,$web_experiment_document_url:null===(r=Gh.getWindowLocation())||void 0===r?void 0:r.href,$web_experiment_elements_modified:0}))}_is_bot(){return $n&&this.instance?Mh($n,this.instance.config.custom_blocked_useragents):void 0}}class Uh{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}const zh={},jh=()=>{},Yh="posthog";let Xh=!eh&&-1===(null==Zn?void 0:Zn.indexOf("MSIE"))&&-1===(null==Zn?void 0:Zn.indexOf("Mozilla"));const Jh=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:li(null==Bn?void 0:Bn.location),persistence:"localStorage+cookie",persistence_name:"",loaded:jh,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Hn&&ki(null==Hn?void 0:Hn.search)&&-1!==Hn.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Fn||null===(e=Fn.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{const t="Bad HTTP status: "+e.statusCode+" "+e.text;zn.error(t)},get_device_id:e=>e,_onCapture:jh,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},Kh=e=>{const t={};Ii(e.process_person)||(t.person_profiles=e.process_person),Ii(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ii(e.cookie_name)||(t.persistence_name=e.cookie_name),Ii(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);const n=Kn({},t,e);return vi(e.property_blacklist)&&(Ii(e.property_denylist)?n.property_denylist=e.property_blacklist:vi(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:zn.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Qh{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){zn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}__forceAllowLocalhost=!1}class ep{webPerformance=new Qh;version=Nn.LIB_VERSION;_internalEventEmitter=new vh;constructor(){this.config=Jh(),this.decideEndpointWasHit=!1,this.SentryIntegration=fh,this.sentryIntegration=e=>function(e,t){const n=gh(e,t);return{name:ph,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Tc(this),this.toolbar=new Kd(this),this.scrollManager=new Lh(this),this.pageViewManager=new _h(this),this.surveys=new Ch(this),this.experiments=new Gh(this),this.exceptions=new Uh(this),this.rateLimiter=new Ih(this),this.requestRouter=new hh(this),this.consent=new $h(this),this.people={set:(e,t,n)=>{const i=ki(e)?{[e]:t}:e;this.setPersonProperties(i),null==n||n({})},set_once:(e,t,n)=>{const i=ki(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==n||n({})}},this.on("eventCaptured",(e=>zn.info(`send "${null==e?void 0:e.event}"`,e)))}init(e,t,n){if(n&&n!==Yh){var i;const r=null!==(i=zh[n])&&void 0!==i?i:new ep;return r._init(e,t,n),zh[n]=r,zh[Yh][n]=r,r}return this._init(e,t,n)}_init(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(Ii(e)||Ei(e))return zn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return zn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(Kn({},Jh(),Kh(i),{name:r,token:e})),this.config.on_xhr_error&&zn.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:hi.GZipJS,this.persistence=new Yu(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yu({...this.config,persistence:"sessionStorage"});const o={...this.persistence.props},s={...this.sessionPersistence.props};if(this._requestQueue=new Qd((e=>this._send_retriable_request(e))),this._retryQueue=new lh(this),this.__request_queue=[],this.sessionManager=new ch(this.config,this.persistence),this.sessionPropsManager=new Eh(this.sessionManager,this.persistence),new Ph(this).startIfEnabledOrStop(),this.sessionRecording=new zd(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new vc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Oh(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Vh(this),this.exceptionObserver=new Hh(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Fh(this,Nh),this.deadClicksAutocapture.startIfEnabled(),Nn.DEBUG=Nn.DEBUG||this.config.debug,Nn.DEBUG&&zn.info("Starting in debug mode",{this:this,config:i,thisC:{...this.config},p:o,s:s}),this._sync_opt_out_with_persistence(),void 0!==(null===(t=i.bootstrap)||void 0===t?void 0:t.distinctID)){var a,l;const e=this.config.get_device_id(Lc()),t=null!==(a=i.bootstrap)&&void 0!==a&&a.isIdentifiedID?e:i.bootstrap.distinctID;this.persistence.set_property(hr,null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:t})}if(this._hasBootstrappedFeatureFlags()){var c,u;const e=Object.keys((null===(c=i.bootstrap)||void 0===c?void 0:c.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),t=Object.keys((null===(u=i.bootstrap)||void 0===u?void 0:u.featureFlagPayloads)||{}).filter((t=>e[t])).reduce(((e,t)=>{var n,r,o,s;null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:e,featureFlagPayloads:t})}if(!this.get_distinct_id()){const e=this.config.get_device_id(Lc());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(hr,"anonymous")}return null==Fn||null===(n=Fn.addEventListener)||void 0===n||n.call(Fn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),i.segment?mh(this,(()=>this._loaded())):this._loaded(),yi(this.config._onCapture)&&this.config._onCapture!==jh&&(zn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_afterDecideResponse(e){var t,n,i,r,o,s,a,l,c;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Qn(e.supportedCompression,hi.GZipJS)?hi.GZipJS:Qn(e.supportedCompression,hi.Base64)?hi.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(i=this.autocapture)||void 0===i||i.afterDecideResponse(e),null===(r=this.heatmaps)||void 0===r||r.afterDecideResponse(e),null===(o=this.experiments)||void 0===o||o.afterDecideResponse(e),null===(s=this.surveys)||void 0===s||s.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(l=this.exceptionObserver)||void 0===l||l.afterDecideResponse(e),null===(c=this.deadClicksAutocapture)||void 0===c||c.afterDecideResponse(e)}_loaded(){const e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){zn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),e||(new jd(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Xn(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Xh?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=nh(e.url,{ip:this.config.ip?1:0}),e.headers={...this.config.request_headers},e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var t,n,i;const r={...e};r.timeout=r.timeout||6e4,r.url=nh(r.url,{_:(new Date).getTime().toString(),ver:Nn.LIB_VERSION,compression:r.compression});const o=null!==(t=r.transport)&&void 0!==t?t:"XHR",s=null!==(n=null===(i=ci(ah,(e=>e.transport===o)))||void 0===i?void 0:i.method)&&void 0!==n?n:ah[0].method;if(!s)throw new Error("No available transport method");s(r)})({...e,callback:t=>{var n,i,r;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(r=this.config).on_request_error)||void 0===i||i.call(r,t));null===(n=e.callback)||void 0===n||n.call(e,t)}})))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){let t;const n=[],i=[],r=[];Xn(e,(e=>{e&&(t=e[0],vi(t)?r.push(e):yi(e)?e.call(this):vi(e)&&"alias"===t?n.push(e):vi(e)&&-1!==t.indexOf("capture")&&yi(this[t])?r.push(e):i.push(e))}));const o=function(e,t){Xn(e,(function(e){if(vi(e[0])){let n=t;Jn(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(i,this),o(r,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void zn.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(Ii(e)||!ki(e))return void zn.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;const r=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=r&&r.isRateLimited)return void zn.critical("This capture call is ignored due to client rate limiting.");this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();const o=new Date,s=(null==n?void 0:n.timestamp)||o;let a={uuid:Lc(),event:e,properties:this._calculate_event_properties(e,t||{},s)};r&&(a.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens);(null==n?void 0:n.$set)&&(a.$set=null==n?void 0:n.$set);const l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(a.$set_once=l),a=oi(a,null!=n&&n._noTruncate?null:this.config.properties_string_max_length),a.timestamp=s,Ii(null==n?void 0:n.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);const c={...a.properties.$set,...a.$set};if(Ci(c)||this.setPersonPropertiesForFlags(c),!Ti(this.config.before_send)){const e=this._runBeforeSend(a);if(!e)return;a=e}this._internalEventEmitter.emit("eventCaptured",a);const u={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(u):this._requestQueue.enqueue(u),a}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,t,n){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;const i=this.persistence.remove_event_timer(e);let r={...t};if(r.token=this.config.token,"$snapshot"===e){const e={...this.persistence.properties(),...this.sessionPersistence.properties()};return r.distinct_id=e.distinct_id,(!ki(r.distinct_id)&&!Mi(r.distinct_id)||Ei(r.distinct_id))&&zn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),r}const o=zu.properties();if(this.sessionManager){const{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId();r.$session_id=e,r.$window_id=t}if(this.requestRouter.region===uh.CUSTOM&&(r.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){const e=this.sessionPropsManager.getSessionProps();r=Kn(r,e)}if(!this.config.disable_scroll_properties){let t={};"$pageview"===e?t=this.pageViewManager.doPageView(n):"$pageleave"===e&&(t=this.pageViewManager.doPageLeave(n)),r=Kn(r,t)}if("$pageview"===e&&Bn&&(r.title=Bn.title),!Ii(i)){const e=n.getTime()-i;r.$duration=parseFloat((e/1e3).toFixed(3))}Zn&&this.config.opt_out_useragent_filter&&(r.$browser_type=this._is_bot()?"bot":"browser"),r=Kn({},o,this.persistence.properties(),this.sessionPersistence.properties(),r),r.$is_identified=this._isIdentified(),vi(this.config.property_denylist)?Jn(this.config.property_denylist,(function(e){delete r[e]})):zn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const s=this.config.sanitize_properties;s&&(r=s(r,e));const a=this._hasPersonProcessing();return r.$process_person_profile=a,a&&this._requirePersonProcessing("_calculate_event_properties"),r}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;let t=Kn({},this.persistence.get_initial_props(),e||{});const n=this.config.sanitize_properties;return n&&(t=n(t,"$set_once")),Ci(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var i;null===(i=this.persistence)||void 0===i||i.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){const t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return zn.uninitializedWarning("posthog.identify");if(Mi(e)&&(e=e.toString(),zn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!e)return void zn.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(e.toLowerCase()))return void zn.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;const i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){const e=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:e},"")}e!==i&&e!==this.get_property(qi)&&(this.unregister(qi),this.register({distinct_id:e}));const r="anonymous"===(this.persistence.get_property(hr)||"anonymous");e!==i&&r?(this.persistence.set_property(hr,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(dr))}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,n){if(!e||!t)return void zn.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;const i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:{...i,[e]:t}}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===t||n||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,i,r,o;if(zn.info("reset"),!this.__loaded)return zn.uninitializedWarning("posthog.reset");const s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(i=this.surveys)||void 0===i||i.reset(),null===(r=this.persistence)||void 0===r||r.set_property(hr,"anonymous"),null===(o=this.sessionManager)||void 0===o||o.resetSessionId();const a=this.config.get_device_id(Lc());this.register_once({distinct_id:a,$device_id:e?a:s},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let i=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if(null!=e&&e.withTimestamp&&n){var r;const t=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!n)return i;i+=`?t=${Math.max(Math.floor(((new Date).getTime()-n)/1e3)-t,0)}`}return i}alias(e,t){return e===this.get_property(Hi)?(zn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ii(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(qi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(zn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const t={...this.config};var n,i,r,o;Si(e)&&(Kn(this.config,Kh(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,t),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yu({...this.config,persistence:"sessionStorage"}),Vc.is_supported()&&"true"===Vc.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Nn.DEBUG=!0,zn.info("set_config",{config:e,oldConfig:t,newConfig:{...this.config}})),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){const t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var i,r,o,s,a;if(null===(i=this.sessionManager)||void 0===i||i.checkAndGetSessionAndWindowId(),n.sampling)null===(r=this.sessionRecording)||void 0===r||r.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,t){var n;const i=new Error("PostHog syntheticException"),r=yi(null===(n=Gn.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?Gn.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i}):{$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}],...t};this.exceptions.sendExceptionEvent(r)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e;let t=null!==(e=this.config.name)&&void 0!==e?e:Yh;return t!==Yh&&(t=Yh+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(hr))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(hr))}_hasPersonProcessing(){var e,t,n,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Ci(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[qi])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[vr]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(zn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(vr,!0),!0)}_sync_opt_out_with_persistence(){var e,t;const n=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default,r=this.config.disable_persistence||n&&!!i;var o,s;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==r&&(null===(o=this.persistence)||void 0===o||o.set_disabled(r));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==r&&(null===(s=this.sessionPersistence)||void 0===s||s.set_disabled(r))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),Ii(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return $n?Mh($n,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Bn&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Bn.title},{send_instantly:!0}))}debug(e){!1===e?(null==Fn||Fn.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Fn||Fn.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(Ti(this.config.before_send))return e;const t=vi(this.config.before_send)?this.config.before_send:[this.config.before_send];let n=e;for(const i of t){if(n=i(n),Ti(n)){const t=`Event '${e.event}' was rejected in beforeSend function`;return Fi(e.event)?zn.warn(`${t}. This can cause unexpected behavior.`):zn.info(t),null}n.properties&&!Ci(n.properties)||zn.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}return n}}!function(e,t){for(let n=0;n<t.length;n++)e.prototype[t[n]]=ni(e.prototype[t[n]])}(ep,["identify"]);!function(){const e=zh[Yh]=new ep,t=Gn.posthog;t&&Jn(t._i,(function(n){if(n&&vi(n)){const i=e.init(n[0],n[1],n[2]),r=t[n[2]]||t;i&&(i._execute_array.call(i.people,r.people),i._execute_array(r))}})),Gn.posthog=e,function(){function e(){e.done||(e.done=!0,Xh=!1,Jn(zh,(function(e){e._dom_loaded()})))}null!=Bn&&Bn.addEventListener&&("complete"===Bn.readyState?e():Bn.addEventListener("DOMContentLoaded",e,!1)),Fn&&ai(Fn,"load",e,!0)}()}()}();
|
|
1
|
+
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var s=e.apply(t,r);function a(e){n(s,i,o,a,l,"next",e)}function l(e){n(s,i,o,a,l,"throw",e)}a(void 0)}))}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s,a=["type"],l=Object.defineProperty,c=(e,t,n)=>((e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),u=Object.defineProperty,d=(e,t,n)=>((e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),h=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(h||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},g=e=>!!(e=>"function"==typeof e)(e)&&Object.getOwnPropertyNames(e.prototype||{}).some((e=>e.indexOf("__zone"))),f={};function m(e){if(f[e])return f[e];var t=globalThis[e],n=t.prototype,r=e in p?p[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in v?v[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!g(t))return f[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?f[e]=c:n}catch(e){return n}}var _={};function y(e,t,n){var r,i="".concat(e,".").concat(String(n));if(_[i])return _[i].call(t);var o=m(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(_[i]=s,s.call(t)):t[n]}var b={};function w(e,t,n){var r="".concat(e,".").concat(String(n));if(b[r])return b[r].bind(t);var i=m(e)[n];return"function"!=typeof i?t[n]:(b[r]=i,i.bind(t))}var S={childNodes:function(e){return y("Node",e,"childNodes")},parentNode:function(e){return y("Node",e,"parentNode")},parentElement:function(e){return y("Node",e,"parentElement")},textContent:function(e){return y("Node",e,"textContent")},contains:function(e,t){return w("Node",e,"contains")(t)},getRootNode:function(e){return w("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?y("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?y("Element",e,"shadowRoot"):null},querySelector:function(e,t){return y("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return y("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return m("MutationObserver").constructor}};function C(e){return e.nodeType===e.ELEMENT_NODE}function I(e){var t=e&&"host"in e&&"mode"in e&&S.host(e)||null;return Boolean(t&&"shadowRoot"in t&&S.shadowRoot(t)===e)}function k(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function E(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=Array.from(t,(t=>x(t,e.href))).join("");return(r=n).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(e){return null}var r}function x(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=E(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(t){n=e.cssText}return e.styleSheet.href?H(n,e.styleSheet.href):n}var r,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(r,"$1\\$2")),t?H(i,t):i}function T(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let M=class{constructor(){d(this,"idNodeMap",new Map),d(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){var 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){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function R(e){var{element:t,maskInputOptions:n,tagName:r,type:i,value:o,maskInputFn:s}=e,a=o||"",l=i&&A(i);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function A(e){return e.toLowerCase()}var N="__rrweb_original__";function F(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}function O(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==i?void 0:i[1])&&void 0!==n?n:null}var L=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?:[a-z+]+:)?\/\//i,D=/^www\..*/i,B=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(L,((e,n,r,i,o,s)=>{var a,l=r||o||s,c=n||i||"";if(!l)return e;if(P.test(l)||D.test(l))return"url(".concat(c).concat(l).concat(c,")");if(B.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");for(var h of(u.pop(),d))"."!==h&&(".."===h?u.pop():u.push(h));return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var q,W,$=1,V=new RegExp("[^a-z0-9-_:]"),Z=-2;function G(){return $++}var U=/^[^ \t\n\r\u000c]+/,j=/^[, \t\n\r\u000c]+/;var z=new WeakMap;function Y(e,t){return t&&""!==t.trim()?J(e,t):t}function X(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function J(e,t){var n=z.get(e);if(n||(n=e.createElement("a"),z.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function K(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?Y(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(j),!(n>=t.length);){var o=r(U);if(","===o.slice(-1))o=Y(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=Y(e,o);for(var a=!1;;){var l=t.charAt(n);if(""===l){i.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,i.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,n+=1}}}return i.join(", ")}(e,r):"style"===n?H(r,J(e)):"object"===t&&"data"===n?Y(e,r):r:Y(e,r):r}function Q(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function ee(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&ee(S.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&ee(S.parentNode(e),t,n)}function te(e,t,n,r){var i;if(C(e)){if(i=e,!S.childNodes(i).length)return!1}else{if(null===S.parentElement(e))return!1;i=S.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(ee(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function ne(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:h.Document,childNodes:[],compatMode:e.compatMode}:{type:h.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var n,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return V.test(t)?"div":t}(e),_={},y=e.attributes.length,b=0;b<y;b++){var w=e.attributes[b];Q(m,w.name,w.value)||(_[w.name]=K(r,m,A(w.name),w.value))}if("link"===m&&s){var C=e.href,I=T(r,C);if(!I&&C.includes(".css"))I=T(r,window.location.origin+"/"+C.replace(window.location.href,""));var k=null;I&&(k=E(I)),k&&(delete _.rel,delete _.href,_._cssText=k)}if("style"===m&&e.sheet&&!(e.innerText||S.textContent(e)||"").trim().length){var x=E(e.sheet);x&&(_._cssText=x)}if("input"===m||"textarea"===m||"select"===m){var M=e.value,O=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&M?_.value=R({element:e,type:F(e),tagName:m,value:M,maskInputOptions:a,maskInputFn:l}):O&&(_.checked=O)}"option"===m&&(e.selected&&!a.select?_.selected=!0:delete _.selected);"dialog"===m&&e.open&&(_.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=N in i?i[N]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var L=e.toDataURL(c.type,c.quality),P=r.createElement("canvas");P.width=e.width,P.height=e.height,L!==P.toDataURL(c.type,c.quality)&&(_.rr_dataURL=L)}if("img"===m&&u){q||(q=r.createElement("canvas"),W=q.getContext("2d"));var D=e,B=D.currentSrc||D.getAttribute("src")||"<unknown-src>",H=D.crossOrigin,$=()=>{D.removeEventListener("load",$);try{q.width=D.naturalWidth,q.height=D.naturalHeight,W.drawImage(D,0,0),_.rr_dataURL=q.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?$():D.addEventListener("load",$));console.warn("Cannot inline img src=".concat(B,"! Error: ").concat(e))}"anonymous"===D.crossOrigin&&(H?_.crossOrigin=H:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?$():D.addEventListener("load",$)}if("audio"===m||"video"===m){var Z=_;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(f){var{width:G,height:U}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(G,"px"),rr_height:"".concat(U,"px")}}"iframe"!==m||p(_.src)||(e.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(m)&&(n=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:_,childNodes:[],isSVG:X(e)||void 0,needBlock:f,rootId:g,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:m});case e.TEXT_NODE:return function(e,t){var n,{needsMask:r,maskTextFn:i,rootId:o}=t,s=S.parentNode(e),a=s&&s.tagName,l=S.textContent(e),c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(n=s.sheet)?void 0:n.cssRules)&&(l=E(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=H(l,J(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&r&&(l=i?i(l,S.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:c,rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:c,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:S.textContent(e)||"",rootId:m};default:return!1}}function re(e){return null==e?"":e.toLowerCase()}function ie(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=te(e,s,a,void 0===M));var A,N=ne(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===h.Comment)return!0;if(e.type===h.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"===O(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(re(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===re(e.attributes.name)||"icon"===re(e.attributes.rel)||"apple-touch-icon"===re(e.attributes.rel)||"shortcut icon"===re(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&re(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(re(e.attributes.property).match(/^(og|twitter|fb):/)||re(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===re(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===re(e.attributes.name)||"googlebot"===re(e.attributes.name)||"bingbot"===re(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===re(e.attributes.name)||"generator"===re(e.attributes.name)||"framework"===re(e.attributes.name)||"publisher"===re(e.attributes.name)||"progid"===re(e.attributes.name)||re(e.attributes.property).match(/^article:/)||re(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===re(e.attributes.name)||"yandex-verification"===re(e.attributes.name)||"csrf-token"===re(e.attributes.name)||"p:domain_verify"===re(e.attributes.name)||"verify-v1"===re(e.attributes.name)||"verification"===re(e.attributes.name)||"shopify-checkout-api-token"===re(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==h.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?G():Z;var F=Object.assign(N,{id:A});if(r.add(e,F),A===Z)return null;_&&_(e);var L=!l;if(F.type===h.Element){L=L&&!F.needBlock,delete F.needBlock;var P=S.shadowRoot(e);P&&k(P)&&(F.isShadowHost=!0)}if((F.type===h.Document||F.type===h.Element)&&L){v.headWhitespace&&F.type===h.Element&&"head"===F.tagName&&(R=!1);var D={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(F.type===h.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else for(var B of Array.from(S.childNodes(e))){var H=ie(B,D);H&&F.childNodes.push(H)}var q=null;if(C(e)&&(q=S.shadowRoot(e)))for(var W of Array.from(S.childNodes(q))){var $=ie(W,D);$&&(k(q)&&($.isShadow=!0),F.childNodes.push($))}}var V=S.parentNode(e);return V&&I(V)&&k(V)&&(F.isShadow=!0),F.type===h.Element&&"iframe"===F.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&y){var n=ie(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:x});n&&y(e,n)}}),b),F.type===h.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===O(F.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((()=>{i||(t(),i=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(w){var t=ie(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&w(e,t)}}),E),F}let oe=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var se={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ae={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},le={};function ce(e){if(le[e])return le[e];var t=globalThis[e],n=t.prototype,r=e in se?se[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in ae?ae[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!g(t))return le[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?le[e]=c:n}catch(e){return n}}var ue={};function de(e,t,n){var r,i="".concat(e,".").concat(String(n));if(ue[i])return ue[i].call(t);var o=ce(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(ue[i]=s,s.call(t)):t[n]}var he={};function pe(e,t,n){var r="".concat(e,".").concat(String(n));if(he[r])return he[r].bind(t);var i=ce(e)[n];return"function"!=typeof i?t[n]:(he[r]=i,i.bind(t))}function ve(){return ce("MutationObserver").constructor}var ge={childNodes:function(e){return de("Node",e,"childNodes")},parentNode:function(e){return de("Node",e,"parentNode")},parentElement:function(e){return de("Node",e,"parentElement")},textContent:function(e){return de("Node",e,"textContent")},contains:function(e,t){return pe("Node",e,"contains")(t)},getRootNode:function(e){return pe("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?de("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?de("Element",e,"shadowRoot"):null},querySelector:function(e,t){return de("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return de("Element",e,"querySelectorAll")(t)},mutationObserver:ve};function fe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var me="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.",_e={map:{},getId:()=>(console.error(me),-1),getNode:()=>(console.error(me),null),removeNodeFromMap(){console.error(me)},has:()=>(console.error(me),!1),reset(){console.error(me)}};function ye(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function be(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>be(e,t,o||{},!0)}function we(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get:(e,t,n)=>("map"===t&&console.error(me),Reflect.get(e,t,n))}));var Se=Date.now;function Ce(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ge.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=ge.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ie(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ke(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ee(e){return e?e.nodeType===e.ELEMENT_NODE?e:ge.parentElement(e):null}function xe(e,t,n,r){if(!e)return!1;var i=Ee(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(ee(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function Te(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Z}function Me(e,t){if(I(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=ge.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Me(r,t))}function Re(e){return Boolean(e.changedTouches)}function Ae(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ne(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Fe(e){return!!e&&(e instanceof oe&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ge.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Se=()=>(new Date).getTime());let Oe=class{constructor(){c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(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){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}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 Le(e){var t,n=null;return"getRootNode"in e&&(null==(t=ge.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ge.host(ge.getRootNode(e))&&(n=ge.host(ge.getRootNode(e))),n}function Pe(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=Le(n);)n=t;return n}(e);return ge.contains(t,n)}function De(e){var t=e.ownerDocument;return!!t&&(ge.contains(t,e)||Pe(e))}var Be=(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))(Be||{}),He=(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))(He||{}),qe=(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))(qe||{}),We=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(We||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),Ve=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ve||{});function Ze(e){return"__ln"in e}class Ge{constructor(){c(this,"length",0),c(this,"head",null),c(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ze(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ze(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ue,je=(e,t)=>"".concat(e,"@").concat(t);class ze{constructor(){c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),c(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,n=new Ge,r=e=>{for(var t=e,n=Z;n===Z;)n=(t=t&&t.nextSibling)&&this.mirror.getId(t);return n},i=i=>{var o=ge.parentNode(i);if(o&&De(i)&&"TEXTAREA"!==o.tagName){var s=I(o)?this.mirror.getId(Le(i)):this.mirror.getId(o),a=r(i);if(-1===s||-1===a)return n.addNode(i);var l=ie(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=>{Ae(e,this.mirror)&&this.iframeManager.addIframe(e),Ne(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fe(i)&&this.shadowDomManager.addShadowRoot(ge.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Xe(this.removes,o,this.mirror)&&!this.movedSet.has(ge.parentNode(o))||i(o);for(var s of this.addedSet)Je(this.droppedSet,s)||Xe(this.removes,s,this.mirror)?Je(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;n.length;){var l=null;if(a){var c=this.mirror.getId(ge.parentNode(a.value)),u=r(a.value);-1!==c&&-1!==u&&(l=a)}if(!l)for(var d=n.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(ge.parentNode(h.value));if(-1===r(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=ge.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=ge.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}a=l.previous,n.removeNode(l.value),i(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,n=ge.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{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=>{var{attributes:t}=e;if("string"==typeof t.style){var n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).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};(m.texts.length||m.attributes.length||m.removes.length||m.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(m))}})),c(this,"genTextAreaValueMutation",(e=>{var 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(ge.childNodes(e),(e=>ge.textContent(e)||"")).join("")})),c(this,"processMutation",(e=>{if(!Te(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ge.textContent(e.target);xe(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:te(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ee(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var n=e.target,r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){var o=F(n);i=R({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(xe(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Q(n.tagName,r))if(s.attributes[r]=K(this.doc,A(n.tagName),A(r),i),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(n.style))){var c=n.style.getPropertyValue(l),u=n.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===u?c:[c,u]:s._unchangedStyles[l]=[c,u]}for(var d of Array.from(a.style))""===n.style.getPropertyValue(d)&&(s.styleDiff[d]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(xe(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=>{var n=this.mirror.getId(t),r=I(e.target)?this.mirror.getId(ge.host(e.target)):this.mirror.getId(e.target);xe(e.target,this.blockClass,this.blockSelector,!1)||Te(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ye(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Me(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[je(n,r)]?Ye(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!I(e.target)||!k(e.target))||void 0})),this.mapRemoves.push(t))}))}})),c(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Te(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[je(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xe(e,this.blockClass,this.blockSelector,!1)||(ge.childNodes(e).forEach((e=>this.genAdds(e))),Fe(e)&&ge.childNodes(ge.shadowRoot(e)).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 Ye(e,t){e.delete(t),ge.childNodes(t).forEach((t=>Ye(e,t)))}function Xe(e,t,n){return 0!==e.length&&function(e,t,n){var r=ge.parentNode(t),i=function(){var t=n.getId(r);if(e.some((e=>e.id===t)))return{v:!0};r=ge.parentNode(r)};for(;r;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,n)}function Je(e,t){return 0!==e.size&&Ke(e,t)}function Ke(e,t){var n=ge.parentNode(t);return!!n&&(!!e.has(n)||Ke(e,n))}var Qe=e=>{if(!Ue)return e;return function(){try{return e(...arguments)}catch(e){if(Ue&&!0===Ue(e))return;throw e}}},et=[];function tt(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function nt(e,t){var n=new ze;et.push(n),n.init(e);var r=new(ve())(Qe(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function rt(e){var{mouseInteractionCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(qe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=A(e),l=(e=>r=>{var a=tt(r);if(!xe(a,o,s,!0)){var l=null,c=e;if("pointerType"in r){switch(r.pointerType){case"mouse":l=We.Mouse;break;case"touch":l=We.Touch;break;case"pen":l=We.Pen}l===We.Touch?qe[e]===qe.MouseDown?c="TouchStart":qe[e]===qe.MouseUp&&(c="TouchEnd"):We.Pen}else Re(r)&&(l=We.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===We.Touch||c.startsWith("Mouse")&&l===We.Mouse)&&(l=null)):qe[e]===qe.Click&&(l=u,u=null);var d=Re(r)?r.changedTouches[0]:r;if(d){var h=i.getId(a),{clientX:p,clientY:v}=d;Qe(n)(t({type:qe[c],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(qe[e]){case qe.MouseDown:case qe.MouseUp:a=a.replace("mouse","pointer");break;case qe.TouchStart:case qe.TouchEnd:return}c.push(fe(a,l,r))})),Qe((()=>{c.forEach((e=>e()))}))}function it(e){var{scrollCb:t,doc:n,mirror:r,blockClass:i,blockSelector:o,sampling:s}=e;return fe("scroll",Qe(ye(Qe((e=>{var s=tt(e);if(s&&!xe(s,i,o,!0)){var a=r.getId(s);if(s===n&&n.defaultView){var l=Ce(n.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),n)}var ot=["INPUT","TEXTAREA","SELECT"],st=new WeakMap;function at(e){return function(e,t){if(dt("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||dt("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||dt("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||dt("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function lt(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function ct(e,t){var n,r,i,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ge.host(t));var l="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t,n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return n}}),Qe((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ut(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,r),e.recordDOM&&(n=nt(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:n,doc:r,mirror:i}=e;if(!1===n.mousemove)return()=>{};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,l=[],c=ye(Qe((e=>{var n=Date.now()-o;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],o=null})),a),u=Qe(ye(Qe((e=>{var t=tt(e),{clientX:n,clientY:r}=Re(e)?e.changedTouches[0]:e;o||(o=Se()),l.push({x:n,y:r,id:i.getId(t),timeOffset:Se()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?He.Drag:e instanceof MouseEvent?He.MouseMove:He.TouchMove)})),s,{trailing:!1})),d=[fe("mousemove",u,r),fe("touchmove",u,r),fe("drag",u,r)];return Qe((()=>{d.forEach((e=>e()))}))}(e),s=rt(e),a=it(e),l=function(e,t){var{viewportResizeCb:n}=e,{win:r}=t,i=-1,o=-1;return fe("resize",Qe(ye(Qe((()=>{var e=Ie(),t=ke();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:i}),c=function(e){var{inputCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=tt(e),n=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=ge.parentElement(t)),t&&i&&!(ot.indexOf(i)<0)&&!xe(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=F(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(c[i.toLowerCase()]||c[g])&&(d=R({element:t,maskInputOptions:c,tagName:i,type:g,value:d,maskInputFn:u})),v(t,h?{text:d,isChecked:p,userTriggered:n}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((e=>{if(e!==t){var n=e.value;v(e,h?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}}))}}function v(e,r){var o=st.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){st.set(e,r);var s=i.getId(e);Qe(n)(t(t({},r),{},{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>fe(e,Qe(p),r))),f=r.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>be(e[0],e[1],{set(){Qe(p)({target:this,isTrusted:!1})}},!1,f)))),Qe((()=>{g.forEach((e=>e()))}))}(e),u=function(e){var{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:i,sampling:o,doc:s}=e,a=Qe((e=>ye(Qe((o=>{var s=tt(o);if(s&&!xe(s,n,r,!0)){var{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:i.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}})),o.media||500))),l=[fe("play",a(Ve.Play),s),fe("pause",a(Ve.Pause),s),fe("seeked",a(Ve.Seeked),s),fe("volumechange",a(Ve.VolumeChange),s),fe("ratechange",a(Ve.RateChange),s)];return Qe((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:n,mirror:r,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Qe(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=lt(t,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,r="".concat(e," { ").concat(t," }");return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var a,l,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Qe(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=lt(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Qe(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=lt(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Qe(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=lt(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var u={};ht("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(ht("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),ht("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),ht("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Qe(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=lt(t.parentStyleSheet,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...at(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Qe(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=lt(t.parentStyleSheet,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...at(t),s]}]}),e.apply(t,o)}))})})),Qe((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=c,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((e=>{var[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=ct(e,e.doc),p=function(e,t){var{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Qe(((e,t,s)=>{var l,[c,u,d]=s;if(i.has(c))return a.apply(t,[c,u,d]);var{id:h,styleId:p}=lt(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:at(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Qe(((e,t,s)=>{var a,[c]=s;if(i.has(c))return l.apply(t,[c]);var{id:u,styleId:d}=lt(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:at(t.parentRule)}),e.apply(t,s)}))}),Qe((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:n}=e,r=n.defaultView;if(!r)return()=>{};var i=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){var r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var a=we(n.fonts,"add",(function(e){return function(n){return setTimeout(Qe((()=>{var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((()=>{r.FontFace=s})),i.push(a),Qe((()=>{i.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=Qe((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=u;xe(d,r,i,!0)||xe(p,r,i,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(p),endOffset:v})}o({ranges:a})}}));return a(),fe("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:n}=e,r=t.defaultView;if(!r||!r.customElements)return()=>{};var i=we(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,i])}}));return i}(e),m=[];for(var _ of e.plugins)m.push(_.observer(_.callback,i,_.options));return Qe((()=>{et.forEach((e=>e.reset())),null==n||n.disconnect(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),g(),f(),m.forEach((e=>e()))}))}function dt(e){return void 0!==window[e]}function ht(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class pt{constructor(e){c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){var n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}getRemoteIds(e,t){var n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class vt{constructor(e){c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new pt(G)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pt(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||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){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Be.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Be.IncrementalSnapshot,data:{source:He.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Be.Meta:case Be.Load:case Be.DomContentLoaded:return!1;case Be.Plugin:return t;case Be.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Be.IncrementalSnapshot:switch(t.data.source){case He.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 He.Drag:case He.TouchMove:case He.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case He.ViewportResize:return!1;case He.MediaInteraction:case He.MouseInteraction:case He.Scroll:case He.CanvasMutation:case He.Input:return this.replaceIds(t.data,e,["id"]),t;case He.StyleSheetRule:case He.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case He.Font:return t;case He.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case He.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(var i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class gt{constructor(e){c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(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,n){if(k(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=nt(t(t({},this.bypassOptions),{},{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(it(t(t({},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(ge.host(e))),this.restoreHandlers.push(ct({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){var n=this;this.restoreHandlers.push(we(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r),o=ge.shadowRoot(this);return o&&De(this)&&n.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_t=0;_t<64;_t++)mt[ft.charCodeAt(_t)]=_t;var yt=new Map;var bt=(e,t,n)=>{if(e&&(Ct(e,t)||"object"==typeof e)){var r=function(e,t){var n=yt.get(e);return n||(n=new Map,yt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function wt(e,t,n){if(e instanceof Array)return e.map((e=>wt(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=ft[n[t]>>2],i+=ft[(3&n[t])<<4|n[t+1]>>4],i+=ft[(15&n[t+1])<<2|n[t+2]>>6],i+=ft[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[wt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[wt(e.data,t,n),e.width,e.height]}:Ct(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:bt(e,t,n)}:e}var St=(e,t,n)=>e.map((e=>wt(e,t,n))),Ct=(e,t)=>{var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function It(e,t,n,r){var i=[];try{var o=we(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!xe(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function kt(e,t,n,r,i,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=we(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=e.apply(this,l);if(bt(u,o,this),"tagName"in this.canvas&&!xe(this.canvas,r,i,!0)){var d=St(l,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}}));s.push(l)}catch(r){var c=be(e,a,{set(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(c)}};for(var c of a)l(c);return s}var Et,xt,Tt,Mt,Rt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",At="undefined"!=typeof window&&window.Blob&&new Blob([(Et=Rt,Uint8Array.from(atob(Et),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Nt(e){var t;try{if(!(t=At&&(window.URL||window.webkitURL).createObjectURL(At)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Rt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Ft{constructor(e){c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(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)}));var{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,i,o){var s=this,a=It(t,n,i,!0),l=new Map,c=new Nt;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})}};var u,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?u=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{xe(e,n,i,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(t.document),a).forEach(function(){var e=r((function*(e){var t,n=s.mirror.getId(e);if(!l.get(n)&&0!==e.width&&0!==e.height){if(l.set(n,!0),["webgl","webgl2"].includes(e.__context)){var r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,a=e.clientHeight||e.height,u=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:a});c.postMessage({id:n,bitmap:u,width:i,height:a,dataURLOptions:o.dataURLOptions},[u])}}));return function(t){return e.apply(this,arguments)}}()),u=requestAnimationFrame(p))};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=It(e,t,n,!1),i=function(e,t,n,r){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var s=we(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return xe(this.canvas,n,r,!0)||setTimeout((()=>{var n=St(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:n})}),0),i.apply(this,a)}}));i.push(s)}catch(n){var a=be(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){var i=[];return i.push(...kt(t.WebGLRenderingContext.prototype,$e.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...kt(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,n,r,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((e=>o(e,a))),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}class Ot{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Oe),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){var n=this;if(0!==e.length){var r={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,n)=>({rule:x(t,e.href),index:n})))})),r.styleIds.push(t)};for(var s of e)o(s);i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Lt{constructor(){c(this,"nodeMap",new WeakMap),c(this,"active",!1)}inOtherBuffer(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Dt=document.createElement("iframe");document.body.appendChild(Dt),Array.from=(null==(s=Dt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(Dt)}}catch(e){console.debug("Unable to override Array.from",e)}var Bt,Ht,qt=new M;function Wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emit:n,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:T=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=e;Ue=F;var O=!I||window.parent===window,L=!1;if(!O)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(O&&!n)throw new Error("emit function is required");if(!O&&!L)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),qt.reset();var P,D=!0===h?{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!==p?p:{password:!0},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}();var H=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!L&&(e=_(e)),e};xt=(e,t)=>{var o,s=e;if(s.timestamp=Se(),!(null==(o=et[0])?void 0:o.isFrozen())||s.type===Be.FullSnapshot||s.type===Be.IncrementalSnapshot&&s.data.source===He.Mutation||et.forEach((e=>e.unfreeze())),O)null==n||n(q(s),t);else if(L){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(s.type===Be.FullSnapshot)P=s,H=0;else if(s.type===Be.IncrementalSnapshot){if(s.data.source===He.Mutation&&s.data.isAttachIframe)return;H++;var l=i&&H>=i,c=r&&s.timestamp-P.timestamp>r;(l||c)&&Tt(!0)}};var W=e=>{xt({type:Be.IncrementalSnapshot,data:t({source:He.Mutation},e)})},$=e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.Scroll},e)}),V=e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.CanvasMutation},e)}),Z=new Ot({mutationCb:W,adoptedStyleSheetCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.AdoptedStyleSheet},e)})}),G=new vt({mirror:qt,mutationCb:W,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:xt});for(var U of R||[])U.getMirror&&U.getMirror({nodeMirror:qt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var j=new Lt;Mt=new Ft({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:qt,sampling:y.canvas,dataURLOptions:b});var z=new gt({mutationCb:W,scrollCb:$,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:T,sampling:y,slimDOMOptions:B,iframeManager:G,stylesheetManager:Z,canvasManager:Mt,keepIframeSrcFn:A,processedNodeManager:j},mirror:qt});Tt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S){xt({type:Be.Meta,data:{href:window.location.href,width:ke(),height:Ie()}},e),Z.reset(),z.init(),et.forEach((e=>e.lock()));var t=function(e,t){var{mirror:n=new M,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return ie(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:qt,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:T,onSerialize:e=>{Ae(e,qt)&&G.addIframe(e),Ne(e,qt)&&Z.trackLinkElement(e),Fe(e)&&z.addShadowRoot(ge.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");xt({type:Be.FullSnapshot,data:{node:t,initialOffset:Ce(window)}},e),et.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,qt.getId(document))}};try{var Y=[],X=e=>{var n;return Qe(ut)({mutationCb:W,mousemoveCb:(e,t)=>xt({type:Be.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.MouseInteraction},e)}),scrollCb:$,viewportResizeCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.ViewportResize},e)}),inputCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.Input},e)}),mediaInteractionCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.MediaInteraction},e)}),styleSheetRuleCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.StyleSheetRule},e)}),styleDeclarationCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>xt({type:Be.IncrementalSnapshot,data:t({source:He.Font},e)}),selectionCb:e=>{xt({type:Be.IncrementalSnapshot,data:t({source:He.Selection},e)})},customElementCb:e=>{xt({type:Be.IncrementalSnapshot,data:t({source:He.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:T,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:B,dataURLOptions:b,mirror:qt,iframeManager:G,stylesheetManager:Z,shadowDomManager:z,processedNodeManager:j,canvasManager:Mt,ignoreCSSAttributes:N,plugins:(null==(n=null==R?void 0:R.filter((e=>e.observer)))?void 0:n.map((e=>({observer:e.observer,options:e.options,callback:t=>xt({type:Be.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{Tt(),Y.push(X(document)),Pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(Y.push(fe("DOMContentLoaded",(()=>{xt({type:Be.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),Y.push(fe("load",(()=>{xt({type:Be.Load,data:{}}),"load"===k&&J()}),window))),()=>{Y.forEach((e=>e())),j.destroy(),Pt=!1,Ue=void 0}}catch(e){console.warn(e)}}Wt.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");xt({type:Be.Custom,data:{tag:e,payload:t}})},Wt.freezePage=()=>{et.forEach((e=>e.freeze()))},Wt.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");Tt(e)},Wt.mirror=qt,(Ht=Bt||(Bt={}))[Ht.NotStarted=0]="NotStarted",Ht[Ht.Running=1]="Running",Ht[Ht.Stopped=2]="Stopped";var $t,Vt=Object.defineProperty,Zt=(e,t,n)=>((e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Gt=Object.defineProperty,Ut=(e,t,n)=>((e,t,n)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),jt=Object.defineProperty,zt=(e,t,n)=>((e,t,n)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Yt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jt={};function Kt(e){if(Jt[e])return Jt[e];var t=globalThis[e],n=t.prototype,r=e in Yt?Yt[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in Xt?Xt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return Jt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?Jt[e]=c:n}catch(e){return n}}var Qt={};function en(e,t,n){var r,i="".concat(e,".").concat(String(n));if(Qt[i])return Qt[i].call(t);var o=Kt(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Qt[i]=s,s.call(t)):t[n]}var tn={};function nn(e,t,n){var r="".concat(e,".").concat(String(n));if(tn[r])return tn[r].bind(t);var i=Kt(e)[n];return"function"!=typeof i?t[n]:(tn[r]=i,i.bind(t))}var rn={childNodes:function(e){return en("Node",e,"childNodes")},parentNode:function(e){return en("Node",e,"parentNode")},parentElement:function(e){return en("Node",e,"parentElement")},textContent:function(e){return en("Node",e,"textContent")},contains:function(e,t){return nn("Node",e,"contains")(t)},getRootNode:function(e){return nn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?en("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?en("Element",e,"shadowRoot"):null},querySelector:function(e,t){return en("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return en("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Kt("MutationObserver").constructor}};class on{constructor(){zt(this,"idNodeMap",new Map),zt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){var 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){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function sn(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&sn(rn.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&sn(rn.parentNode(e),t,n)}class an{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof an))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var ln={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},un={};function dn(e){if(un[e])return un[e];var t=globalThis[e],n=t.prototype,r=e in ln?ln[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in cn?cn[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return un[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?un[e]=c:n}catch(e){return n}}var hn={};function pn(e,t,n){var r,i="".concat(e,".").concat(String(n));if(hn[i])return hn[i].call(t);var o=dn(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(hn[i]=s,s.call(t)):t[n]}var vn={};function gn(e,t,n){var r="".concat(e,".").concat(String(n));if(vn[r])return vn[r].bind(t);var i=dn(e)[n];return"function"!=typeof i?t[n]:(vn[r]=i,i.bind(t))}var fn={childNodes:function(e){return pn("Node",e,"childNodes")},parentNode:function(e){return pn("Node",e,"parentNode")},parentElement:function(e){return pn("Node",e,"parentElement")},textContent:function(e){return pn("Node",e,"textContent")},contains:function(e,t){return gn("Node",e,"contains")(t)},getRootNode:function(e){return gn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?pn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?pn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return pn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return pn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return dn("MutationObserver").constructor}};var mn="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.",_n={map:{},getId:()=>(console.error(mn),-1),getNode:()=>(console.error(mn),null),removeNodeFromMap(){console.error(mn)},has:()=>(console.error(mn),!1),reset(){console.error(mn)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_n=new Proxy(_n,{get:(e,t,n)=>("map"===t&&console.error(mn),Reflect.get(e,t,n))}));var yn=Date.now;function bn(e){return e?e.nodeType===e.ELEMENT_NODE?e:fn.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(yn=()=>(new Date).getTime());function wn(e){var t,n=null;return"getRootNode"in e&&(null==(t=fn.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fn.host(fn.getRootNode(e))&&(n=fn.host(fn.getRootNode(e))),n}function Sn(e){for(var t,n=e;t=wn(n);)n=t;return n}function Cn(e){var t=e.ownerDocument;if(!t)return!1;var n=Sn(e);return fn.contains(t,n)}for(var In=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ut(this,"id",1),Ut(this,"styleIDMap",new WeakMap),Ut(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){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return _n},closestElementOfNode:bn,getBaseDimension:function e(t,n){var r,i,o=null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,n),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){var r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){var t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:Sn,getShadowHost:wn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=fn.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=fn.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof an&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fn.shadowRoot(e)))},hookSetter:function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(fn.contains(t,e)||Cn(e))},isAncestorRemoved:function e(t,n){if(i=(r=t)&&"host"in r&&"mode"in r&&rn.host(r)||null,Boolean(i&&"shadowRoot"in i&&rn.shadowRoot(i)===r))return!1;var r,i,o=n.getId(t);if(!n.has(o))return!0;var s=fn.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,n))},isBlocked:function(e,t,n,r){if(!e)return!1;var i=bn(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(sn(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(var r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return yn},on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}},polyfill:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)},queueToResolveTrees:function(e){var t={},n=(e,n)=>{var r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(var i of e){var{nextId:o,parentId:s}=i;if(o&&o in t){var a=t[o];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,n(i,a.parent))}else{var c=r.indexOf(a);r.splice(c,0,n(i,null))}}else if(s in t){var u=t[s];u.children.push(n(i,u))}else r.push(n(i,null))}return r},shadowHostInDom:Cn,throttle:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){for(var t=new Set,n=[],r=e.length;r--;){var i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}},Symbol.toStringTag,{value:"Module"})),kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",En="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xn=0;xn<64;xn++)En[kn.charCodeAt(xn)]=xn;var Tn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Mn=document.createElement("iframe");document.body.appendChild(Mn),Array.from=(null==($t=Mn.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(Mn)}}catch(e){console.debug("Unable to override Array.from",e)}new on,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Tn||(Tn={}));class Rn{constructor(e){Zt(this,"fileName"),Zt(this,"functionName"),Zt(this,"lineNumber"),Zt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}var An=/(^|@)\S+:\d+/,Nn=/^\s*at .*(\S+:\d+|\(native\))/m,Fn=/^(eval@)?(\[native code])?$/,On={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Nn)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Nn)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Rn({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Fn)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Rn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Rn({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Rn({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Rn({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(An)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Rn({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Ln(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var s=r.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&i.push(s)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Pn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Dn(e,t){if(0===t)return!0;var n=Object.keys(e);for(var r of n)if(Pn(e[r])&&Dn(e[r],t-1))return!0;return!1}function Bn(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Pn(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pn(e)&&Dn(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var a in t){var l=t[a];Array.isArray(l)?s[a]=Ln(l.length?l[0]:null):s[a]=l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Hn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function qn(e,t,n){var r,i=n?Object.assign({},Hn,n):Hn,o=i.logger;if(!o)return()=>{};r="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(i.level.includes("error")){var c=t=>{var n=t.message,r=t.error,o=On.parse(r).map((e=>e.toString())),s=[Bn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",c),l.push((()=>{t.removeEventListener("error",c)}));var u=t=>{var n,r;t.reason instanceof Error?(n=t.reason,r=[Bn("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Bn("Uncaught (in promise)",i.stringifyOptions),Bn(t.reason,i.stringifyOptions)]);var o=On.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",u),l.push((()=>{t.removeEventListener("unhandledrejection",u)}))}for(var d of i.level)l.push(h(r,d));return()=>{l.forEach((e=>e()))};function h(t,n){var r=this;return t[n]?In.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{var u=On.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===n?l.slice(1):l).map((e=>Bn(e,i.stringifyOptions)));++s<i.lengthThreshold?e({level:n,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Bn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Wn=e=>({name:"rrweb/console@1",observer:qn,options:e}),$n={DEBUG:!1,LIB_VERSION:"1.187.2"},Vn="undefined"!=typeof window?window:void 0,Zn="undefined"!=typeof globalThis?globalThis:Vn,Gn=Array.prototype,Un=Gn.forEach,jn=Gn.indexOf,zn=null==Zn?void 0:Zn.navigator,Yn=null==Zn?void 0:Zn.document,Xn=null==Zn?void 0:Zn.location,Jn=null==Zn?void 0:Zn.fetch,Kn=null!=Zn&&Zn.XMLHttpRequest&&"withCredentials"in new Zn.XMLHttpRequest?Zn.XMLHttpRequest:void 0,Qn=null==Zn?void 0:Zn.AbortController,er=null==zn?void 0:zn.userAgent,tr=null!=Vn?Vn:{},nr="[PostHog.js]",rr={_log:function(e){if(Vn&&($n.DEBUG||tr.POSTHOG_DEBUG)&&!Fr(Vn.console)&&Vn.console){for(var t=("__rrweb_original__"in Vn.console[e]?Vn.console[e].__rrweb_original__:Vn.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t(nr,...r)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];rr._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];rr._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];rr._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(nr,...t)},uninitializedWarning:e=>{rr.error("You must initialize PostHog before calling ".concat(e))}},ir={},or=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function sr(e,t,n){if(xr(e))if(Un&&e.forEach===Un)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===ir)return}function ar(e,t,n){if(!Dr(e)){if(xr(e))return sr(e,t,n);if(Wr(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===ir)return}else for(var i in e)if(kr.call(e,i)&&t.call(n,e[i],i)===ir)return}}var lr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return sr(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function cr(e,t){return-1!==e.indexOf(t)}function ur(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var dr=function(e){try{return e()}catch(e){return}},hr=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){rr.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),rr.critical(e)}}},pr=function(e){var t={};return ar(e,(function(e,n){Or(e)&&e.length>0&&(t[n]=e)})),t},vr=function(e){return e.replace(/^\$/,"")};function gr(e,t){return n=e,r=e=>Or(e)&&!Pr(t)?e.slice(0,t):e,i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),xr(t)?(o=[],sr(t,(t=>{o.push(e(t))}))):(o={},ar(t,((t,n)=>{i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var fr=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++: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),Pr(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},mr=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(null==Vn?void 0:Vn.event)){var o,s=!0;Tr(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else rr.error("No valid element provided to register_event")}}();function _r(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var yr,br="$copy_autocapture",wr=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(yr||(yr={}));var Sr=["fatal","error","warning","log","info","debug"],Cr=Array.isArray,Ir=Object.prototype,kr=Ir.hasOwnProperty,Er=Ir.toString,xr=Cr||function(e){return"[object Array]"===Er.call(e)},Tr=e=>"function"==typeof e,Mr=e=>Tr(e)&&-1!==e.toString().indexOf("[native code]"),Rr=e=>!!Tr(e)&&Object.getOwnPropertyNames(e.prototype||{}).some((e=>e.indexOf("__zone"))),Ar=e=>e===Object(e)&&!xr(e),Nr=e=>{if(Ar(e)){for(var t in e)if(kr.call(e,t))return!1;return!0}return!1},Fr=e=>void 0===e,Or=e=>"[object String]"==Er.call(e),Lr=e=>Or(e)&&0===e.trim().length,Pr=e=>null===e,Dr=e=>Fr(e)||Pr(e),Br=e=>"[object Number]"==Er.call(e),Hr=e=>"[object Boolean]"===Er.call(e),qr=e=>e instanceof Document,Wr=e=>e instanceof FormData,$r=e=>cr(wr,e),Vr=["localhost","127.0.0.1"],Zr=e=>{var t=null==Yn?void 0:Yn.createElement("a");return Fr(t)?null:(t.href=e,t)},Gr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},Ur=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return ar(e,(function(e,r){Fr(e)||Fr(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},jr=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!xr(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){rr.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},zr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Yr="$people_distinct_id",Xr="__alias",Jr="__timers",Kr="$autocapture_disabled_server_side",Qr="$heatmaps_enabled_server_side",ei="$exception_capture_enabled_server_side",ti="$web_vitals_enabled_server_side",ni="$dead_clicks_enabled_server_side",ri="$web_vitals_allowed_metrics",ii="$session_recording_enabled_server_side",oi="$console_log_recording_enabled_server_side",si="$session_recording_network_payload_capture",ai="$session_recording_canvas_recording",li="$replay_sample_rate",ci="$replay_minimum_duration",ui="$sesid",di="$session_is_sampled",hi="$session_recording_url_trigger_activated_session",pi="$session_recording_event_trigger_activated_session",vi="$enabled_feature_flags",gi="$early_access_features",fi="$stored_person_properties",mi="$stored_group_properties",_i="$surveys",yi="$surveys_activated",bi="$flag_call_reported",wi="$user_state",Si="$client_session_props",Ci="$capture_rate_limit",Ii="$initial_campaign_params",ki="$initial_referrer_info",Ei="$initial_person_info",xi="$epp",Ti="__POSTHOG_TOOLBAR__",Mi=[Yr,Xr,"__cmpns",Jr,ii,Qr,ui,vi,wi,gi,mi,fi,_i,bi,Si,Ci,Ii,ki,xi];function Ri(e){var t;return e.id===Ti||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container"))}function Ai(e){return!!e&&1===e.nodeType}function Ni(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Fi(e){return!!e&&3===e.nodeType}function Oi(e){return!!e&&11===e.nodeType}function Li(e){return e?or(e).split(/\s+/):[]}function Pi(e){var t=null==Vn?void 0:Vn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Di(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Li(t)}function Bi(e){return Dr(e)?null:or(e).split(/(\s+)/).filter((e=>Ki(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hi(e){var t="";return Zi(e)&&!Gi(e)&&e.childNodes&&e.childNodes.length&&ar(e.childNodes,(function(e){var n;Fi(e)&&e.textContent&&(t+=null!==(n=Bi(e.textContent))&&void 0!==n?n:"")})),or(t)}function qi(e){return Fr(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Wi=["a","button","form","input","select","textarea","label"];function $i(e){var t=e.parentNode;return!(!t||!Ai(t))&&t}function Vi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!Vn||!e||Ni(e,"html")||!Ai(e))return!1;if(null!=n&&n.url_allowlist&&!Pi(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Pi(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}for(var s=!1,a=[e],l=!0,c=e;c.parentNode&&!Ni(c,"body");)if(Oi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=$i(c)))break;if(r||Wi.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var u=Vn.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(s=!0)}a.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Fr(n))return!0;var r=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Fr(n))return!0;var r=function(e){if(n.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;var d=Vn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Wi.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Zi(e){for(var t=e;t.parentNode&&!Ni(t,"body");t=t.parentNode){var n=Di(t);if(cr(n,"ph-sensitive")||cr(n,"ph-no-capture"))return!1}if(cr(Di(e),"ph-include"))return!0;var r=e.type||"";if(Or(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Or(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Gi(e){return!!(Ni(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ni(e,"select")||Ni(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ui="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",ji=new RegExp("^(?:".concat(Ui,")$")),zi=new RegExp(Ui),Yi="\\d{3}-?\\d{2}-?\\d{4}",Xi=new RegExp("^(".concat(Yi,")$")),Ji=new RegExp("(".concat(Yi,")"));function Ki(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Dr(e))return!1;if(Or(e)){if(e=or(e),(t?ji:zi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Xi:Ji).test(e))return!1}return!0}function Qi(e){var t=Hi(e);return Ki(t="".concat(t," ").concat(eo(e)).trim())?t:""}function eo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ar(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Hi(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(eo(e)).trim())}catch(e){rr.error(e)}})),t}function to(e){return function(e){var n=e.map((e=>{var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+=".".concat(o.replace(/"/g,""));var s=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),a={};return ur(s).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return a[no(t.toString())]=no(n.toString())})),i+=":",i+=ur(s).map((e=>{var[t,n]=e;return"".concat(t,'="').concat(n,'"')})).join("")}));return n.join(";")}(function(e){return e.map((e=>{var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:ro(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ur(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,n]=e;return r.attributes[t]=n})),r}))}(e))}function no(e){return e.replace(/"|\\"/g,'\\"')}function ro(e){var t=e.attr__class;return t?xr(t)?t:Li(t):void 0}var io="[SessionRecording]",oo="redacted",so={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},ao=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],lo=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],co=["/s/","/e/","/i/"];function uo(e,t,n,r){if(Dr(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Or(i)&&(i=parseInt(i)),i>n?io+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function ho(e,t){if(Dr(e))return e;var n=e;return Ki(n,!1)||(n=io+" "+t+" body "+oo),ar(lo,(e=>{var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=io+" "+t+" body "+oo+" as might contain: "+e)})),n}var po=(e,n)=>{var r,i,o,s={payloadSizeLimitBytes:so.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...so.performanceEntryTypeToObserve],payloadHostDenyList:[...n.payloadHostDenyList||[],...so.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&n.recordHeaders,l=!1!==e.session_recording.recordBody&&n.recordBody,c=!1!==e.capture_performance&&n.recordPerformance,u=(r=s,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=uo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=uo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=e=>{return u((e=>{var t=Zr(e.name);if(!(t&&t.pathname&&co.some((e=>0===t.pathname.indexOf(e)))))return e})((n=(t=e).requestHeaders,Dr(n)||ar(Object.keys(null!=n?n:{}),(e=>{ao.includes(e.toLowerCase())&&(n[e]=oo)})),t)));var t,n},h=Tr(e.session_recording.maskNetworkRequestFn);return h&&Tr(e.session_recording.maskCapturedNetworkRequestFn)&&rr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=n=>{var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),s.maskRequestFn=Tr(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:e=>function(e){if(!Fr(e))return e.requestBody=ho(e.requestBody,"Request"),e.responseBody=ho(e.responseBody,"Response"),e}(d(e)),t(t(t({},so),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})};function vo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return Tr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}function go(e,t){var n,r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return i;for(var o of t.payloadHostDenyList)if(r.endsWith(o))return{hostname:r,isHostDenied:!0};return i}var fo=e=>"navigation"===e.entryType,mo=e=>"resource"===e.entryType;function _o(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((e=>fo(e)||mo(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>ko({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var r=t.getEntries().filter((e=>fo(e)||mo(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>ko({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function yo(e,t){return!!t&&(Hr(t)||t[e])}function bo(e){var{type:t,recordBody:n,headers:r}=e;function i(e){var t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Hr(n))return!0;if(xr(n))return i(n);var o=n[t];return Hr(o)?o:i(o)}function wo(e,t,n,r,i){return So.apply(this,arguments)}function So(){return So=r((function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return rr.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;var s=function(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>mo(e)&&e.initiatorType===t&&(Fr(r)||e.startTime>=r)&&(Fr(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),wo(e,t,n,r,i,o+1))})),So.apply(this,arguments)}function Co(e){var{body:t,options:n,url:r}=e;if(Dr(t))return null;var{hostname:i,isHostDenied:o}=go(r,n);if(o)return i+" is in deny list";if(Or(t))return t;if(qr(t))return t.textContent;if(Wr(t))return Ur(t);if(Ar(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Io=e=>!Pr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ko(e){var{entry:n,method:r,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:c,initiatorType:u}=e;a=n?n.startTime:a,l=n?n.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[t(t({},n?n.toJSON():{name:c}),{},{startTime:Fr(a)?void 0:Math.round(a),endTime:Fr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:r,initiatorType:u||(n?n.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Io(n))for(var v of n.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(n.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var Eo=["video/","audio/"];function xo(e){return new Promise(((t,n)=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function To(){return To=r((function*(e){var{r:t,options:n,url:r}=e,{hostname:i,isHostDenied:o}=go(r,n);return o?Promise.resolve(i+" is in deny list"):xo(t)})),To.apply(this,arguments)}function Mo(){return Mo=r((function*(e){var{r:t,options:n,url:r}=e,i=function(e){var t,{r:n,options:r,url:i}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=Eo.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type ".concat(o," is not supported");var{hostname:a,isHostDenied:l}=go(i,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return Pr(i)?xo(t):Promise.resolve(i)})),Mo.apply(this,arguments)}function Ro(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=yo("request",n.recordHeaders),o=yo("response",n.recordHeaders),s=vo(t,"fetch",(s=>function(){var a=r((function*(r,a){var l,c,u,d=new Request(r,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),i&&(h.requestHeaders=p),bo({type:"request",headers:p,url:r,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return To.apply(this,arguments)}({r:d,options:n,url:r})),c=t.performance.now(),l=yield s(d),u=t.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),o&&(h.responseHeaders=v),bo({type:"response",headers:v,url:r,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return Mo.apply(this,arguments)}({r:l,options:n,url:r})),l}finally{wo(t,"fetch",d.url,c,u).then((t=>{var n,r=ko({entry:t,method:d.method,status:null===(n=l)||void 0===n?void 0:n.status,networkRequest:h,start:c,end:u,url:d.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var Ao=null;function No(e,n,r){if(!("performance"in n))return()=>{};if(Ao)return rr.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},so,r):so,o=n=>{var r=[];n.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},s=_o(o,n,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=yo("request",n.recordHeaders),i=yo("response",n.recordHeaders),o=vo(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){var l,c,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,p=this,v=new Request(a),g={},f={},m=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,m(e,t)),r&&(g.requestHeaders=f);var _=p.send.bind(p);p.send=e=>(bo({type:"request",headers:f,url:a,recordBody:n.recordBody})&&(g.requestBody=Co({body:e,options:n,url:a})),l=t.performance.now(),_(e)),p.addEventListener("readystatechange",(()=>{if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),bo({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(g.responseBody=Co({body:p.response,options:n,url:a})),wo(t,"xmlhttprequest",v.url,l,c).then((t=>{var n=ko({entry:t,method:s,status:null==p?void 0:p.status,networkRequest:g,start:l,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))}})),o.call(p,s,a,u,d,h)}));return()=>{o()}}(o,n,i),l=Ro(o,n,i)),Ao=()=>{s(),a(),l()}}var Fo,Oo,Lo,Po=e=>({name:"rrweb/network@1",observer:No,options:e});tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Wn,getRecordNetworkPlugin:Po},tr.__PosthogExtensions__.rrweb={record:Wt,version:"v2"},tr.rrweb={record:Wt,version:"v2"},tr.rrwebConsoleRecord={getRecordConsolePlugin:Wn},tr.getRecordNetworkPlugin=Po,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Fo||(Fo={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Oo||(Oo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Lo||(Lo={}));var Do,Bo,Ho,qo,Wo,$o,Vo,Zo,Go={},Uo=[],jo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zo=Array.isArray;function Yo(e,t){for(var n in t)e[n]=t[n];return e}function Xo(e){var t=e.parentNode;t&&t.removeChild(e)}function Jo(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Do.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Ko(e,s,r,i,null)}function Ko(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Ho:i,__i:-1,__u:0};return null==i&&null!=Bo.vnode&&Bo.vnode(o),o}function Qo(e){return e.children}function es(e,t){this.props=e,this.context=t}function ts(e,t){if(null==t)return e.__?ts(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ts(e):null}function ns(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ns(e)}}function rs(e){(!e.__d&&(e.__d=!0)&&qo.push(e)&&!is.__r++||Wo!==Bo.debounceRendering)&&((Wo=Bo.debounceRendering)||$o)(is)}function is(){var e,t,n,r,i,o,s,a,l;for(qo.sort(Vo);e=qo.shift();)e.__d&&(t=qo.length,r=void 0,o=(i=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=Yo({},i)).__v=i.__v+1,Bo.vnode&&Bo.vnode(r),hs(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?ts(i):o,!!(32&i.__u),l),r.__.__k[r.__i]=r,ps(a,r,l),r.__e!=o&&ns(r)),qo.length>t&&qo.sort(Vo));is.__r=0}function os(e,t,n,r,i,o,s,a,l,c,u){var d,h,p,v,g,f=r&&r.__k||Uo,m=t.length;for(n.__d=l,function(e,t,n){var r,i,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?Ko(null,i,null,null,i):zo(i)?Ko(Qo,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?Ko(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=as(i,n,s=r+d,u),i.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=ts(o)),gs(o,o,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=ts(o)),gs(o,o))}(n,t,f),l=n.__d,d=0;d<m;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Go:f[p.__i]||Go,p.__i=d,hs(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&vs(h.ref,null,p),u.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=ss(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function ss(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=ss(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function as(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&i==l.key&&o===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function ls(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||jo.test(t)?n:n+"px"}function cs(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ls(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ls(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?ds:us,o)):e.removeEventListener(t,o?ds:us,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function us(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Bo.event?Bo.event(e):e)}function ds(e){return this.l[e.type+!0](Bo.event?Bo.event(e):e)}function hs(e,t,n,r,i,o,s,a,l,c){var u,d,h,p,v,g,f,m,_,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=Bo.__b)&&u(t);e:if("function"==typeof k)try{if(m=t.props,_=(u=k.contextType)&&r[u.__c],y=u?_?_.props.value:u.__:r,n.__c?f=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,y):(t.__c=d=new es(m,y),d.constructor=k,d.render=fs),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Yo({},d.__s)),Yo(d.__s,k.getDerivedStateFromProps(m,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,w=Bo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(r=Yo(Yo({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),os(e,zo(I=null!=u&&u.type===Qo&&null==u.key?u.props.children:u)?I:[I],t,n,r,i,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Bo.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a,l){var c,u,d,h,p,v,g,f=n.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,a=!1}if(null===_)f===m||a&&e.data===m||(e.data=m);else{if(o=o&&Do.call(e.childNodes),f=n.props||Go,!a&&null!=o)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in m||cs(e,c,null,p,i));for(c in m)p=m[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?v=p:"checked"==c?g=p:"key"===c||a&&"function"!=typeof p||f[c]===p||cs(e,c,p,f[c],i);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),os(e,zo(h)?h:[h],t,n,r,i&&"foreignObject"!==_,o,s,o?o[0]:n.__k&&ts(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&Xo(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&cs(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&cs(e,c,g,f[c],!1))}return e}(n.__e,t,n,r,i,o,s,l,c);(u=Bo.diffed)&&u(t)}function ps(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)vs(n[r],n[++r],n[++r]);Bo.__c&&Bo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Bo.__e(e,t.__v)}}))}function vs(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Bo.__e(e,n)}}function gs(e,t,n){var r,i;if(Bo.unmount&&Bo.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||vs(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Bo.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&gs(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Xo(e.__e),e.__=e.__e=e.__d=void 0}function fs(e,t,n){return this.constructor(e,n)}function ms(e,t,n){var r,i,o,s;Bo.__&&Bo.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],s=[],hs(t,e=(!r&&n||t).__k=Jo(Qo,null,[e]),i||Go,Go,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Do.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),ps(o,e,s)}function _s(e,t,n){var r,i,o,s,a=Yo({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Do.call(arguments,2):n),Ko(e.type,a,r||e.key,i||e.ref,null)}Do=Uo.slice,Bo={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Ho=0,es.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Yo({},this.state),"function"==typeof e&&(e=e(Yo({},n),this.props)),e&&Yo(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),rs(this))},es.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rs(this))},es.prototype.render=Qo,qo=[],$o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vo=function(e,t){return e.__v.__b-t.__v.__b},is.__r=0,Zo=0;var ys=Vn,bs=Yn,ws="seenSurvey_",Ss=e=>'\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: '.concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",';\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Is((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ");function Cs(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Is(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Es;"#"===t[0]&&(e=Cs(t)),t.startsWith("rgb")&&(e=t);var n=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(n&&(e=Cs(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),s=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var ks={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Es="#eeeded",xs=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(Fs(r),"true"),i.capture("survey sent",t(t({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},n),{},{$set:{[Os(r,"responded")]:!0}})),ys.dispatchEvent(new Event("PHSurveySent")))},Ts=(e,t,n)=>{var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[Os(e,"dismissed")]:!0}}),localStorage.setItem(Fs(e),"true"),ys.dispatchEvent(new Event("PHSurveyClosed")))},Ms=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Rs=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,As=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Rs(e.questions,Ms(e.questions)):e.questions),Ns=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},Fs=e=>{var t="".concat(ws).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(ws).concat(e.id,"_").concat(e.current_iteration)),t},Os=(e,t)=>{var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},Ls=function(e,t){var n={__c:t="__cC"+Zo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,rs(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),Ps=e=>{var{component:t,children:n,renderAsHtml:r,style:i}=e;return _s(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})},Ds=Yn;var Bs,Hs,qs,Ws,$s=0,Vs=[],Zs=[],Gs=Bo.__b,Us=Bo.__r,js=Bo.diffed,zs=Bo.__c,Ys=Bo.unmount;function Xs(e,t){Bo.__h&&Bo.__h(Hs,e,$s||t),$s=0;var n=Hs.__H||(Hs.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Zs}),n.__[e]}function Js(e){return $s=1,function(e,t,n){var r=Xs(Bs++,2);if(r.t=e,!r.__c&&(r.__=[la(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Hs,!Hs.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};Hs.u=!0;var o=Hs.shouldComponentUpdate,s=Hs.componentWillUpdate;Hs.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Hs.shouldComponentUpdate=i}return r.__N||r.__}(la,e)}function Ks(e,t){var n=Xs(Bs++,3);!Bo.__s&&aa(n.__H,t)&&(n.__=e,n.i=t,Hs.__H.__h.push(n))}function Qs(e){return $s=5,ea((function(){return{current:e}}),[])}function ea(e,t){var n=Xs(Bs++,7);return aa(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ta(e){var t=Hs.context[e.__c],n=Xs(Bs++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Hs)),t.props.value):e.__}function na(){for(var e;e=Vs.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(oa),e.__H.__h.forEach(sa),e.__H.__h=[]}catch(t){e.__H.__h=[],Bo.__e(t,e.__v)}}Bo.__b=function(e){Hs=null,Gs&&Gs(e)},Bo.__r=function(e){Us&&Us(e),Bs=0;var t=(Hs=e.__c).__H;t&&(qs===Hs?(t.__h=[],Hs.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Zs,e.__N=e.i=void 0}))):(t.__h.forEach(oa),t.__h.forEach(sa),t.__h=[],Bs=0)),qs=Hs},Bo.diffed=function(e){js&&js(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Vs.push(t)&&Ws===Bo.requestAnimationFrame||((Ws=Bo.requestAnimationFrame)||ia)(na)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Zs&&(e.__=e.__V),e.i=void 0,e.__V=Zs}))),qs=Hs=null},Bo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(oa),e.__h=e.__h.filter((function(e){return!e.__||sa(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Bo.__e(n,e.__v)}})),zs&&zs(e,t)},Bo.unmount=function(e){Ys&&Ys(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{oa(e)}catch(e){t=e}})),n.__H=void 0,t&&Bo.__e(t,n.__v))};var ra="function"==typeof requestAnimationFrame;function ia(e){var t,n=function(){clearTimeout(r),ra&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ra&&(t=requestAnimationFrame(n))}function oa(e){var t=Hs,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hs=t}function sa(e){var t=Hs;e.__c=e.__(),Hs=t}function aa(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function la(e,t){return"function"==typeof t?t(e):t}var ca=0;function ua(e,t,n,r,i,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ca,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Bo.vnode&&Bo.vnode(c),c}var da=ua("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ua("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ha=ua("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ua("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),pa=ua("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ua("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),va=ua("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ua("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),ga=ua("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ua("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fa=ua("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ua("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),ma=ua("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ua("g",{"clip-path":"url(#clip0_2415_6911)",children:[ua("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ua("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ua("g",{mask:"url(#mask0_2415_6911)",children:[ua("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),ua("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),ua("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),ua("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),ua("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),ua("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),ua("defs",{children:ua("clipPath",{id:"clip0_2415_6911",children:ua("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),_a=ua("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ua("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function ya(){return ua("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ma]})}function ba(e){var{text:t,submitDisabled:n,appearance:r,onSubmit:i,link:o}=e,{isPreviewMode:s,isPopup:a}=ta(Ls),l=r.submitButtonTextColor||Is(r.submitButtonColor||ks.submitButtonColor);return ua("div",{className:"bottom-section",children:[ua("div",{className:"buttons",children:ua("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(o&&(null==Vn||Vn.open(o)),i())},children:t})}),!r.whiteLabel&&ua(ya,{})]})}function wa(e){var{question:t,description:n,descriptionContentType:r,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=ta(Ls);return ua("div",{style:s?{backgroundColor:i||ks.backgroundColor}:{},children:[ua("div",{className:"survey-question",children:t}),n&&Ps({component:Jo("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==r})]})}function Sa(e){var{onClick:t}=e,{isPreviewMode:n}=ta(Ls);return ua("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:ua("button",{className:"form-cancel",onClick:t,disabled:n,children:fa})})}function Ca(e){var{header:n,description:r,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Is(s.backgroundColor||ks.backgroundColor),{isPopup:u}=ta(Ls);return ua(Qo,{children:ua("div",{className:"thank-you-message",style:t({},l),children:ua("div",{className:"thank-you-message-container",children:[u&&ua(Sa,{onClick:()=>a()}),ua("h3",{className:"thank-you-message-header",style:{color:c},children:n}),r&&Ps({component:Jo("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&ua(ba,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function Ia(e){var t,n=Qs(null),[r,i]=Js(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Ks((()=>{if(n.current){var e=function(e){var t=ys.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var r=parseInt(n[1]),i=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(r*r*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(n.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function ka(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i}=e,o=Qs(null),[s,a]=Js("");return ua("div",{ref:o,children:[ua(wa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),ua("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>a(e.currentTarget.value)}),ua(ba,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:()=>i(s)})]})}function Ea(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i}=e;return ua(Qo,{children:[ua(wa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),ua(ba,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked")})]})}function xa(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o}=e,s=t.scale,a=10===t.scale?0:1,[l,c]=Js(null);return ua(Qo,{children:[ua(wa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ua("div",{className:"rating-section",children:[ua("div",{className:"rating-options",children:["emoji"===t.display&&ua("div",{className:"rating-options-emoji",children:(3===t.scale?Ra:Aa).map(((e,t)=>{var n=t+1===l;return ua("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&ua("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(s-a+1,", minmax(0, 1fr))")},children:La(t.scale).map(((e,t)=>ua(Ta,{displayQuestionIndex:r,active:l===e,appearance:i,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),ua("div",{className:"rating-text",children:[ua("div",{children:t.lowerBoundLabel}),ua("div",{children:t.upperBoundLabel})]})]}),ua(ba,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Pr(l)&&!t.optional,appearance:i,onSubmit:()=>o(l)})]})}function Ta(e){var{num:t,active:n,displayQuestionIndex:r,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=Ia({appearance:i,defaultTextColor:"black",forceUpdate:n});return ua("button",{ref:a,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function Ma(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o}=e,s=Qs(null),a=ea((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Rs(t,Ms(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[l,c]=Js(t.type===Oo.MultipleChoice?[]:null),[u,d]=Js(!1),[h,p]=Js(""),v=t.type===Oo.SingleChoice?"radio":"checkbox";return ua("div",{ref:s,children:[ua(wa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ua("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{var i="choice-option",o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(i+=" choice-option-open"),ua("div",{className:i,children:[ua("input",{type:v,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===Oo.SingleChoice?c(o):t.type===Oo.MultipleChoice&&xr(l)?l.includes(o)?c(l.filter((e=>e!==o))):c([...l,o]):void 0}),ua("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?ua(Qo,{children:[ua("span",{children:[s,":"]}),ua("input",{type:"text",id:"surveyQuestion".concat(r,"Choice").concat(n,"Open"),name:"question".concat(r),onInput:e=>{var n=e.currentTarget.value;return t.type===Oo.SingleChoice?c(n):t.type===Oo.MultipleChoice&&xr(l)?p(n):void 0}})]}):s}),ua("span",{className:"choice-check",style:{color:"black"},children:_a})]})}))}),ua(ba,{text:t.buttonText||"Submit",submitDisabled:(Pr(l)||xr(l)&&!u&&0===l.length||xr(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{u&&t.type===Oo.MultipleChoice?xr(l)&&o([...l,h]):o(l)}})]})}var Ra=[pa,ha,da],Aa=[va,pa,ha,da,ga],Na=[1,2,3,4,5],Fa=[1,2,3,4,5,6,7],Oa=[0,1,2,3,4,5,6,7,8,9,10];function La(e){switch(e){case 5:default:return Na;case 7:return Fa;case 10:return Oa}}var Pa=Vn,Da=Yn;class Ba{constructor(e){var t=this;i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=Da.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),i(this,"handlePopoverSurvey",(e=>{var t,n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){var i=new Date,o=Math.abs(i.getTime()-new Date(r).getTime());if(Math.ceil(o/864e5)<n)return}var s=(e=>!!localStorage.getItem(Fs(e))&&!Ns(e))(e);if(!s){this.addSurveyToFocus(e.id);var a=((e,t,n)=>{var r=bs.createElement("div");r.className="PostHogSurvey".concat(t);var i=r.attachShadow({mode:"open"});if(e){var o=Object.assign(bs.createElement("style"),{innerText:e});i.appendChild(o)}return bs.body.appendChild(r),i})(Ss(null==e?void 0:e.appearance),e.id);ms(ua(qa,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}})),i(this,"handleWidget",(e=>{var t=function(e){var t,n=Ds.createElement("div");n.className="PostHogWidget".concat(e.id);var r,i=n.attachShadow({mode:"open"}),o=(r=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(Ds.createElement("style"),{innerText:o})),Ds.body.appendChild(n),i}(e),n=Ss(e.appearance);t.appendChild(Object.assign(Da.createElement("style"),{innerText:n})),ms(ua($a,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)})),i(this,"handleWidgetSelector",(e=>{var t,n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Da.querySelector(e.appearance.widgetSelector);if(n)if(0===Da.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===Da.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,i,o=null===(r=Da.querySelector(".PostHogWidget".concat(e.id)))||void 0===r||null===(i=r.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");n.addEventListener("click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",o.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),o.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}})),i(this,"canRenderSurvey",(e=>{var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Fo.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),i(this,"renderSurvey",((e,t)=>{ms(ua(qa,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=t.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var n=e.filter((e=>"api"!==e.type));t.sortSurveysByAppearanceDelay(n).forEach((e=>{if(Pr(t.surveyInFocus)){var n,r,i;if(e.type===Fo.Widget)"tab"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&0===Da.querySelectorAll(".PostHogWidget".concat(e.id)).length&&t.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&t.handleWidgetSelector(e);e.type===Fo.Popover&&t.canShowNextEventBasedSurvey()&&t.handlePopoverSurvey(e)}}))}),n)})),i(this,"addSurveyToFocus",(e=>{Pr(this.surveyInFocus)||rr.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&rr.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function Ha(e){if(Da&&Pa){var t=new Ba(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function qa(e){var n,r,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v}=e,g=Number.isInteger(h),f=null!==(n=l.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:_,setIsPopupVisible:y}=function(e,t,n,r,i){var[o,s]=Js(r||0===n),[a,l]=Js(!1);return Ks((()=>{if(!r&&t){var o,a=()=>{i(e.id),s(!1)},c=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),i(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(i(e.id),s(!1))},u=()=>{var n;s(!0),Pa.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Pa.addEventListener("PHSurveyClosed",a),Pa.addEventListener("PHSurveySent",c),n>0?(o=setTimeout((()=>{u()}),n),()=>{clearTimeout(o),Pa.removeEventListener("PHSurveyClosed",a),Pa.removeEventListener("PHSurveySent",c)}):(u(),()=>{Pa.removeEventListener("PHSurveyClosed",a),Pa.removeEventListener("PHSurveySent",c)})}}),[]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,f,g,p),b=_||h===l.questions.length,w=null!==(r=d)&&void 0!==r&&r.left&&Br(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return g&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),m?ua(Ls.Provider,{value:{isPreviewMode:g,previewPageIndex:h,handleCloseSurveyPopup:()=>Ts(l,u,g),isPopup:v||!1},children:b?ua(Ca,{header:(null===(o=l.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(s=l.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!c,contentType:null===(a=l.appearance)||void 0===a?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||ks,styleOverrides:t(t({},d),w),onClose:()=>y(!1)}):ua(Wa,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):ua(Qo,{})}function Wa(e){var n,r,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Is((null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||ks.backgroundColor),[c,u]=Js({}),{isPreviewMode:d,previewPageIndex:h,handleCloseSurveyPopup:p,isPopup:v}=ta(Ls),[g,f]=Js(h||0),m=ea((()=>As(i)),[i]);Ks((()=>{f(null!=h?h:0)}),[h]);return ua("form",{className:"survey-form",style:v?t({color:l,borderColor:null===(r=i.appearance)||void 0===r?void 0:r.borderColor},a):{},children:m.map(((e,n)=>{var r,{originalQuestionIndex:a}=e;return(d?g===a:g===n)&&ua("div",{className:"survey-box",style:v?{backgroundColor:(null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||ks.backgroundColor}:{},children:[v&&ua(Sa,{onClick:()=>p()}),Va({question:e,forceDisableHtml:o,displayQuestionIndex:n,appearance:i.appearance||ks,onSubmit:e=>(e=>{var{res:n,originalQuestionIndex:r,displayQuestionIndex:o}=e;if(s){var a=0===r?"$survey_response":"$survey_response_".concat(r);if(u(t(t({},c),{},{[a]:n})),s.getNextSurveyStep){var l=s.getNextSurveyStep(i,o,n);l===Lo.End?xs(t(t({},c),{},{[a]:n}),i,s):f(l)}else o===i.questions.length-1?xs(t(t({},c),{},{[a]:n}),i,s):f(o+1)}})({res:e,originalQuestionIndex:a,displayQuestionIndex:n})})]})}))})}function $a(e){var t,n,{survey:r,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=Js(!1),[u,d]=Js({}),h=Qs(null);return Ks((()=>{var e,t;if(!s&&o){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n,i=h.current.getBoundingClientRect(),a={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6")};d(a)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){var u=Da.querySelector(r.appearance.widgetSelector||"");null==u||u.addEventListener("click",(()=>{c(!l)})),null==u||u.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),ua(Qo,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&ua("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:Is(r.appearance.widgetColor)},children:[ua("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&ua(qa,{posthog:o,survey:r,forceDisableHtml:i,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}var Va=e=>{var{question:n,forceDisableHtml:r,displayQuestionIndex:i,appearance:o,onSubmit:s}=e,a={[Oo.Open]:ka,[Oo.Link]:Ea,[Oo.Rating]:xa,[Oo.SingleChoice]:Ma,[Oo.MultipleChoice]:Ma},l={question:n,forceDisableHtml:r,appearance:o,onSubmit:s},c={[Oo.Open]:{},[Oo.Link]:{},[Oo.Rating]:{displayQuestionIndex:i},[Oo.SingleChoice]:{displayQuestionIndex:i},[Oo.MultipleChoice]:{displayQuestionIndex:i}},u=a[n.type],d=t(t({},l),c[n.type]);return ua(u,t({},d))};function Za(e){return!Fr(Event)&&Ga(e,Event)}function Ga(e,t){try{return e instanceof t}catch(e){return!1}}function Ua(e){return Pr(e)||!Ar(e)&&!Tr(e)}function ja(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function za(e){return ja(e,"DOMError")}tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.canActivateRepeatedly=Ns,tr.__PosthogExtensions__.generateSurveys=Ha,tr.extendPostHogWithSurveys=Ha;var Ya=/\(error: (.*)\)/,Xa=50,Ja="?";function Ka(e,t,n,r){var i={platform:"javascript",filename:e,function:"<anonymous>"===t?Ja:t,in_app:!0};return Fr(n)||(i.lineno=n),Fr(r)||(i.colno=r),i}var Qa=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,el=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tl=/\((\S*)(?::(\d+))(?::(\d+))\)/,nl=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,rl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,il=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=e.split("\n"),s=n;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=Ya.test(a)?a.replace(Ya,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l);if(u){r.push(u);break}}if(r.length>=Xa)break}}}return function(e){if(!e.length)return[];var n=Array.from(e);return n.reverse(),n.slice(0,Xa).map((e=>t(t({},e),{},{filename:e.filename||ol(n).filename,function:e.function||Ja})))}(r)}}(...[[30,e=>{var t=Qa.exec(e);if(t){var[,n,r,i]=t;return Ka(n,Ja,+r,+i)}var o=el.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=tl.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=sl(o[1]||Ja,o[2]);return Ka(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=nl.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=rl.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||Ja;return[i,r]=sl(i,r),Ka(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function ol(e){return e[e.length-1]||{}}var sl=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Ja,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},al=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function ll(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.stacktrace||e.stack||"",r=function(e){if(e&&cl.test(e.message))return 1;return 0}(e);try{var i=il(n,r);return i.slice(0,i.length-t)}catch(e){}return[]}var cl=/Minified React error #\d+;/i;function ul(e,t){var n,r,i=ll(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function dl(e,t){var n,r,i,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var l=ll(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function hl(e){return Or(e)&&!Lr(e)&&Sr.indexOf(e)>=0}function pl(e,t){var n,r,i=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Za(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}(e)),l={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var c=ll(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:hl(e.level)?e.level:"error"}}function vl(e,n){var[r,i,o,s,a]=e,l={$exception_list:[]},c=a||r;if(za(c)||function(e){return ja(e,"DOMException")}(c)){var u=c;if(function(e){return"stack"in e}(c))l=ul(c,n);else{var d=u.name||(za(u)?"DOMError":"DOMException"),h=u.message?"".concat(d,": ").concat(u.message):d,p=za(u)?"DOMError":"DOMException";l=dl(h,t(t({},n),{},{overrideExceptionType:p,defaultExceptionMessage:h}))}return"code"in u&&(l.$exception_DOMException_code="".concat(u.code)),l}if(function(e){return ja(e,"ErrorEvent")}(c)&&c.error)return ul(c.error,n);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Ga(e,Error)}}(c))return ul(c,n);if(function(e){return ja(e,"Object")}(c)||Za(c))return pl(c,n);if(Fr(a)&&Or(r)){var v="Error",g=r,f=r.match(al);return f&&(v=f[1],g=f[2]),dl(g,t(t({},n),{},{overrideExceptionType:v,defaultExceptionMessage:g}))}return dl(c,n)}function gl(e){var[t]=e,n=function(e){if(Ua(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return Ua(n)?dl("Non-Error promise rejection captured with value: ".concat(String(n)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):vl([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}var fl={wrapOnError:e=>{var t=Vn;t||rr.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=vl(i);return e(s),null!==(t=null==n?void 0:n(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{var t=Vn;t||rr.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=gl(o);return e(a),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.errorWrappingFunctions=fl,tr.__PosthogExtensions__.parseErrorAsProperties=vl,tr.posthogErrorWrappingFunctions=fl,tr.parseErrorAsProperties=vl;var ml=(e,t)=>{var{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)};tr.__PosthogExtensions__=tr.__PosthogExtensions__||{};var _l={_patchFetch:e=>vo(Vn,"fetch",(t=>function(){var n=r((function*(n,r){var i=new Request(n,r);return ml(e,i),t(i)}));return function(e,t){return n.apply(this,arguments)}}())),_patchXHR:e=>vo(Vn.XMLHttpRequest.prototype,"open",(t=>function(n,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(r);return ml(e,a),t.call(this,n,a.url,i,o,s)}))};tr.__PosthogExtensions__.tracingHeadersPatchFns=_l,tr.postHogTracingHeadersPatchFns=_l;var yl,bl,wl,Sl=-1,Cl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Sl=t.timeStamp,e(t))}),!0)},Il=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},kl=function(){var e=Il();return e&&e.activationStart||0},El=function(e,t){var n=Il(),r="navigate";return Sl>=0?r="back-forward-cache":n&&(document.prerendering||kl()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},xl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Tl=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Ml=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Rl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Al=function(e){var t=!1;return function(){t||(e(),t=!0)}},Nl=-1,Fl=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ol=function(e){"hidden"===document.visibilityState&&Nl>-1&&(Nl="visibilitychange"===e.type?e.timeStamp:0,Pl())},Ll=function(){addEventListener("visibilitychange",Ol,!0),addEventListener("prerenderingchange",Ol,!0)},Pl=function(){removeEventListener("visibilitychange",Ol,!0),removeEventListener("prerenderingchange",Ol,!0)},Dl=function(){return Nl<0&&(Nl=Fl(),Ll(),Cl((function(){setTimeout((function(){Nl=Fl(),Ll()}),0)}))),{get firstHiddenTime(){return Nl}}},Bl=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Hl=[1800,3e3],ql=function(e,t){t=t||{},Bl((function(){var n,r=Dl(),i=El("FCP"),o=xl("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-kl(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Tl(e,i,Hl,t.reportAllChanges),Cl((function(r){i=El("FCP"),n=Tl(e,i,Hl,t.reportAllChanges),Ml((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Wl=[.1,.25],$l=[2500,4e3],Vl={},Zl=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Gl=function(e){if("loading"===document.readyState)return"loading";var t=Zl();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Ul=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},jl=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Ul(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},zl=-1,Yl=function(e,t){var n=Zl(),r="navigate";return zl>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=Zl();return e&&e.activationStart||0}()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Xl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Jl=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Kl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ql=0,ec=1/0,tc=0,nc=function(e){e.forEach((function(e){e.interactionId&&(ec=Math.min(ec,e.interactionId),tc=Math.max(tc,e.interactionId),Ql=tc?(tc-ec)/7+1:0)}))},rc=function(){"interactionCount"in performance||yl||(yl=Xl("event",nc,{type:"event",buffered:!0,durationThreshold:0}))},ic=[],oc=new Map,sc=0,ac=function(){return(yl?Ql:performance.interactionCount||0)-sc},lc=[],cc=function(e){if(lc.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=ic[ic.length-1],n=oc.get(e.interactionId);if(n||ic.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};oc.set(r.id,r),ic.push(r)}ic.sort((function(e,t){return t.latency-e.latency})),ic.length>10&&ic.splice(10).forEach((function(e){return oc.delete(e.id)}))}}},uc=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Kl(e)),n},dc=[200,500],hc=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;rc();var r,i=Yl("INP"),o=function(e){uc((function(){e.forEach(cc);var t,n=(t=Math.min(ic.length-1,Math.floor(ac()/50)),ic[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},s=Xl("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Jl(e,i,dc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Kl((function(){o(s.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(zl=t.timeStamp,e(t))}),!0)}((function(){sc=0,ic.length=0,oc.clear(),i=Yl("INP"),r=Jl(e,i,dc,t.reportAllChanges)})))})))},pc=[],vc=[],gc=new WeakMap,fc=new Map,mc=-1,_c=function(e){pc=pc.concat(e),yc()},yc=function(){mc<0&&(mc=uc(bc))},bc=function(){fc.size>10&&fc.forEach((function(e,t){oc.has(t)||fc.delete(t)}));var e=ic.map((function(e){return gc.get(e.entries[0])})),t=vc.length-50;vc=vc.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<vc.length;r++){var i=vc[r];wc(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=pc[pc.length-1-o];if(!s||s.startTime<wl)break;n.add(s)}pc=Array.from(n),mc=-1};lc.push((function(e){e.interactionId&&e.target&&!fc.has(e.interactionId)&&fc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;wl=Math.max(wl,e.processingEnd);for(var r=vc.length-1;r>=0;r--){var i=vc[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},vc.push(t)),(e.interactionId||"first-input"===e.entryType)&&gc.set(e,t),yc()}));var wc=function(e,t){for(var n,r=[],i=0;n=pc[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Sc={onLCP:function(e,t){t=t||{},Bl((function(){var n,r=Dl(),i=El("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-kl(),0),i.entries=[e],n())}))},s=xl("largest-contentful-paint",o);if(s){n=Tl(e,i,$l,t.reportAllChanges);var a=Al((function(){Vl[i.id]||(o(s.takeRecords()),s.disconnect(),Vl[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Al(e),"hidden"===document.visibilityState?e():(n=t(e),Rl(e)),n}(a)}),!0)})),Rl(a),Cl((function(r){i=El("LCP"),n=Tl(e,i,$l,t.reportAllChanges),Ml((function(){i.value=performance.now()-r.timeStamp,Vl[i.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},ql(Al((function(){var n,r=El("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},a=xl("layout-shift",s);a&&(n=Tl(e,r,Wl,t.reportAllChanges),Rl((function(){s(a.takeRecords()),n(!0)})),Cl((function(){i=0,r=El("CLS",0),n=Tl(e,r,Wl,t.reportAllChanges),Ml((function(){return n()}))})),setTimeout(n,0))})))},onFCP:ql,onINP:function(e,t){bl||(bl=Xl("long-animation-frame",_c)),hc((function(t){var n=function(e){var t=e.entries[0],n=gc.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=wc(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||fc.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:jl(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(u-i,0),loadState:Gl(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.postHogWebVitalsCallbacks=Sc,tr.postHogWebVitalsCallbacks=Sc;class Cc{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}function Ic(e,t){return t.length>e?t.slice(0,e)+"...":t}function kc(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Ai(t));return t}function Ec(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};Wi.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Ic(1024,Qi(e)):o.$el_text=Ic(1024,Hi(e)));var s=Di(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),ar(e.attributes,(function(n){var i;if((!Gi(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&Ki(n.value)&&(i=n.name,!Or(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=n.value;"class"===n.name&&(s=Li(s).join(" ")),o["attr__"+n.name]=Ic(1024,s)}}));for(var a=1,l=1,c=e;c=kc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function xc(e,t){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Ni(u,"body");)Oi(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},v=!1,g=!1;if(ar(c,(e=>{var t=Zi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&Ki(v)&&v),cr(Di(e),"ph-no-capture")&&(g=!0),h.push(Ec(e,o,s,a));var n=function(e){if(!Zi(e))return{};var t={};return ar(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Ki(r)&&(t[n]=r)}})),t}(e);lr(p,n)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=Qi(e):h[0].$el_text=Hi(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=Zr(v))||void 0===f?void 0:f.host,y=null==Vn||null===(m=Vn.location)||void 0===m?void 0:m.host;_&&y&&_!==y&&(d=v)}return{props:lr({$event_type:i.type,$ce_version:1},l?{$elements_chain:to(h)}:{$elements:h},null!==(n=h[0])&&void 0!==n&&n.$el_text?{$el_text:null===(r=h[0])||void 0===r?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}class Tc{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Cc),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,n=Ar(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Vn&&Yn){var e=e=>{e=e||(null==Vn?void 0:Vn.event);try{this._captureEvent(e)}catch(e){rr.error("Failed to capture event",e)}},t=e=>{e=e||(null==Vn?void 0:Vn.event),this._captureEvent(e,br)};mr(Yn,"submit",e,!1,!0),mr(Yn,"change",e,!1,!0),mr(Yn,"click",e,!1,!0),this.config.capture_copied_text&&(mr(Yn,"copy",t,!1,!0),mr(Yn,"cut",t,!1,!0))}}else rr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Kr]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{var r=null==Yn?void 0:Yn.querySelectorAll(t);null==r||r.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Kr],r=this._isDisabledServerSide;if(Pr(r)&&!Hr(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,r=qi(e);if(Fi(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===br;if(r&&Vi(r,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=xc(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(s)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(o.$element_selectors=a),t===br){var l,c=Bi(null==Vn||null===(l=Vn.getSelection())||void 0===l?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Tr(null==Yn?void 0:Yn.querySelectorAll)}}var Mc={};function Rc(e){return function(e,t){var n=Mc[e];if(n)return n;var r=t[e];if(Mr(r)&&!Rr(r))return Mc[e]=r.bind(t);var i=t.document;if(i&&Tr(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(r=s[e]),i.head.removeChild(o)}catch(t){rr.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return r&&Tr(r)?Mc[e]=r.bind(t):r}("MutationObserver",e)}function Ac(e,t){return Br(e)&&e>=t}class Nc{asRequiredConfig(e){var t,n,r,i,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){i(this,"_clicks",[]),i(this,"_defaultConfig",(e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}))),i(this,"_onClick",(e=>{var t=function(e){var t=qi(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Pr(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Fr(this._checkClickTimer)&&(this._checkClickTimer=tr.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{Fr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))})),i(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Rc(tr);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,tr.removeEventListener("click",this._onClick),tr.removeEventListener("scroll",this._onScroll,!0),tr.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){tr.addEventListener("click",this._onClick)}_startScrollObserver(){tr.addEventListener("scroll",this._onScroll,!0)}_startSelectionChangedObserver(){tr.addEventListener("selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(Ri(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Ni(e.node,"html")&&Ai(e.node)&&!Wi.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var n;t.mutationDelayMs=null!==(n=t.mutationDelayMs)&&void 0!==n?n:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var r=Ac(t.scrollDelayMs,this._config.scroll_threshold_ms),i=Ac(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=Ac(t.mutationDelayMs,this._config.mutation_threshold_ms),s=Ac(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Br(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=Br(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=Br(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||c||(r||o||s||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&Fr(this._checkClickTimer)&&(this._checkClickTimer=tr.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,n){this.instance.capture("$dead_click",t(t(t({},n),xc(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Nc(e,t);var Fc=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return rr.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var r=()=>{if(!Yn)return n("document not found");var e=Yn.createElement("script");e.type="text/javascript",e.crossOrigin="anonymous",e.src=t,e.onload=e=>n(void 0,e),e.onerror=e=>n(e);var r,i=Yn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):Yn.body.appendChild(e)};null!=Yn&&Yn.body?r():null==Yn||Yn.addEventListener("DOMContentLoaded",r)};tr.__PosthogExtensions__=tr.__PosthogExtensions__||{},tr.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/".concat(t,".js")+"?v=".concat(e.version);if("toolbar"===t){var i=3e5,o=Math.floor(Date.now()/i)*i;r="".concat(r,"&t=").concat(o)}var s=e.requestRouter.endpointFor("assets",r);Fc(e,s,n)},tr.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Fc(e,r,n)};var Oc="$active_feature_flags",Lc="$override_feature_flags",Pc="$feature_flag_payloads",Dc=e=>{var t={};for(var[n,r]of ur(e||{}))r&&(t[n]=r);return t};class Bc{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(vi),t=this.instance.get_property(Lc);if(!t)return e||{};for(var n=lr({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(rr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(Pc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var e=this.instance.config.token,t=this.instance.get_property(fi),n=this.instance.get_property(mi),r={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:r,compression:this.instance.config.disable_compression?void 0:yr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);var n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(bi)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))xr(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register({[bi]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}rr.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);rr.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(xr(o)){var a={};if(o)for(var l=0;l<o.length;l++)a[o[l]]=!0;n&&n.register({[Oc]:o,[vi]:a})}else{var c=o,u=s;e.errorsWhileComputingFlags&&(c=t(t({},r),c),u=t(t({},i),u)),n&&n.register({[Oc]:Object.keys(Dc(c)),[vi]:c||{},[Pc]:u||{}})}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return rr.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Lc);else if(xr(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register({[Lc]:n})}else this.instance.persistence.register({[Lc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n){var r,i={["$feature_enrollment/".concat(e)]:n};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:i}),this.setPersonPropertiesForFlags(i,!1);var o=t(t({},this.getFlagVariants()),{},{[e]:n});null===(r=this.instance.persistence)||void 0===r||r.register({[Oc]:Object.keys(Dc(o)),[vi]:o}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.instance.get_property(gi);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[gi]:r}),e(r)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(fi)||{};this.instance.register({[fi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(fi)}setGroupPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(mi)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((n=>{r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register({[mi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this.instance.get_property(mi)||{};this.instance.register({[mi]:t(t({},n),{},{[e]:{}})})}else this.instance.unregister(mi)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Br(e)&&isFinite(e)&&Math.floor(e)===e});var Hc="0123456789abcdef";class qc{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new qc(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Hc.charAt(this.bytes[t]>>>4)+Hc.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new qc(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Wc{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new Zc)}generate(){var e=this.generateOrAbort();if(Fr(e)){this.timestamp=0;var t=this.generateOrAbort();if(Fr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return qc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var $c,Vc=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Vn&&!Fr(Vn.crypto)&&crypto.getRandomValues&&(Vc=e=>crypto.getRandomValues(e));class Zc{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Vc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var Gc=()=>Uc().toString(),Uc=()=>($c||($c=new Wc)).generate(),jc="Thu, 01 Jan 1970 00:00:00 GMT",zc="";var Yc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Xc(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yn;if(zc)return zc;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+Gc(),o=new RegExp("(^|;)\\s*"+i+"=1");!zc&&r--;){var s=n.slice(r).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+jc,zc=s)}return zc}(e);if(!n){var r=(e=>{var t=e.match(Yc);return t?t[0]:""})(e);r!==n&&rr.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Jc={is_supported:()=>!!Yn,error:function(e){rr.error("cookieStore error: "+e)},get:function(e){if(Yn){try{for(var t=e+"=",n=Yn.cookie.split(";").filter((e=>e.length)),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(Jc.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(Yn)try{var o="",s="",a=Xc(Yn.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&rr.warn("cookieStore warning: large cookie, len="+c.length),Yn.cookie=c,c}catch(e){return}},remove:function(e,t){try{Jc.set(e,"",-1,t)}catch(e){return}}},Kc=null,Qc={is_supported:function(){if(!Pr(Kc))return Kc;var e=!0;if(Fr(Vn))e=!1;else try{var t="__mplssupport__";Qc.set(t,"xyz"),'"xyz"'!==Qc.get(t)&&(e=!1),Qc.remove(t)}catch(t){e=!1}return e||rr.error("localStorage unsupported; falling back to cookie store"),Kc=e,e},error:function(e){rr.error("localStorage error: "+e)},get:function(e){try{return null==Vn?void 0:Vn.localStorage.getItem(e)}catch(e){Qc.error(e)}return null},parse:function(e){try{return JSON.parse(Qc.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Vn||Vn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Qc.error(e)}},remove:function(e){try{null==Vn||Vn.localStorage.removeItem(e)}catch(e){Qc.error(e)}}},eu=["distinct_id",ui,di,xi],tu=t(t({},Qc),{},{parse:function(e){try{var t={};try{t=Jc.parse(e)||{}}catch(e){}var n=lr(t,JSON.parse(Qc.get(e)||"{}"));return Qc.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i,o){try{Qc.set(e,t,void 0,void 0,o);var s={};eu.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Jc.set(e,s,n,r,i,o)}catch(e){Qc.error(e)}},remove:function(e,t){try{null==Vn||Vn.localStorage.removeItem(e),Jc.remove(e,t)}catch(e){Qc.error(e)}}}),nu={},ru={is_supported:function(){return!0},error:function(e){rr.error("memoryStorage error: "+e)},get:function(e){return nu[e]||null},parse:function(e){return nu[e]||null},set:function(e,t){nu[e]=t},remove:function(e){delete nu[e]}},iu=null,ou={is_supported:function(){if(!Pr(iu))return iu;if(iu=!0,Fr(Vn))iu=!1;else try{var e="__support__";ou.set(e,"xyz"),'"xyz"'!==ou.get(e)&&(iu=!1),ou.remove(e)}catch(e){iu=!1}return iu},error:function(e){rr.error("sessionStorage error: ",e)},get:function(e){try{return null==Vn?void 0:Vn.sessionStorage.getItem(e)}catch(e){ou.error(e)}return null},parse:function(e){try{return JSON.parse(ou.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Vn||Vn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ou.error(e)}},remove:function(e){try{null==Vn||Vn.sessionStorage.removeItem(e)}catch(e){ou.error(e)}}},su="Mobile",au="iOS",lu="Android",cu="Tablet",uu=lu+" "+cu,du="iPad",hu="Apple",pu=hu+" Watch",vu="Safari",gu="BlackBerry",fu="Samsung",mu=fu+"Browser",_u=fu+" Internet",yu="Chrome",bu=yu+" OS",wu=yu+" "+au,Su="Internet Explorer",Cu=Su+" "+su,Iu="Opera",ku=Iu+" Mini",Eu="Edge",xu="Microsoft "+Eu,Tu="Firefox",Mu=Tu+" "+au,Ru="Nintendo",Au="PlayStation",Nu="Xbox",Fu=lu+" "+su,Ou=su+" "+vu,Lu="Windows",Pu=Lu+" Phone",Du="Nokia",Bu="Ouya",Hu="Generic",qu=Hu+" "+su.toLowerCase(),Wu=Hu+" "+cu.toLowerCase(),$u="Konqueror",Vu="(\\d+(\\.\\d+)?)",Zu=new RegExp("Version/"+Vu),Gu=new RegExp(Nu,"i"),Uu=new RegExp(Au+" \\w+","i"),ju=new RegExp(Ru+" \\w+","i"),zu=new RegExp(gu+"|PlayBook|BB10","i"),Yu={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Xu=(e,t)=>t&&cr(t,hu)||function(e){return cr(e,vu)&&!cr(e,yu)&&!cr(e,lu)}(e),Ju=function(e,t){return t=t||"",cr(e," OPR/")&&cr(e,"Mini")?ku:cr(e," OPR/")?Iu:zu.test(e)?gu:cr(e,"IE"+su)||cr(e,"WPDesktop")?Cu:cr(e,mu)?_u:cr(e,Eu)||cr(e,"Edg/")?xu:cr(e,"FBIOS")?"Facebook "+su:cr(e,"UCWEB")||cr(e,"UCBrowser")?"UC Browser":cr(e,"CriOS")?wu:cr(e,"CrMo")?yu:cr(e,lu)&&cr(e,vu)?Fu:cr(e,yu)?yu:cr(e,"FxiOS")?Mu:cr(e.toLowerCase(),$u.toLowerCase())?$u:Xu(e,t)?cr(e,su)?Ou:vu:cr(e,Tu)?Tu:cr(e,"MSIE")||cr(e,"Trident/")?Su:cr(e,"Gecko")?Tu:""},Ku={[Cu]:[new RegExp("rv:"+Vu)],[xu]:[new RegExp(Eu+"?\\/"+Vu)],[yu]:[new RegExp("("+yu+"|CrMo)\\/"+Vu)],[wu]:[new RegExp("CriOS\\/"+Vu)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Vu)],[vu]:[Zu],[Ou]:[Zu],[Iu]:[new RegExp("(Opera|OPR)\\/"+Vu)],[Tu]:[new RegExp(Tu+"\\/"+Vu)],[Mu]:[new RegExp("FxiOS\\/"+Vu)],[$u]:[new RegExp("Konqueror[:/]?"+Vu,"i")],[gu]:[new RegExp(gu+" "+Vu),Zu],[Fu]:[new RegExp("android\\s"+Vu,"i")],[_u]:[new RegExp(mu+"\\/"+Vu)],[Su]:[new RegExp("(rv:|MSIE )"+Vu)],Mozilla:[new RegExp("rv:"+Vu)]},Qu=[[new RegExp(Nu+"; "+Nu+" (.*?)[);]","i"),e=>[Nu,e&&e[1]||""]],[new RegExp(Ru,"i"),[Ru,""]],[new RegExp(Au,"i"),[Au,""]],[zu,[gu,""]],[new RegExp(Lu,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Pu,""];if(new RegExp(su).test(t)&&!/IEMobile\b/.test(t))return[Lu+" "+su,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Yu[r]||"";return/arm/i.test(t)&&(i="RT"),[Lu,i]}return[Lu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[au,t.join(".")]}return[au,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Fr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+lu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+lu+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[lu,t.join(".")]}return[lu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[bu,""]],[/Linux|debian/i,["Linux",""]]],ed=function(e){return ju.test(e)?Ru:Uu.test(e)?Au:Gu.test(e)?Nu:new RegExp(Bu,"i").test(e)?Bu:new RegExp("("+Pu+"|WPDesktop)","i").test(e)?Pu:/iPad/.test(e)?du:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?pu:zu.test(e)?gu:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Du,"i").test(e)?Du:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(su).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?lu:uu:lu:new RegExp("(pda|"+su+")","i").test(e)?qu:new RegExp(cu,"i").test(e)&&!new RegExp(cu+" pc","i").test(e)?Wu:""},td="https?://(.*)",nd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],rd={campaignParams:function(e){return Yn?this._campaignParamsFromUrl(Yn.URL,e):{}},_campaignParamsFromUrl:function(e,t){var n=nd.concat(t||[]),r={};return ar(n,(function(t){var n=jr(e,t);r[t]=n||null})),r},_searchEngine:function(e){return e?0===e.search(td+"google.([^/?]*)")?"google":0===e.search(td+"bing.com")?"bing":0===e.search(td+"yahoo.com")?"yahoo":0===e.search(td+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=rd._searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(!Pr(t)){r.$search_engine=t;var i=Yn?jr(Yn.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=null==Yn?void 0:Yn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Ju,browserVersion:function(e,t){var n=Ju(e,t),r=Ku[n];if(Fr(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<Qu.length;t++){var[n,r]=Qu[t],i=n.exec(e),o=i&&(Tr(r)?r(i,e):r);if(o)return o}return["",""]},device:ed,deviceType:function(e){var t=ed(e);return t===du||t===uu||"Kobo"===t||"Kindle Fire"===t||t===Wu?cu:t===Ru||t===Nu||t===Au||t===Bu?"Console":t===pu?"Wearable":t?su:"Desktop"},referrer:function(){return(null==Yn?void 0:Yn.referrer)||"$direct"},referringDomain:function(){var e;return null!=Yn&&Yn.referrer&&(null===(e=Zr(Yn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==Xn?void 0:Xn.href}},initialPersonPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=Zr(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=Zr(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,ar(this._campaignParamsFromUrl(r),(function(e,t){i["$initial_"+vr(t)]=e}))}n&&ar(this._searchInfoFromReferrer(n),(function(e,t){i["$initial_"+vr(t)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},properties:function(){if(!er)return{};var[e,t]=rd.os(er);return lr(pr({$os:e,$os_version:t,$browser:rd.browser(er,navigator.vendor),$device:rd.device(er),$device_type:rd.deviceType(er),$timezone:rd.timezone()}),{$current_url:null==Xn?void 0:Xn.href,$host:null==Xn?void 0:Xn.host,$pathname:null==Xn?void 0:Xn.pathname,$raw_user_agent:er.length>1e3?er.substring(0,997)+"...":er,$browser_version:rd.browserVersion(er,navigator.vendor),$browser_language:rd.browserLanguage(),$screen_height:null==Vn?void 0:Vn.screen.height,$screen_width:null==Vn?void 0:Vn.screen.width,$viewport_height:null==Vn?void 0:Vn.innerHeight,$viewport_width:null==Vn?void 0:Vn.innerWidth,$lib:"web",$lib_version:$n.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!er)return{};var[e,t]=rd.os(er);return lr(pr({$os:e,$os_version:t,$browser:rd.browser(er,navigator.vendor)}),{$browser_version:rd.browserVersion(er,navigator.vendor)})}},id=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class od{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&rr.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===id.indexOf(e.persistence.toLowerCase())&&(rr.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Qc.is_supported()?Qc:"localstorage+cookie"===t&&tu.is_supported()?tu:"sessionstorage"===t&&ou.is_supported()?ou:"memory"===t?ru:"cookie"===t?Jc:tu.is_supported()?tu:Jc}properties(){var e={};return ar(this.props,(function(t,n){if(n===vi&&Ar(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else s=n,a=!1,(Pr(o=Mi)?a:jn&&o.indexOf===jn?-1!=o.indexOf(s):(ar(o,(function(e){if(a||(a=e===s))return ir})),a))||(e[n]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=lr({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Ar(e)){Fr(t)&&(t="None"),this.expire_days=Fr(n)?this.default_expiry:n;var r=!1;if(ar(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(Ar(e)){this.expire_days=Fr(t)?this.default_expiry:t;var n=!1;if(ar(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=rd.campaignParams(this.config.custom_campaign_params);Nr(pr(e))||this.register(rd.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0}}update_search_keyword(){this.register(rd.searchInfo())}update_referrer_info(){this.register_once(rd.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ii]||this.props[ki]||this.register_once({[Ei]:rd.initialPersonInfo()},void 0)}get_referrer_info(){return pr({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};ar([ki,Ii],(t=>{var n=this.props[t];n&&ar(n,(function(t,n){e["$initial_"+vr(n)]=t}))}));var t=this.props[Ei];if(t){var n=rd.initialPersonPropsFromInfo(t);lr(e,n)}return e}safe_merge(e){return ar(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[Jr]||{};n[e]=t,this.props[Jr]=n,this.save()}remove_event_timer(e){var t=(this.props[Jr]||{})[e];return Fr(t)||(delete this.props[Jr][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function sd(e){var t,n;return(null===(t=JSON.stringify(e,(n=[],function(e,t){if(Ar(t)){for(;n.length>0&&n.at(-1)!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function ad(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[ad({size:sd(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),ad({size:sd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var ld=(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))(ld||{}),cd=(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))(cd||{});function ud(e,t,n,r){return t>n&&(rr.warn("min cannot be greater than max."),t=n),Br(e)?e>n?(r&&rr.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&rr.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&rr.warn(r+" must be a number. Defaulting to max value:"+n),n)}class dd{constructor(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,"bucketSize",100),i(this,"refillRate",10),i(this,"mutationBuckets",{}),i(this,"loggedTracker",{}),i(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),i(this,"getNodeOrRelevantParent",(e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[this.rrweb.mirror.getId(n),n]}return[e,t]})),i(this,"numberOfChanges",(e=>{var t,n,r,i,o,s,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)})),i(this,"throttleMutations",(e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t,n,r,[i,o]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[i])return!1;(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i])&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(n=(r=this.options).onBlockedNode)||void 0===n||n.call(r,i,o)));return e})));var r=this.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=e,this.options=r,this.refillRate=ud(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=ud(null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var hd=Uint8Array,pd=Uint16Array,vd=Uint32Array,gd=new hd([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fd=new hd([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),md=new hd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_d=function(e,t){for(var n=new pd(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new vd(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},yd=_d(gd,2),bd=yd[0],wd=yd[1];bd[28]=258,wd[258]=28;for(var Sd=_d(fd,0)[1],Cd=new pd(32768),Id=0;Id<32768;++Id){var kd=(43690&Id)>>>1|(21845&Id)<<1;kd=(61680&(kd=(52428&kd)>>>2|(13107&kd)<<2))>>>4|(3855&kd)<<4,Cd[Id]=((65280&kd)>>>8|(255&kd)<<8)>>>1}var Ed=function(e,t,n){for(var r=e.length,i=0,o=new pd(t);i<r;++i)++o[e[i]-1];var s,a=new pd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new pd(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Cd[d]>>>l]=c}else for(s=new pd(r),i=0;i<r;++i)s[i]=Cd[a[e[i]-1]++]>>>15-e[i];return s},xd=new hd(288);for(Id=0;Id<144;++Id)xd[Id]=8;for(Id=144;Id<256;++Id)xd[Id]=9;for(Id=256;Id<280;++Id)xd[Id]=7;for(Id=280;Id<288;++Id)xd[Id]=8;var Td=new hd(32);for(Id=0;Id<32;++Id)Td[Id]=5;var Md=Ed(xd,9,0),Rd=Ed(Td,5,0),Ad=function(e){return(e/8>>0)+(7&e&&1)},Nd=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof pd?pd:e instanceof vd?vd:hd)(n-t);return r.set(e.subarray(t,n)),r},Fd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Od=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ld=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new hd(0),0];if(1==i){var s=new hd(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new pd(h+1),v=Pd(n[u-1],p,0);if(v>t){r=0;var g=0,f=v-t,m=1<<f;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;g+=m-(1<<v-p[_]),p[_]=t}for(g>>>=f;g>0;){var y=o[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}v=t}return[new hd(p),v]},Pd=function(e,t,n){return-1==e.s?Math.max(Pd(e.l,t,n+1),Pd(e.r,t,n+1)):t[e.s]=n},Dd=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pd(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Bd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Hd=function(e,t,n){var r=n.length,i=Ad(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},qd=function(e,t,n,r,i,o,s,a,l,c,u){Fd(t,u++,n),++i[256];for(var d=Ld(i,15),h=d[0],p=d[1],v=Ld(o,15),g=v[0],f=v[1],m=Dd(h),_=m[0],y=m[1],b=Dd(g),w=b[0],S=b[1],C=new pd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=Ld(C,7),E=k[0],x=k[1],T=19;T>4&&!E[md[T-1]];--T);var M,R,A,N,F=c+5<<3,O=Bd(i,xd)+Bd(o,Td)+s,L=Bd(i,h)+Bd(o,g)+s+14+3*T+Bd(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=L)return Hd(t,u,e.subarray(l,l+c));if(Fd(t,u,1+(L<O)),u+=2,L<O){M=Ed(h,p,0),R=h,A=Ed(g,f,0),N=g;var P=Ed(E,x,0);Fd(t,u,y-257),Fd(t,u+5,S-1),Fd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)Fd(t,u+3*I,E[md[I]]);u+=3*T;for(var D=[_,w],B=0;B<2;++B){var H=D[B];for(I=0;I<H.length;++I){var q=31&H[I];Fd(t,u,P[q]),u+=E[q],q>15&&(Fd(t,u,H[I]>>>5&127),u+=H[I]>>>12)}}}else M=Md,R=xd,A=Rd,N=Td;for(I=0;I<a;++I)if(r[I]>255){q=r[I]>>>18&31;Od(t,u,M[q+257]),u+=R[q+257],q>7&&(Fd(t,u,r[I]>>>23&31),u+=gd[q]);var W=31&r[I];Od(t,u,A[W]),u+=N[W],W>3&&(Od(t,u,r[I]>>>5&8191),u+=fd[W])}else Od(t,u,M[r[I]]),u+=R[r[I]];return Od(t,u,M[256]),u+R[256]},Wd=new vd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$d=function(){for(var e=new vd(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Vd=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=$d[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Zd=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new hd(r+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(r,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Hd(l,c,e.subarray(u,d)):(l[u]=o,c=Hd(l,c,e.subarray(u,s)))}else{for(var h=Wd[t-1],p=h>>>13,v=8191&h,g=(1<<n)-1,f=new pd(32768),m=new pd(g+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new vd(25e3),S=new pd(288),C=new pd(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=m[M];if(f[R]=A,m[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=qd(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,L=0,P=v,D=R-A&32767;if(N>2&&M==b(u-D))for(var B=Math.min(p,N)-1,H=Math.min(32767,u),q=Math.min(258,N);D<=H&&--P&&R!=A;){if(e[u+O]==e[u+O-D]){for(var W=0;W<q&&e[u+W]==e[u+W-D];++W);if(W>O){if(O=W,L=D,W>B)break;var $=Math.min(D,W-2),V=0;for(F=0;F<$;++F){var Z=u-D+F+32768&32767,G=Z-f[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(L){w[E++]=268435456|wd[O]<<18|Sd[L];var U=31&wd[O],j=31&Sd[L];k+=gd[U]+fd[j],++S[257+U],++C[j],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=qd(e,l,o,w,S,C,k,E,T,u-T,c)}return Nd(a,0,r+Ad(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Gd=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Ud=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Gd(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},jd=function(e){return 10+(e.filename&&e.filename.length+1||0)};function zd(e,t){void 0===t&&(t={});var n=Vd(),r=e.length;n.p(e);var i=Zd(e,t,jd(t),8),o=i.length;return Ud(i,t),Gd(i,o-8,n.d()),Gd(i,o-4,r),i}function Yd(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new hd(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new hd(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return Nd(r,0,i)}var Xd=3e5,Jd=[cd.MouseMove,cd.MouseInteraction,cd.Scroll,cd.ViewportResize,cd.Input,cd.TouchMove,cd.MediaInteraction,cd.Drag],Kd=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),Qd="[SessionRecording]";function eh(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(zd(Yd(JSON.stringify(e))),!0)}function th(e){return e.type===ld.Custom&&"sessionIdle"===e.data.tag}function nh(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class rh{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==tr||null===(e=tr.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Qd+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:Xd}get isSampled(){var e=this.instance.get_property(di);return Hr(e)?e:null}get sessionDuration(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get isRecordingEnabled(){var e=!!this.instance.get_property(ii),t=!this.instance.config.disable_session_recording;return Vn&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(oi),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,n,r,i,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(ai),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(n=null!==(r=null==s?void 0:s.canvasFps)&&void 0!==r?r:null==a?void 0:a.fps)&&void 0!==n?n:0,u=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:0;return{enabled:l,fps:ud(c,0,12,"canvas recording fps"),quality:ud(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,n=this.instance.get_property(si),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=Ar(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Hr(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(li);return Br(e)?e:null}get minimumDuration(){var e=this.instance.get_property(ci);return Br(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?Dr(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":this._urlBlocked?"paused":Hr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(hi))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(pi))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(i(this,"queuedRRWebEvents",[]),i(this,"isIdle",!1),i(this,"_linkedFlagSeen",!1),i(this,"_lastActivityTimestamp",Date.now()),i(this,"_linkedFlag",null),i(this,"_removePageViewCaptureHook",void 0),i(this,"_onSessionIdListener",void 0),i(this,"_persistDecideOnSessionListener",void 0),i(this,"_samplingSessionListener",void 0),i(this,"_urlTriggers",[]),i(this,"_urlBlocklist",[]),i(this,"_urlBlocked",!1),i(this,"_eventTriggers",[]),i(this,"_removeEventTriggerCaptureHook",void 0),i(this,"_forceAllowLocalhostNetworkCapture",!1),i(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),i(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),i(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),i(this,"_onVisibilityChange",(()=>{if(null!=Yn&&Yn.visibilityState){var e="window "+Yn.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw rr.error(Qd+" started without valid sessionManager"),new Error(Qd+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&rr.warn(Qd+" session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==Vn||Vn.addEventListener("beforeunload",this._onBeforeUnload),null==Vn||Vn.addEventListener("offline",this._onOffline),null==Vn||Vn.addEventListener("online",this._onOnline),null==Vn||Vn.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Dr(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook((e=>{try{if("$pageview"===e){var t=Vn?this._maskUrl(Vn.location.href):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){rr.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var r,i,o,s;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i||i.unregister(pi),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(hi))})))):this.stopRecording()}stopRecording(){var e,t,n,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==Vn||Vn.removeEventListener("beforeunload",this._onBeforeUnload),null==Vn||Vn.removeEventListener("offline",this._onOffline),null==Vn||Vn.removeEventListener("online",this._onOnline),null==Vn||Vn.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(r=this._samplingSessionListener)||void 0===r||r.call(this),this._samplingSessionListener=void 0,rr.info(Qd+" stopped"))}makeSamplingDecision(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Br(r)){var i,o=this.isSampled,s=n||!Hr(o);if(s)i=Math.random()<r;else i=o;s&&(i?this._reportStarted("sampled"):rr.warn(Qd+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r,isSampled:i})),null===(t=this.instance.persistence)||void 0===t||t.register({[di]:i})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[di]:null})}}afterDecideResponse(e){var t,n,r,i,o,s;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!Dr(this._linkedFlag)&&!this._linkedFlagSeen){var a=Or(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=Or(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var n=Ar(t)&&a in t,r=l?t[a]===l:n;r&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=r}))}null!==(r=e.sessionRecording)&&void 0!==r&&r.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(i=e.sessionRecording)&&void 0!==i&&i.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Br(this.sampleRate)&&Dr(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistDecideResponse(e){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var n,i,o,s,a,l,c,u=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,d=Dr(u)?null:parseFloat(u),h=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;r.register({[ii]:!!e.sessionRecording,[oi]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[si]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[ai]:{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality},[li]:d,[ci]:Fr(h)?null:h})};i(),null===(n=this._persistDecideOnSessionListener)||void 0===n||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!Fr(Object.assign)&&!Fr(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=tr.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"recorder",(e=>{if(e)return rr.error(Qd+" could not load recorder",e);this._onScriptLoaded()}));rr.info(Qd+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==Jd.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==i,s=this.windowId!==r;this.windowId=r,this.sessionId=i,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):rr.warn(Qd+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Kd((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Kd((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording;for(var[i,o]of Object.entries(r||{}))i in n&&("maskInputOptions"===i?n.maskInputOptions=t({password:!0},o):n[i]=o);if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new dd(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");rr.info(n,{node:t}),this.log(Qd+" "+n,"warn")}});var s=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:e=>{this.onRRwebEmit(e)},plugins:s},n)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:s.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else rr.error(Qd+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,n,r,i=[],o=null===(e=tr.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&i.push(o());var s=null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.rrwebPlugins)||void 0===r?void 0:r.getRecordNetworkPlugin;this.networkPayloadCapture&&Tr(s)&&(!Vr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(po(this.instance.config,this.networkPayloadCapture))):rr.info(Qd+" NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var n;if(this._processQueuedEvents(),e&&Ar(e)){if(e.type===ld.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),"paused"!==this.status||function(e){return e.type===ld.Custom&&"recording paused"===e.data.tag}(e)){e.type===ld.FullSnapshot&&this._scheduleFullSnapshot(),e.type===ld.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&Ar(t)&&6===t.type&&Ar(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(o),!this.isIdle||th(o)){if(th(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,l=s.threshold;o.timestamp=a+l}}var c=null===(n=this.instance.config.session_recording.compress_events)||void 0===n||n?function(e){if(sd(e)<1024)return e;try{if(e.type===ld.FullSnapshot)return t(t({},e),{},{data:eh(e.data),cv:"2024-10"});if(e.type===ld.IncrementalSnapshot&&e.data.source===cd.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:eh(e.data.texts),attributes:eh(e.data.attributes),removes:eh(e.data.removes),adds:eh(e.data.adds)})});if(e.type===ld.IncrementalSnapshot&&e.data.source===cd.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:eh(e.data.adds),removes:eh(e.data.removes)})})}catch(e){rr.error(Qd+" could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:sd(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(u):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Vn){var e=this._maskUrl(Vn.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,n=Br(t)&&t>=0,r=Br(e)&&n&&t<e;if("buffering"===this.status||r)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&ad(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}));return this.clearBuffer()}_captureSnapshotBuffered(e){var t,n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==Vn&&Vn.location.href){var e=Vn.location.href,t="paused"===this.status,n=nh(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),nh(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({["url"===e?hi:pi]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;"paused"!==this.status&&(this._urlBlocked=!0,null==Yn||null===(e=Yn.body)||void 0===e||null===(t=e.classList)||void 0===t||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout((()=>{this._flushBuffer()}),100),rr.info(Qd+" recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;"paused"===this.status&&(this._urlBlocked=!1,null==Yn||null===(e=Yn.body)||void 0===e||null===(t=e.classList)||void 0===t||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),rr.info(Qd+" recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&Dr(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){rr.error(Qd+"Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[di]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),rr.info(Qd+" "+e.replace("_"," "),t),cr(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}class ih{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){var e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(fi),group_properties:this.instance.get_property(mi),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:yr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)rr.error("Failed to fetch feature flags from PostHog.");else{if(!Yn||!Yn.body)return rr.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r=function(e,n){var r,i;tr["__$$ph_site_app_".concat(e)]=t.instance,null===(r=tr.__PosthogExtensions__)||void 0===r||null===(i=r.loadSiteApp)||void 0===i||i.call(r,t.instance,n,(t=>{if(t)return rr.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:i,url:o}of e.siteApps)r(i,o)}else e.siteApps.length>0&&rr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}var oh,sh=null!=Vn&&Vn.location?zr(Vn.location.hash,"__posthog")||zr(location.hash,"state"):null,ah="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(oh||(oh={}));class lh{constructor(e){this.instance=e}setToolbarState(e){tr.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=tr.ph_toolbar_state)&&void 0!==e?e:oh.UNINITIALIZED}maybeLoadToolbar(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Vn||!Yn)return!1;n=null!==(e=n)&&void 0!==e?e:Vn.location,i=null!==(t=i)&&void 0!==t?t:Vn.history;try{if(!r){try{Vn.localStorage.setItem("test","test"),Vn.localStorage.removeItem("test")}catch(e){return!1}r=null==Vn?void 0:Vn.localStorage}var o,s=sh||zr(n.hash,"__posthog")||zr(n.hash,"state"),a=s?dr((()=>JSON.parse(atob(decodeURIComponent(s)))))||dr((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(ah)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){(tr.ph_load_toolbar||tr.ph_load_editor)(e,this.instance)}loadToolbar(e){var n=!(null==Yn||!Yn.getElementById(Ti));if(!Vn||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Vn.localStorage.setItem(ah,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===oh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===oh.UNINITIALIZED){var o,s;this.setToolbarState(oh.LOADING),null===(o=tr.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(e=>{if(e)return rr.error("Failed to load toolbar",e),void this.setToolbarState(oh.UNINITIALIZED);this.setToolbarState(oh.LOADED),this._callLoadToolbar(i)})),mr(Vn,"turbolinks:load",(()=>{this.setToolbarState(oh.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class ch{constructor(e){i(this,"isPaused",!0),i(this,"queue",[]),i(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},n=Object.values(e),r=[...n.filter((e=>0===e.url.indexOf("/e"))),...n.filter((e=>0!==e.url.indexOf("/e")))];r.map((e=>{this.sendRequest(t(t({},e),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&xr(r.data)&&ar(r.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return ar(this.queue,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;Fr(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}var uh=!!Kn||!!Jn,dh="text/plain",hh=(e,n)=>{var[r,i]=e.split("?"),o=t({},n);null==i||i.split("&").forEach((e=>{var[t]=e.split("=");delete o[t]}));var s=Ur(o);return s=s?(i?i+"&":"")+s:i,"".concat(r,"?").concat(s)},ph=e=>{var{data:t,compression:n}=e;if(t){if(n===yr.GZipJS){var r=zd(Yd(JSON.stringify(t)),{mtime:0}),i=new Blob([r],{type:dh});return{contentType:dh,body:i,estimatedSize:i.size}}if(n===yr.Base64){var o=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=fr(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[l++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(JSON.stringify(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=JSON.stringify(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},vh=[];Kn&&vh.push({transport:"XHR",method:e=>{var t,n=new Kn;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=null!==(t=ph(e))&&void 0!==t?t:{};ar(e.headers,(function(e,t){n.setRequestHeader(t,e)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(i)}}),Jn&&vh.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:i,estimatedSize:o}=null!==(t=ph(e))&&void 0!==t?t:{},s=new Headers;ar(e.headers,(function(e,t){s.append(t,e)})),r&&s.append("Content-Type",r);var a=e.url,l=null;if(Qn){var c=new Qn;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}Jn(a,{method:(null==e?void 0:e.method)||"GET",headers:s,keepalive:"POST"===e.method&&(o||0)<52428.8,body:i,signal:null===(n=l)||void 0===n?void 0:n.signal}).then((t=>t.text().then((n=>{var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){rr.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)})))).catch((t=>{var n;rr.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>l?clearTimeout(l.timeout):null))}}),null!=zn&&zn.sendBeacon&&vh.push({transport:"sendBeacon",method:e=>{var t=hh(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=null!==(n=ph(e))&&void 0!==n?n:{},o="string"==typeof i?new Blob([i],{type:r}):i;zn.sendBeacon(t,o)}catch(e){}}});var gh=["retriesPerformedSoFar"];class fh{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!Fr(Vn)&&"onLine"in Vn.navigator&&(this.areWeOnline=Vn.navigator.onLine,Vn.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),Vn.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=o(e,gh);Br(n)&&n>0&&(r.url=hh(r.url,{retry_count:n})),this.instance._send_request(t(t({},r),{},{callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?this.enqueue(t({retriesPerformedSoFar:n},r)):null===(i=r.callback)||void 0===i||i.call(r,e)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),rr.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(t(t({},e),{},{transport:"sendBeacon"}))}catch(e){rr.error(e)}this.queue=[]}}var mh;class _h{constructor(e,t,n,r){var o;i(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Gc,this._windowIdGenerator=r||Gc;var s=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ud(a,60,1800,"session_idle_timeout_seconds"),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=ou.parse(this._window_id_storage_key),c=ou.parse(this._primary_window_exists_storage_key);l&&!c?this._windowId=l:ou.remove(this._window_id_storage_key),ou.set(this._primary_window_exists_storage_key,!0)}if(null!==(o=this.config.bootstrap)&&void 0!==o&&o.sessionID)try{var u=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),u)}catch(e){rr.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Fr(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&ou.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ou.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?ou.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[ui]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ui];return xr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==Vn||Vn.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&ou.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),[n,r,i]=this._getSessionId(),o=this._getWindowId(),s=Br(i)&&i>0&&Math.abs(t-i)>864e5,a=!1,l=!r,c=!e&&Math.abs(t-n)>this.sessionTimeoutMs;l||c||s?(r=this._sessionIdGenerator(),o=this._windowIdGenerator(),rr.info("[SessionId] new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),i=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);var u=0===n||!e||s?t:n,d=0===i?(new Date).getTime():i;return this._setWindowId(o),this._setSessionId(r,u,d),a&&this._sessionIdChangedHandlers.forEach((e=>e(r,o,a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}:void 0))),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:n}}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(mh||(mh={}));var yh="i.posthog.com";class bh{constructor(e){i(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(yh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mh.EU:this._regionCache[this.apiHost]=mh.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===mh.CUSTOM)return this.apiHost+t;var n=yh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}var wh="posthog-js";function Sh(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===i||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.map((e=>{e.stacktrace&&(e.stacktrace.type="raw")}));var p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags,$level:o.level};return t&&n&&(p.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class Ch{constructor(e,t,n,r,i){this.name=wh,this.setupOnce=function(o){o(Sh(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}}}function Ih(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||Gc();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(wi,"identified")),t()},i=n.user();"then"in i&&Tr(i.then)?i.then((e=>r(e))):r(i)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||rr.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,n)=>{var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rr.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rr.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class kh{constructor(e){this._instance=e}doPageView(e){var t,n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==Vn?void 0:Vn.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,n=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!n)return{};var i={};if(r){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(Fr(o)||Fr(s)||Fr(a)||Fr(l)||Fr(c)||Fr(u)))o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),i={$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:o<=1?1:ud(s/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:ud(a/o,0,1),$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:l<=1?1:ud(c/l,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:l<=1?1:ud(u/l,0,1)}}return t&&(i.$prev_pageview_pathname=t),n&&(i.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),i}}class Eh{constructor(){i(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.events[e]||[])n(t);for(var r of this.events["*"]||[])r(e,t)}}class xh{constructor(e){i(this,"_debugEventEmitter",new Eh),i(this,"checkStep",((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),i(this,"checkStepEvent",((e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event))),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!Fr(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,n;if(!Fr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,i=new Set;e.forEach((e=>{var t;null===(t=e.steps)||void 0===t||t.forEach((e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(i)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(null!=t&&t.url){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!xh.matchString(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!Vn&&Gr(e,t);case"exact":return t===e;case"contains":var r=xh.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Gr(e,r);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!xh.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!xh.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!xh.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1;if(null!=t&&t.selector){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!r)return!1;if(!r.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class Th{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;Fr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new xh(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,n,r,i,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(r=n.actions)&&void 0!==r&&r.values&&(null===(i=e.conditions)||void 0===i||null===(o=i.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){var n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0!==e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,r;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r||r.forEach((t=>{if(t&&t.name){var n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}}onEvent(e,t){var n,r,i=(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r?void 0:r.props[yi])||[];if(Th.SURVEY_SHOWN_EVENT_NAME==e&&t&&i.length>0){var o,s=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n,r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[yi])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[yi]:[...new Set(e)]})}getSurveys(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[yi];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(Th,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Mh="[Surveys]",Rh={icontains:e=>!!Vn&&Vn.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!Vn&&-1===Vn.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!Vn&&Gr(Vn.location.href,e),not_regex:e=>!!Vn&&!Gr(Vn.location.href,e),exact:e=>(null==Vn?void 0:Vn.location.href)===e,is_not:e=>(null==Vn?void 0:Vn.location.href)!==e};class Ah{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);null!=n&&n.startsWith(ws)&&e.push(n)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){var e,t,n,r=null==tr||null===(e=tr.__PosthogExtensions__)||void 0===e?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||r||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Th(this.instance)),null===(t=tr.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"surveys",(e=>{var t,n;if(e)return rr.error(Mh,"Could not load surveys script",e);this._surveyManager=null===(t=tr.__PosthogExtensions__)||void 0===t||null===(n=t.generateSurveys)||void 0===n?void 0:n.call(t,this.instance)})))}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Th(this.instance));var n=this.instance.get_property(_i);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:t=>{var n;if(200!==t.statusCode||!t.json)return e([]);var r,i=t.json.surveys||[],o=i.filter((e=>{var t,n,r,i,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));o.length>0&&(null===(r=this._surveyEventReceiver)||void 0===r||r.register(o));return null===(n=this.instance.persistence)||void 0===n||n.register({[_i]:i}),e(i)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n,r=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Rh[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(i=e.conditions)||void 0===i||!i.selector||(null==Yn?void 0:Yn.querySelector(e.conditions.selector));return o&&s})),i=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),o=r.filter((e=>{var t,n,r,o,s,a,l,c,u,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),v=(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(o=e.conditions)||void 0===o||null===(s=o.events)||void 0===s?void 0:s.values.length)>0,g=(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.values.length)>0,f=!v&&!g||(null==i?void 0:i.includes(e.id)),m=this._canActivateRepeatedly(e),_=!(e.internal_targeting_flag_key&&!m)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&p&&_&&f}));return e(o)}),t)}getNextSurveyStep(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?Lo.End:o;if(i.branching.type===Lo.End)return Lo.End;if(i.branching.type===Lo.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Lo.ResponseBased){if(i.type===Oo.SingleChoice){var s,a,l=i.choices.indexOf("".concat(n));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var c=i.branching.responseValues[l];return Number.isInteger(c)?c:c===Lo.End?Lo.End:o}}else if(i.type===Oo.Rating){var u,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,i.scale);if(null!==(u=i.branching)&&void 0!==u&&null!==(d=u.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var p=i.branching.responseValues[h];return Number.isInteger(p)?p:p===Lo.End?Lo.End:o}}return o}return rr.warn(Mh,"Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Dr(null===(t=tr.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(rr.warn(Mh,"canActivateRepeatedly is not defined, must init before calling"),!1):tr.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Dr(this._surveyManager)?rr.warn(Mh,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((t=>{var n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){Dr(this._surveyManager)?rr.warn(Mh,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((n=>{var r=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(r,null==Yn?void 0:Yn.querySelector(t))}))}}class Nh{constructor(e){var t,n;i(this,"serverLimits",{}),i(this,"lastEventRateLimited",!1),i(this,"checkForLimiting",(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{rr.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void rr.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Ci))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||r||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(Ci,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Fh=()=>t({initialPathName:(null==Xn?void 0:Xn.pathname)||"",referringDomain:rd.referringDomain()},rd.campaignParams());class Oh{constructor(e,t,n){i(this,"_onSessionIdCallback",(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[Si]:n})}})),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=n||Fh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Si]}getSessionProps(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}var Lh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Ph=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Lh.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Dh=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Ph(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((e=>Ph(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Bh="[Dead Clicks]",Hh=()=>!0,qh=e=>{var t,n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(ni)),r=e.instance.config.capture_dead_clicks;return Hr(r)?r:n};class Wh{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}afterDecideResponse(e){this.instance.persistence&&this.instance.persistence.register({[ni]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,n,r;null!==(t=tr.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"dead-clicks-autocapture",(t=>{t?rr.error(Bh+" failed to load script",t):e()}))}start(){var e;if(Yn){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=tr.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=Ar(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=tr.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Yn),rr.info("".concat(Bh," starting..."))}}else rr.error(Bh+" `document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,rr.info("".concat(Bh," stopping...")))}}class $h{constructor(e){var t;i(this,"rageclicks",new Cc),i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Qr]),null==Vn||Vn.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){var e=5e3;return Ar(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Fr(this.instance.config.capture_heatmaps)?Fr(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;rr.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}afterDecideResponse(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Qr]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){Vn&&Yn&&(mr(Yn,"click",(e=>this._onClick(e||(null==Vn?void 0:Vn.event))),!1,!0),mr(Yn,"mousemove",(e=>this._onMouseMove(e||(null==Vn?void 0:Vn.event))),!1,!0),this.deadClicksCapture=new Wh(this.instance,Hh,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&Ai(r)&&!Ni(r,"body");){if(r===n)return!1;if(cr(t,null==Vn?void 0:Vn.getComputedStyle(r).position))return!0;r=$i(r)}return!1}(qi(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}_onClick(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!Ri(e.target)){var i=this._getProperties(e,r);null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){Ri(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Vn){var t=Vn.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Nr(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Vh{constructor(e){i(this,"_updateScrollData",(()=>{var e,t,n,r;this.context||(this.context={});var i=this.scrollElement(),o=this.scrollY(),s=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=o+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(r=this.context.maxContentHeight)&&void 0!==r?r:0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){null==Vn||Vn.addEventListener("scroll",this._updateScrollData,!0),null==Vn||Vn.addEventListener("scrollend",this._updateScrollData,!0),null==Vn||Vn.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==Vn?void 0:Vn.document.documentElement;var e=xr(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var n=null==Vn?void 0:Vn.document.querySelector(t);if(n)return n}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Vn&&(Vn.scrollY||Vn.pageYOffset||Vn.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Vn&&(Vn.scrollX||Vn.pageXOffset||Vn.document.documentElement.scrollLeft)||0}}class Zh{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,n,r;Fr(this._restoreXHRPatch)&&(null===(e=tr.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));Fr(this._restoreFetchPatch)&&(null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.tracingHeadersPatchFns)||void 0===r||r._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,n,r;null!==(t=tr.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"tracing-headers",(t=>{if(t)return rr.error("[TRACING-HEADERS] failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Gh;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Gh||(Gh={}));class Uh{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Gh.DENIED:this.storedConsent}isOptedOut(){return this.consent===Gh.DENIED||this.consent===Gh.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?Gh.GRANTED:"0"===e?Gh.DENIED:Gh.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Qc:Jc;var t="localStorage"===e?Jc:Qc;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!_r([null==zn?void 0:zn.doNotTrack,null==zn?void 0:zn.msDoNotTrack,tr.doNotTrack],(e=>cr([!0,1,"1","yes"],e)))}}var jh="[Exception Autocapture]";class zh{constructor(e){var t;i(this,"originalOnUnhandledRejectionHandler",void 0),i(this,"startCapturing",(()=>{var e,t,n,r;if(Vn&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var i=null===(e=tr.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.errorWrappingFunctions)||void 0===r?void 0:r.wrapUnhandledRejection;if(i&&o)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){rr.error(jh+" failed to start",e),this.stopCapturing()}else rr.error(jh+" failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ei]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==Vn||null===(e=Vn.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(rr.info(jh+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=tr.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return rr.error(jh+" failed to load script",t);e()}))}stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}afterDecideResponse(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[ei]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var Yh=9e5,Xh="[Web Vitals]";class Jh{constructor(e){var n;i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),i(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,n)=>t(t({},e),{},{["$web_vitals_".concat(n.name,"_event")]:t({},n),["$web_vitals_".concat(n.name,"_value")]:n.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),i(this,"_addToBuffer",(e=>{var n,r=null===(n=this.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(Fr(r))rr.error(Xh+"Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this._currentURL();if(!Fr(i))if(Dr(null==e?void 0:e.name)||Dr(null==e?void 0:e.value))rr.error(Xh+"Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)rr.error(Xh+"Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Fr(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=Fr(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(t(t({},e),{},{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}})),i(this,"_startCapturing",(()=>{var e,t,n,r,i=tr.__PosthogExtensions__;Fr(i)||Fr(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._addToBuffer.bind(this)),this._initialized=!0):rr.error(Xh+"web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ti]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Ar(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return Fr(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ri])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ar(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=Ar(this.instance.config.capture_performance)&&Br(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Yh;return 0<e&&e<=6e4?Yh:e}get isEnabled(){var e=Ar(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Hr(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(rr.info(Xh+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){var t=Ar(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Ar(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ti]:t}),this.instance.persistence.register({[ri]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,r;null!==(t=tr.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=tr.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"web-vitals",(t=>{t?rr.error(Xh+" failed to load script",t):e()}))}_currentURL(){var e=Vn?Vn.location.href:void 0;return e||rr.error(Xh+"Could not determine current URL"),e}}var Kh={icontains:(e,t)=>!!Vn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Vn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Vn&&Gr(t.href,e),not_regex:(e,t)=>!!Vn&&!Gr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Qh{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{Qh.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key&&t._featureFlags&&t._featureFlags[e.feature_flag_key]){var n;if(t._flagToExperiments)Qh.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null===(n=t._flagToExperiments)||void 0===n||n.set(e.feature_flag_key,e);var r=t._featureFlags[e.feature_flag_key];r&&e.variants[r]&&t.applyTransforms(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var i in e.variants){var o=e.variants[i];Qh.matchesTestVariant(o)&&t.applyTransforms(e.name,i,o.transforms)}}))}),e)})),this.instance=e;this.instance.onFeatureFlags&&this.instance.onFeatureFlags((e=>{this.applyFeatureFlagChanges(e)})),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){Dr(this._flagToExperiments)||this.instance.config.disable_web_experiments||(Qh.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n,r=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);r&&null!=i&&i.variants[r]&&this.applyTransforms(i.name,r,i.variants[r].transforms)}})))}afterDecideResponse(e){this._is_bot()?Qh.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){var e=Qh.getWindowLocation();if(null!=e&&e.search){var t=jr(null==e?void 0:e.search,"__experiment_id"),n=jr(null==e?void 0:e.search,"__experiment_variant");t&&n&&(Qh.logInfo("previewing web experiments ".concat(t," && ").concat(n)),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);var r=this.instance.get_property("$web_experiments");if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){var r=n.filter((t=>t.id===e));r&&r.length>0&&(Qh.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(r[0].name,t,r[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!Dr(e.conditions)&&(Qh.matchUrlConditions(e)&&Qh.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(Dr(e.conditions)||Dr(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var n,r,i,o=Qh.getWindowLocation();return!!o&&(null===(n=e.conditions)||void 0===n||!n.url||Kh[null!==(r=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==Vn?void 0:Vn.location}static matchUTMConditions(e){var t;if(Dr(e.conditions)||Dr(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var n=rd.campaignParams();if(n.utm_source){var r,i,o,s,a,l,c,u,d,h,p,v,g,f,m,_,y=null===(r=e.conditions)||void 0===r||null===(i=r.utm)||void 0===i||!i.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,w=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(v=p.utm)||void 0===v?void 0:v.utm_medium)==n.utm_medium,S=null===(g=e.conditions)||void 0===g||null===(f=g.utm)||void 0===f||!f.utm_term||(null===(m=e.conditions)||void 0===m||null===(_=m.utm)||void 0===_?void 0:_.utm_term)==n.utm_term;return y&&w&&S&&b}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];rr.info("[WebExperiments] ".concat(e),n)}applyTransforms(e,t,n,r){var i;this._is_bot()?Qh.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var i;Qh.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),n);var o,s=0,a=null===(i=document)||void 0===i?void 0:i.querySelectorAll(n.selector);if(null==a||a.forEach((e=>{var t=e;s+=1,n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})),this.instance&&this.instance.capture)this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:r,$web_experiment_document_url:null===(o=Qh.getWindowLocation())||void 0===o?void 0:o.href,$web_experiment_elements_modified:s})}})):(Qh.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:r,$web_experiment_variant:t,$web_experiment_document_url:null===(i=Qh.getWindowLocation())||void 0===i?void 0:i.href,$web_experiment_elements_modified:0}))}_is_bot(){return zn&&this.instance?Dh(zn,this.instance.config.custom_blocked_useragents):void 0}}class ep{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var tp={},np=()=>{},rp="posthog",ip=!uh&&-1===(null==er?void 0:er.indexOf("MSIE"))&&-1===(null==er?void 0:er.indexOf("Mozilla")),op=()=>{var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==Yn?void 0:Yn.location,n=null==t?void 0:t.hostname,!!Or(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",loaded:np,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Xn&&Or(null==Xn?void 0:Xn.search)&&-1!==Xn.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Vn||null===(e=Vn.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;rr.error(t)},get_device_id:e=>e,_onCapture:np,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},sp=e=>{var t={};Fr(e.process_person)||(t.person_profiles=e.process_person),Fr(e.xhr_headers)||(t.request_headers=e.xhr_headers),Fr(e.cookie_name)||(t.persistence_name=e.cookie_name),Fr(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=lr({},t,e);return xr(e.property_blacklist)&&(Fr(e.property_denylist)?n.property_denylist=e.property_blacklist:xr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:rr.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class ap{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){rr.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class lp{constructor(){i(this,"webPerformance",new ap),i(this,"version",$n.LIB_VERSION),i(this,"_internalEventEmitter",new Eh),this.config=op(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ch,this.sentryIntegration=e=>function(e,t){var n=Sh(e,t);return{name:wh,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Bc(this),this.toolbar=new lh(this),this.scrollManager=new Vh(this),this.pageViewManager=new kh(this),this.surveys=new Ah(this),this.experiments=new Qh(this),this.exceptions=new ep(this),this.rateLimiter=new Nh(this),this.requestRouter=new bh(this),this.consent=new Uh(this),this.people={set:(e,t,n)=>{var r=Or(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{var r=Or(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",(e=>rr.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,n){if(n&&n!==rp){var r,i=null!==(r=tp[n])&&void 0!==r?r:new lp;return i._init(e,t,n),tp[n]=i,tp[rp][n]=i,i}return this._init(e,t,n)}_init(e){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(Fr(e)||Lr(e))return rr.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return rr.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(lr({},op(),sp(i),{name:o,token:e})),this.config.on_xhr_error&&rr.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:yr.GZipJS,this.persistence=new od(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new od(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),a=t({},this.sessionPersistence.props);if(this._requestQueue=new ch((e=>this._send_retriable_request(e))),this._retryQueue=new fh(this),this.__request_queue=[],this.sessionManager=new _h(this.config,this.persistence),this.sessionPropsManager=new Oh(this.sessionManager,this.persistence),new Zh(this).startIfEnabledOrStop(),this.sessionRecording=new rh(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Tc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new $h(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Jh(this),this.exceptionObserver=new zh(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Wh(this,qh),this.deadClicksAutocapture.startIfEnabled(),$n.DEBUG=$n.DEBUG||this.config.debug,$n.DEBUG&&rr.info("Starting in debug mode",{this:this,config:i,thisC:t({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,u=this.config.get_device_id(Gc()),d=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?u:i.bootstrap.distinctID;this.persistence.set_property(wi,null!==(c=i.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var h,p,v=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),g=Object.keys((null===(p=i.bootstrap)||void 0===p?void 0:p.featureFlagPayloads)||{}).filter((e=>v[e])).reduce(((e,t)=>{var n,r,o,s;null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(!this.get_distinct_id()){var f=this.config.get_device_id(Gc());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(wi,"anonymous")}return null==Vn||null===(r=Vn.addEventListener)||void 0===r||r.call(Vn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),i.segment?Ih(this,(()=>this._loaded())):this._loaded(),Tr(this.config._onCapture)&&this.config._onCapture!==np&&(rr.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_afterDecideResponse(e){var t,n,r,i,o,s,a,l,c;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=cr(e.supportedCompression,yr.GZipJS)?yr.GZipJS:cr(e.supportedCompression,yr.Base64)?yr.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.experiments)||void 0===o||o.afterDecideResponse(e),null===(s=this.surveys)||void 0===s||s.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(l=this.exceptionObserver)||void 0===l||l.afterDecideResponse(e),null===(c=this.deadClicksAutocapture)||void 0===c||c.afterDecideResponse(e)}_loaded(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){rr.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),e||(new ih(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||sr(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(ip?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=hh(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=hh(o.url,{_:(new Date).getTime().toString(),ver:$n.LIB_VERSION,compression:o.compression});var s=null!==(n=o.transport)&&void 0!==n?n:"XHR",a=null!==(r=null===(i=_r(vh,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==r?r:vh[0].method;if(!a)throw new Error("No available transport method");a(o)})(t(t({},e),{},{callback:t=>{var n,r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(r=(i=this.config).on_request_error)||void 0===r||r.call(i,t));null===(n=e.callback)||void 0===n||n.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,n=[],r=[],i=[];sr(e,(e=>{e&&(t=e[0],xr(t)?i.push(e):Tr(e)?e.call(this):xr(e)&&"alias"===t?n.push(e):xr(e)&&-1!==t.indexOf("capture")&&Tr(this[t])?i.push(e):r.push(e))}));var o=function(e,t){sr(e,(function(e){if(xr(e[0])){var n=t;ar(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(r,this),o(i,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Fr(e)&&Or(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(null==r?void 0:r.timestamp)||s,l={uuid:Gc(),event:e,properties:this._calculate_event_properties(e,n||{},a)};o&&(l.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(l.$set=null==r?void 0:r.$set);var c=this._calculate_set_once_properties(null==r?void 0:r.$set_once);c&&(l.$set_once=c),(l=gr(l,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Fr(null==r?void 0:r.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=s);var u=t(t({},l.properties.$set),l.$set);if(Nr(u)||this.setPersonPropertiesForFlags(u),!Dr(this.config.before_send)){var d=this._runBeforeSend(l);if(!d)return;l=d}this._internalEventEmitter.emit("eventCaptured",l);var h={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),l}rr.critical("This capture call is ignored due to client rate limiting.")}}else rr.error("No event name provided to posthog.capture")}else rr.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,n,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=this.persistence.remove_event_timer(e),o=t({},n);if(o.token=this.config.token,"$snapshot"===e){var s=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!Or(o.distinct_id)&&!Br(o.distinct_id)||Lr(o.distinct_id))&&rr.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a=rd.properties();if(this.sessionManager){var{sessionId:l,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();o.$session_id=l,o.$window_id=c}if(this.requestRouter.region===mh.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var u=this.sessionPropsManager.getSessionProps();o=lr(o,u)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView(r):"$pageleave"===e&&(d=this.pageViewManager.doPageLeave(r)),o=lr(o,d)}if("$pageview"===e&&Yn&&(o.title=Yn.title),!Fr(i)){var h=r.getTime()-i;o.$duration=parseFloat((h/1e3).toFixed(3))}er&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=lr({},a,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),xr(this.config.property_denylist)?ar(this.config.property_denylist,(function(e){delete o[e]})):rr.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(o=p(o,e));var v=this._hasPersonProcessing();return o.$process_person_profile=v,v&&this._requirePersonProcessing("_calculate_event_properties"),o}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=lr({},this.persistence.get_initial_props(),e||{}),n=this.config.sanitize_properties;return n&&(t=n(t,"$set_once")),Nr(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return rr.uninitializedWarning("posthog.identify");if(Br(e)&&(e=e.toString(),rr.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))rr.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Xr)&&(this.unregister(Xr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(wi)||"anonymous");e!==r&&o?(this.persistence.set_property(wi,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(bi))}}else rr.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else rr.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,o;if(rr.info("reset"),!this.__loaded)return rr.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.surveys)||void 0===r||r.reset(),null===(i=this.persistence)||void 0===i||i.set_property(wi,"anonymous"),null===(o=this.sessionManager)||void 0===o||o.resetSessionId();var a=this.config.get_device_id(Gc());this.register_once({distinct_id:a,$device_id:e?a:s},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&n){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;var s=Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0);r+="?t=".concat(s)}return r}alias(e,t){return e===this.get_property(Yr)?(rr.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Fr(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Xr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(rr.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n,r,i,o,s=t({},this.config);Ar(e)&&(lr(this.config,sp(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new od(t(t({},this.config),{},{persistence:"sessionStorage"})),Qc.is_supported()&&"true"===Qc.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&($n.DEBUG=!0,rr.info("set_config",{config:e,oldConfig:s,newConfig:t({},this.config)})),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,o,s,a;if(null===(r=this.sessionManager)||void 0===r||r.checkAndGetSessionAndWindowId(),n.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,n){var r,i=new Error("PostHog syntheticException"),o=Tr(null===(r=tr.__PosthogExtensions__)||void 0===r?void 0:r.parseErrorAsProperties)?tr.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i}):t({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},n);this.exceptions.sendExceptionEvent(o)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:rp;return t!==rp&&(t=rp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(wi))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(wi))}_hasPersonProcessing(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Nr(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Xr])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[xi]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(rr.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(xi,!0),!0)}_sync_opt_out_with_persistence(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(s))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),Fr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return zn?Dh(zn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Yn&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Yn.title},{send_instantly:!0}))}debug(e){!1===e?(null==Vn||Vn.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Vn||Vn.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(Dr(this.config.before_send))return e;var t=xr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),Dr(n)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return $r(e.event)?rr.warn("".concat(i,". This can cause unexpected behavior.")):rr.info(i),null}n.properties&&!Nr(n.properties)||rr.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return n}}!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=hr(e.prototype[t[n]])}(lp,["identify"]);var cp,up;cp=tp[rp]=new lp,(up=tr.posthog)&&ar(up._i,(function(e){if(e&&xr(e)){var t=cp.init(e[0],e[1],e[2]),n=up[e[2]]||up;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),tr.posthog=cp,function(){function e(){e.done||(e.done=!0,ip=!1,ar(tp,(function(e){e._dom_loaded()})))}null!=Yn&&Yn.addEventListener&&("complete"===Yn.readyState?e():Yn.addEventListener("DOMContentLoaded",e,!1)),Vn&&mr(Vn,"load",e,!0)}()}();
|
|
11
2
|
//# sourceMappingURL=array.full.js.map
|