posthog-js 1.301.1 → 1.301.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/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +7 -7
- package/package.json +6 -6
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t,r,i,n,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=t.apply(r,i);function a(t){e(s,n,o,a,l,"next",t)}function l(t){e(s,n,o,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),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||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(e){if(v[e])return v[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in c?c[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return v[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 u=l[e].prototype;return document.body.removeChild(a),u?v[e]=u:t.prototype}catch(e){return t.prototype}}var p={};function g(e,t,r){var i,n=e+"."+String(r);if(p[n])return p[n].call(t);var o=f(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(t)):t[r]}var m={};function y(e,t,r){var i=e+"."+String(r);if(m[i])return m[i].bind(t);var n=f(e)[r];return"function"!=typeof n?t[r]:(m[i]=n,n.bind(t))}var b={childNodes:function(e){return g("Node",e,"childNodes")},parentNode:function(e){return g("Node",e,"parentNode")},parentElement:function(e){return g("Node",e,"parentElement")},textContent:function(e){return g("Node",e,"textContent")},contains:function(e,t){return y("Node",e,"contains")(t)},getRootNode:function(e){return y("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?g("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null},querySelector:function(e,t){return g("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return g("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(e){return e.nodeType===e.ELEMENT_NODE}function _(e){var t=e&&"host"in e&&"mode"in e&&b.host(e)||null;return Boolean(t&&"shadowRoot"in t&&b.shadowRoot(t)===e)}function C(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>S(t,e.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?L(n,t):n}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=e,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var E="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function N(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(R,((e,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return e;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),c=l.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+u+h.join("/")+u+")"}))}var D,B,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function z(e,t){return t&&""!==t.trim()?U(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(e,t){var r=G.get(e);if(r||(r=e.createElement("a"),G.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?z(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=t.length);){var o=i(j);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),n.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?L(i,U(e)):"object"===t&&"data"===r?z(e,i):i:z(e,i):i}function J(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(b.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&K(b.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(w(e)){if(n=e,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(e))return!1;n=b.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(K(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,i);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 r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),y={},w=e.attributes.length,_=0;_<w;_++){var C=e.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(e){return null==e?void 0:e.href}(e);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&e.sheet&&!(e.innerText||b.textContent(e)||"").trim().length){var R=I(e.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:e,type:M(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(e.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&e.open)try{y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var P=e.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var Z=e,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(g){var{width:G,height:z}=e.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(e)||void 0,needBlock:g,rootId:p,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:o}=t,s=b.parentNode(e),a=s&&s.tagName,l=b.textContent(e),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=I(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=L(l,U(t.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:o}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(e)||"",rootId:m};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:E}=t,{preserveWhiteSpace:M=!0}=t;E||(E=Q(e,s,a,void 0===E));var R,F=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(e,"not serialized"),null;R=i.hasNode(e)?i.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"===N(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(F,f)&&(M||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(i.add(e,O),R===H)return null;y&&y(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(e);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(M=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(e))){var Z=re(B,D);Z&&O.childNodes.push(Z)}var q=null;if(w(e)&&(q=b.shadowRoot(e)))for(var j of Array.from(b.childNodes(q))){var Y=re(j,D);Y&&(C(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(e);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var 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)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(e,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var o=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),n=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});t&&k(e,t)}}),x),O}let ie=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 ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},oe={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var se={};function ae(e){if(se[e])return se[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in oe?oe[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return se[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 u=l[e].prototype;return document.body.removeChild(a),u?se[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var o=ae(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(le[n]=s,s.call(t)):t[r]}var he={};function ce(e,t,r){var i=e+"."+String(r);if(he[i])return he[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(he[i]=n,n.bind(t))}function de(){return ae("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return ce("Node",e,"contains")(t)},getRootNode:function(e){return ce("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:de};function fe(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var pe="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.",ge={map:{},getId:()=>(console.error(pe),-1),getNode:()=>(console.error(pe),null),removeNodeFromMap(){console.error(pe)},has:()=>(console.error(pe),!1),reset(){console.error(pe)}};function me(e,t,r){void 0===r&&(r={});var i=null,n=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();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,s)}),u))}}function ye(e,t,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ge=new Proxy(ge,{get:(e,t,r)=>("map"===t&&console.error(pe),Reflect.get(e,t,r))}));var we=Date.now;function _e(e){var t,r,i,n,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=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.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=ve.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function ke(e,t,r,i){if(!e)return!1;var n=Se(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(K(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===H}function Ae(e,t){if(_(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=ve.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Ae(i,t))}function Te(e){return Boolean(e.changedTouches)}function Ee(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Re=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(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):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Fe(e){var t,r=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(r=ve.host(ve.getRootNode(e))),r}function Oe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Fe(r);)r=t;return r}(e);return ve.contains(t,r)}function Pe(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Oe(e))}var Le=(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))(Le||{}),De=(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))(De||{}),Be=(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))(Be||{}),Ze=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ze||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),qe=(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))(qe||{});function He(e){return"__ln"in e}class Ve{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)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&&He(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&He(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.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 je,Ye=(e,t)=>e+"@"+t;class Ge{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ve,i=e=>{for(var t=e,r=H;r===H;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var o=ve.parentNode(n);if(o&&Pe(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Fe(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=re(n,{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=>{Ee(e,this.mirror)&&this.iframeManager.addIframe(e),Me(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(n)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(n),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)We(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||n(o);for(var s of this.addedSet)Ue(this.droppedSet,s)||We(this.removes,s,this.mirror)?Ue(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(ve.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(ve.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=ve.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=ve.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=ve.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{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 r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+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};(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))}})),a(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(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var o=M(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){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(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===h?u:[u,h]:s._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(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 r=this.mirror.getId(t),i=_(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ae(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ye(r,i)]?ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!_(e.target)||!C(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ye(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.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 ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function We(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=ve.parentNode(t),o=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ve.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(e,t,r)}function Ue(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=ve.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Je=e=>{if(!je)return e;return function(){try{return e(...arguments)}catch(e){if(je&&!0===je(e))return;throw e}}},Ke=[];function Qe(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 et(e,t){var r=new Ge;Ke.push(r),r.init(e);var i=new(de())(Je(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Be).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!ke(a,o,s,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Ze.Mouse;break;case"touch":l=Ze.Touch;break;case"pen":l=Ze.Pen}l===Ze.Touch?Be[e]===Be.MouseDown?u="TouchStart":Be[e]===Be.MouseUp&&(u="TouchEnd"):Ze.Pen}else Te(i)&&(l=Ze.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Ze.Touch||u.startsWith("Mouse")&&l===Ze.Mouse)&&(l=null)):Be[e]===Be.Click&&(l=h,h=null);var c=Te(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Je(t)(r({type:Be[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Be[e]){case Be.MouseDown:case Be.MouseUp:a=a.replace("mouse","pointer");break;case Be.TouchStart:case Be.TouchEnd:return}u.push(fe(a,l,i))})),Je((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=e;return fe("scroll",Je(me(Je((e=>{var s=Qe(e);if(s&&!ke(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=_e(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function ot(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function st(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Je((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...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),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=me(Je((e=>{var r=Date.now()-o;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],o=null})),a),h=Je(me(Je((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:r,y:i,id:n.getId(t),timeOffset:we()-o}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),s,{trailing:!1})),c=[fe("mousemove",h,i),fe("touchmove",h,i),fe("drag",h,i)];return Je((()=>{c.forEach((e=>e()))}))}(e),s=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,o=-1;return fe("resize",Je(me(Je((()=>{var e=Ce(),t=Ie();n===e&&o===t||(r({width:Number(t),height:Number(e)}),n=e,o=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=e;function v(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=ve.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!ke(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var c=t.value,v=!1,p=M(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:t,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(t,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var o=nt.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){nt.set(e,i);var s=n.getId(e);Je(t)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((e=>fe(e,Je(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((e=>ye(e[0],e[1],{set(){Je(v)({target:this,isTrusted:!1})}},!1,g)))),Je((()=>{p.forEach((e=>e()))}))}(e),h=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=e,a=Je((e=>me(Je((o=>{var s=Qe(o);if(s&&!ke(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=s;t({type:e,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),o.media||500))),l=[fe("play",a(qe.Play),s),fe("pause",a(qe.Pause),s),fe("seeked",a(qe.Seeked),s),fe("volumechange",a(qe.VolumeChange),s),fe("ratechange",a(qe.RateChange),s)];return Je((()=>{l.forEach((e=>e()))}))}(e),c=()=>{},d=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(c=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=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:Je(((e,t,o)=>{var[s,a]=o,{id:l,styleId:u}=st(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({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:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({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:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var h={};ht("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(ht("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),ht("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),ht("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((e=>{var[t,o]=e;c[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[t].insertRule,{apply:Je(((e,t,o)=>{var[s,a]=o,{id:l,styleId:u}=st(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...ot(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(c[t].deleteRule,{apply:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...ot(t),s]}]}),e.apply(t,o)}))})})),Je((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=u,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=c[t].insertRule,r.prototype.deleteRule=c[t].deleteRule}))}))}(e,{win:n}),d=at(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Je(((e,t,s)=>{var l,[u,h,c]=s;if(n.has(u))return a.apply(t,[u,h,c]);var{id:d,styleId:v}=st(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:h,priority:c},index:ot(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Je(((e,t,s)=>{var a,[u]=s;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:c}=st(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:ot(t.parentRule)}),e.apply(t,s)}))}),Je((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,r){var i=new s(e,t,r);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=be(r.fonts,"add",(function(e){return function(r){return setTimeout(Je((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Je((()=>{n.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=e,s=!0,a=Je((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;u<l;u++){var h=e.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;ke(c,i,n,!0)||ke(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),fe("selectionchange",a)}(e),g=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?be(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),m=[];for(var y of e.plugins)m.push(y.observer(y.callback,n,y.options));return Je((()=>{Ke.forEach((e=>e.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((e=>e()))}))}function ut(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 ct{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),s=n.get(t);return s||(s=this.generateIdFn(),n.set(t,s),o.set(s,t)),s}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var n=i.get(t);return n||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){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 dt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ct(V)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.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){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Le.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Le.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Le.Meta:case Le.Load:case Le.DomContentLoaded:return!1;case Le.Plugin:return t;case Le.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Le.IncrementalSnapshot:switch(t.data.source){case De.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(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(C(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(r({},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(ve.host(e))),this.restoreHandlers.push(at({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 r=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),o=ve.shadowRoot(this);return o&&Pe(this)&&r.addShadowRoot(o,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),gt=0;gt<64;gt++)pt[ft.charCodeAt(gt)]=gt;var mt=new Map;var yt=(e,t,r)=>{if(e&&(_t(e,t)||"object"==typeof e)){var i=function(e,t){var r=mt.get(e);return r||(r=new Map,mt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function bt(e,t,r){if(e instanceof Array)return e.map((e=>bt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=ft[r[t]>>2],n+=ft[(3&r[t])<<4|r[t+1]>>4],n+=ft[(15&r[t+1])<<2|r[t+2]>>6],n+=ft[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]}:_t(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var wt=(e,t,r)=>e.map((e=>bt(e,t,r))),_t=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,i){var n=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!ke(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function It(e,t,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var h=e.apply(this,l);if(yt(h,o,this),"tagName"in this.canvas&&!ke(this.canvas,i,n,!0)){var c=wt(l,o,this),d={type:t,property:a,args:c};r(this.canvas,d)}return h}}));s.push(l)}catch(i){var u=ye(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var St,kt,xt,At,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Et="undefined"!=typeof window&&window.Blob&&new Blob([(St=Tt,Uint8Array.from(atob(St),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Mt(e){var t;try{if(!(t=Et&&(window.URL||window.webkitURL).createObjectURL(Et)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(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:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{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,r,i,n,o){var s=this,a=Ct(r,i,n,!0),l=new Map,u=new Mt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/e,d=0,v=e=>{var a,f;d&&e-d<c?h=requestAnimationFrame(v):(d=e,(a=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),a).forEach(function(){var e=t((function*(e){var t,r=s.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,h=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(t){return e.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ct(e,t,r,!1),n=function(e,t,r,i){var n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=be(t.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return ke(this.canvas,r,i,!0)||setTimeout((()=>{var r=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,i){var n=[];return n.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,o))),{type:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Rt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Re),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 r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],o=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),i.styleIds.push(t)};for(var s of e)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ft{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).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 Ot=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Pt=document.createElement("iframe");document.body.appendChild(Pt),Array.from=(null==(n=Pt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pt)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt,Dt,Bt=new x;function Zt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=e;je=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Bt.reset();var L,D=!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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=e=>{for(var t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};kt=(e,r)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Ke[0])?void 0:o.isFrozen())||s.type===Le.FullSnapshot||s.type===Le.IncrementalSnapshot&&s.data.source===De.Mutation||Ke.forEach((e=>e.unfreeze())),O)null==t||t(q(s),r);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Le.FullSnapshot)L=s,Z=0;else if(s.type===Le.IncrementalSnapshot){if(s.data.source===De.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xt(!0)}};var H=e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.Mutation},e)})},V=e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Scroll},e)}),j=e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),Y=new Rt({mutationCb:H,adoptedStyleSheetCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),G=new dt({mirror:Bt,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:kt});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Bt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Ft;At=new Nt({recordCanvas:I,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Bt,sampling:b.canvas,dataURLOptions:w});var U=new vt({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:At,keepIframeSrcFn:N,processedNodeManager:W},mirror:Bt});xt=function(e){if(void 0===e&&(e=!1),C){kt({type:Le.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Y.reset(),U.init(),Ke.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!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}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Bt,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:e=>{Ee(e,Bt)&&G.addIframe(e),Me(e,Bt)&&Y.trackLinkElement(e),Ne(e)&&U.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:N});if(!t)return console.warn("Failed to snapshot the document");kt({type:Le.FullSnapshot,data:{node:t,initialOffset:_e(window)}},e),Ke.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Bt.getId(document))}};try{var X=[],J=e=>{var t;return Je(lt)({mutationCb:H,mousemoveCb:(e,t)=>kt({type:Le.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:j,fontCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:e,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Bt,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:At,ignoreCSSAttributes:R,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:Le.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{X.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var K=()=>{xt(),X.push(J(document)),Ot=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(fe("DOMContentLoaded",(()=>{kt({type:Le.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(fe("load",(()=>{kt({type:Le.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((e=>e())),W.destroy(),Ot=!1,je=void 0}}catch(e){console.warn(e)}}Zt.addCustomEvent=(e,t)=>{if(!Ot)throw new Error("please add custom event after start recording");kt({type:Le.Custom,data:{tag:e,payload:t}})},Zt.freezePage=()=>{Ke.forEach((e=>e.freeze()))},Zt.takeFullSnapshot=e=>{if(!Ot)throw new Error("please take full snapshot after start recording");xt(e)},Zt.mirror=Bt,(Dt=Lt||(Lt={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var $t,qt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Wt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ut={};function Xt(e){if(Ut[e])return Ut[e];var t=globalThis[e],r=t.prototype,i=e in zt?zt[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Wt?Wt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return Ut[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 u=l[e].prototype;return document.body.removeChild(a),u?Ut[e]=u:r}catch(e){return r}}var Jt={};function Kt(e,t,r){var i,n=e+"."+String(r);if(Jt[n])return Jt[n].call(t);var o=Xt(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Jt[n]=s,s.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Kt("Node",e,"childNodes")},parentNode:function(e){return Kt("Node",e,"parentNode")},parentElement:function(e){return Kt("Node",e,"parentElement")},textContent:function(e){return Kt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Kt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Kt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Kt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Kt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){Gt(this,"idNodeMap",new Map),Gt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{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 nr))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 or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in or?or[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in sr?sr[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return ar[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 u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function hr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var o=lr(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(t)):t[r]}var cr={};function dr(e,t,r){var i=e+"."+String(r);if(cr[i])return cr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(cr[i]=n,n.bind(t))}var vr={childNodes:function(e){return hr("Node",e,"childNodes")},parentNode:function(e){return hr("Node",e,"parentNode")},parentElement:function(e){return hr("Node",e,"parentElement")},textContent:function(e){return hr("Node",e,"textContent")},contains:function(e,t){return dr("Node",e,"contains")(t)},getRootNode:function(e){return dr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(e,t,r)=>("map"===t&&console.error(fr),Reflect.get(e,t,r))}));var gr=Date.now;function mr(e){return e?e.nodeType===e.ELEMENT_NODE?e:vr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=vr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(e))&&(r=vr.host(vr.getRootNode(e))),r}function br(e){for(var t,r=e;t=yr(r);)r=t;return r}function wr(e){var t=e.ownerDocument;if(!t)return!1;var r=br(e);return vr.contains(t,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){jt(this,"id",1),jt(this,"styleIDMap",new WeakMap),jt(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):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function e(t,r){var i,n,o=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,r),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,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,i,n,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=vr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.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=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(vr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(vr.contains(t,e)||wr(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,o=r.getId(t);if(!r.has(o))return!0;var s=vr.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=mr(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ir(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.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,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return gr},on:function(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:o,parentId:s}=n;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,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(s in t){var h=t[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(e,t,r){void 0===r&&(r={});var i=null,n=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();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,s)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"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 xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($t=xr.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(e){Ht(this,"fileName"),Ht(this,"functionName"),Ht(this,"lineNumber"),Ht(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?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Nr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Er)?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: "+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(Er)}),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,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Mr)}),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 Ar({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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,r=e.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=t.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=t.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Rr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Fr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Or(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Fr(e[i])&&Or(e[i],t-1))return!0;return!1}function Pr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.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(Fr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Fr(e)&&Or(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.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]=Rr(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 Lr={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 Dr(e,t,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=t.error,o=Nr.parse(i).map((e=>e.toString())),s=[Pr(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(t.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?_r.patch(t,r,(t=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((e=>Pr(e,n.stringifyOptions)));++s<n.lengthThreshold?e({level:r,trace:h,payload:c}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Br=e=>({name:"rrweb/console@1",observer:Dr,options:e}),Zr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],$r=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Zr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},qr=["$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 Hr(e,t){return-1!==e.indexOf(t)}var Vr=function(e){return e.trim()},jr=function(e){return e.replace(/^\$/,"")};var Yr=Array.isArray,Gr=Object.prototype,zr=Gr.hasOwnProperty,Wr=Gr.toString,Ur=Yr||function(e){return"[object Array]"===Wr.call(e)},Xr=e=>"function"==typeof e,Jr=e=>Xr(e)&&-1!==e.toString().indexOf("[native code]"),Kr=e=>e===Object(e)&&!Ur(e),Qr=e=>{if(Kr(e)){for(var t in e)if(zr.call(e,t))return!1;return!0}return!1},ei=e=>void 0===e,ti=e=>"[object String]"==Wr.call(e),ri=e=>ti(e)&&0===e.trim().length,ii=e=>null===e,ni=e=>ei(e)||ii(e),oi=e=>"[object Number]"==Wr.call(e),si=e=>"[object Boolean]"===Wr.call(e),ai=e=>e instanceof FormData,li=e=>Hr(qr,e);function ui(e){return null===e||"object"!=typeof e}function hi(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function ci(e){return!ei(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var di=[!0,"true",1,"1","yes"],vi=e=>Hr(di,e),fi=[!1,"false",0,"0","no"];function pi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),oi(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),pi(n||r,t,r,i))}class gi{constructor(e){this.o={},this.h=e.h,this.m=pi(e.bucketSize,0,100,e.C),this.I=pi(e.refillRate,0,this.m,e.C),this.S=pi(e.refillInterval,0,864e5,e.C)}k(e,t){var r=t-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var n=i*this.I;e.tokens=Math.min(e.tokens+n,this.m),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.o[i];return n?this.k(n,r):(n={tokens:this.m,lastAccess:r},this.o[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.h)||t.call(this,e)),0===n.tokens)}stop(){this.o={}}}var mi,yi,bi,wi=e=>e instanceof Error;function _i(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return bi&&r.length===yi||(yi=r.length,bi=r.reduce(((r,i)=>{mi||(mi={});var n=mi[i];if(n)r[n[0]]=n[1];else for(var o=e(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,mi[i]=[l,u];break}}return r}),{})),bi}}class Ci{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Ur(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,o,s={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(o=e.synthetic)&&void 0!==o&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:_i(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var Ii="?";function Si(e,t,r,i,n){var o={platform:e,filename:t,function:"<anonymous>"===r?Ii:r,in_app:!0};return ei(i)||(o.lineno=i),ei(n)||(o.colno=n),o}var ki=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:Ii,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},xi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ai=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ti=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ei=(e,t)=>{var r=xi.exec(e);if(r){var[,i,n,o]=r;return Si(t,i,Ii,+n,+o)}var s=Ai.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=Ti.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,u]=ki(s[1]||Ii,s[2]);return Si(t,u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Mi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ni=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ri=(e,t)=>{var r=Mi.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Ni.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||Ii;return[o,n]=ki(o,n),Si(t,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Fi=/\(error: (.*)\)/,Oi=50;function Pi(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var o=[],s=t.split("\n"),a=n;a<s.length;a++){var l=s[a];if(!(l.length>1024)){var u=Fi.test(l)?l.replace(Fi,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,e);if(c){o.push(c);break}}if(o.length>=Oi)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Oi).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Ii});var i}))}(o)}}class Li{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ti(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return hi(e,"DOMException")}isDOMError(e){return hi(e,"DOMError")}}class Di{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bi{constructor(){}match(e){return hi(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Zi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class $i{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Zi);return i&&(t=i[1],r=i[2]),[t,r]}}var qi=["fatal","error","warning","log","info","debug"];function Hi(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class Vi{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ci(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Hi(e)}isSeverityLevel(e){return ti(e)&&!ri(e)&&qi.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(wi(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class ji{match(e){return ci(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hi(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Yi{match(e){return ui(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gi{match(e){return hi(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ui(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){if(ui(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}}var zi="undefined"!=typeof window?window:void 0,Wi="undefined"!=typeof globalThis?globalThis:zi;"undefined"==typeof self&&(Wi.self=Wi),"undefined"==typeof File&&(Wi.File=function(){});var Ui=Array.prototype,Xi=Ui.forEach,Ji=Ui.indexOf,Ki=null==Wi?void 0:Wi.navigator,Qi=null==Wi?void 0:Wi.document,en=null==Wi?void 0:Wi.location,tn=null==Wi?void 0:Wi.fetch,rn=null!=Wi&&Wi.XMLHttpRequest&&"withCredentials"in new Wi.XMLHttpRequest?Wi.XMLHttpRequest:void 0,nn=null==Wi?void 0:Wi.AbortController,on=null==Ki?void 0:Ki.userAgent,sn=null!=zi?zi:{},an=()=>!!zi.Zone,ln=e=>e instanceof Document,un={DEBUG:!1,LIB_VERSION:"1.301.1"},hn=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={A:function(t){if(zi&&(un.DEBUG||sn.POSTHOG_DEBUG||r)&&!ei(zi.console)&&zi.console){for(var i=("__rrweb_original__"in zi.console[t]?zi.console[t].__rrweb_original__:zi.console[t]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(e,...o)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>hn(e+" "+t,r)};return i},cn=hn("[PostHog.js]"),dn=cn.createLogger,vn={};function fn(e,t,r){if(Ur(e))if(Xi&&e.forEach===Xi)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===vn)return}function pn(e,t,r){if(!ni(e)){if(Ur(e))return fn(e,t,r);if(ai(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===vn)return}else for(var n in e)if(zr.call(e,n)&&t.call(r,e[n],n)===vn)return}}var gn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return fn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},mn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return fn(r,(function(t){fn(t,(function(t){e.push(t)}))})),e};function yn(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var bn=function(e){try{return e()}catch(e){return}},wn=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){cn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cn.critical(e)}}},_n=function(e){var t={};return pn(e,(function(e,r){(ti(e)&&e.length>0||oi(e))&&(t[r]=e)})),t};function Cn(e,t){return r=e,i=e=>ti(e)&&!ii(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Ur(t)?(o=[],fn(t,(t=>{o.push(e(t))}))):(o={},pn(t,((t,r)=>{n.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,i,n}var In=["herokuapp.com","vercel.app","netlify.app"];function Sn(e){var t=null==e?void 0:e.hostname;if(!ti(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of In)if(r===i)return!1;return!0}function kn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function xn(e,t,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:o})}var An=e=>{var t=null==Qi?void 0:Qi.createElement("a");return ei(t)?null:(t.href=e,t)},Tn=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return pn(e,(function(e,t){ei(e)||ei(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},En=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===t){r=o;break}}if(!Ur(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){cn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Mn=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],l=s[0],u=(a||"").split("&"),h=[],c=0;c<u.length;c++){var d=u[c].split("=");Ur(d)&&(t.includes(d[0])?h.push(d[0]+"="+r):h.push(u[c]))}var v=l;return null!=a&&(v+="?"+h.join("&")),null!=o&&(v+="#"+o),v},Nn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Rn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Fn(e,t){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of t.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var On="$people_distinct_id",Pn="__alias",Ln="__timers",Dn="$autocapture_disabled_server_side",Bn="$heatmaps_enabled_server_side",Zn="$exception_capture_enabled_server_side",$n="$error_tracking_suppression_rules",qn="$error_tracking_capture_extension_exceptions",Hn="$web_vitals_enabled_server_side",Vn="$dead_clicks_enabled_server_side",jn="$web_vitals_allowed_metrics",Yn="$session_recording_remote_config",Gn="$sesid",zn="$session_is_sampled",Wn="$enabled_feature_flags",Un="$early_access_features",Xn="$feature_flag_details",Jn="$stored_person_properties",Kn="$stored_group_properties",Qn="$surveys",eo="$surveys_activated",to="$flag_call_reported",ro="$user_state",io="$client_session_props",no="$capture_rate_limit",oo="$initial_campaign_params",so="$initial_referrer_info",ao="$initial_person_info",lo="$epp",uo="__POSTHOG_TOOLBAR__",ho="$posthog_cookieless",co=[On,Pn,"__cmpns",Ln,"$session_recording_enabled_server_side",Bn,Gn,Wn,$n,ro,Un,Xn,Kn,Jn,Qn,to,io,no,oo,so,lo,ao];function vo(e){return e instanceof Element&&(e.id===uo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function fo(e){return!!e&&1===e.nodeType}function po(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function go(e){return!!e&&3===e.nodeType}function mo(e){return!!e&&11===e.nodeType}function yo(e){return e?Vr(e).split(/\s+/):[]}function bo(e){var t=null==zi?void 0:zi.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function wo(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 yo(t)}function _o(e){return ni(e)?null:Vr(e).split(/(\s+)/).filter((e=>Ho(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(e){var t="";return Oo(e)&&!Po(e)&&e.childNodes&&e.childNodes.length&&pn(e.childNodes,(function(e){var r;go(e)&&e.textContent&&(t+=null!==(r=_o(e.textContent))&&void 0!==r?r:"")})),Vr(t)}function Io(e){return ei(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var So=["a","button","form","input","select","textarea","label"];function ko(e,t){if(ei(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function xo(e){var t=e.parentNode;return!(!t||!fo(t))&&t}var Ao=["next","previous","prev",">","<"],To=10;var Eo=[".ph-no-rageclick",".ph-no-capture"];function Mo(e,t){if(!zi||No(e))return!1;var r,i,n;si(t)?(r=!!t&&Eo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Eo,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Ro(e,!1);return!function(e,t){if(!1===e||ei(e))return!1;var r;if(!0===e)r=Ao;else{if(!Ur(e))return!1;if(e.length>To)return cn.error("[PostHog] content_ignorelist array cannot exceed "+To+" items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,o.map((e=>{var t;return{safeText:Co(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!ko(o,r)}var No=e=>!e||po(e,"html")||!fo(e),Ro=(e,t)=>{if(!zi||No(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=xo(n);if(!o)break;if(t||So.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=zi.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Fo(e,t,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!zi||No(e))return!1;if(null!=(o=r)&&o.url_allowlist&&!bo(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&bo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Ro(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ei(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var o of e)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!ko(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=zi.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(So.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function Oo(e){for(var t=e;t.parentNode&&!po(t,"body");t=t.parentNode){var r=wo(t);if(Hr(r,"ph-sensitive")||Hr(r,"ph-no-capture"))return!1}if(Hr(wo(e),"ph-include"))return!0;var i=e.type||"";if(ti(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ti(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 Po(e){return!!(po(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||po(e,"select")||po(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Lo="(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})",Do=new RegExp("^(?:"+Lo+")$"),Bo=new RegExp(Lo),Zo="\\d{3}-?\\d{2}-?\\d{4}",$o=new RegExp("^("+Zo+")$"),qo=new RegExp("("+Zo+")");function Ho(e,t){if(void 0===t&&(t=!0),ni(e))return!1;if(ti(e)){if(e=Vr(e),(t?Do:Bo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?$o:qo).test(e))return!1}return!0}function Vo(e){var t=Co(e);return Ho(t=(t+" "+jo(e)).trim())?t:""}function jo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&pn(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Co(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+jo(e)).trim())}catch(e){cn.error("[AutoCapture]",e)}})),t}function Yo(e){return function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))n+="."+o.replace(/"/g,"");var s=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return yn(s).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Go(t.toString())]=Go(r.toString())})),n+=":",n+=yn(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:zo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return yn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Go(e){return e.replace(/"|\\"/g,'\\"')}function zo(e){var t=e.attr__class;return t?Ur(t)?t:yo(t):void 0}var Wo={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",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Uo=dn("[Recorder]"),Xo=e=>"navigation"===e.entryType,Jo=e=>"resource"===e.entryType;function Ko(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Xo(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>os({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Xo(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>os({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Qo(e,t){return!!t&&(si(t)||t[e])}function es(e){var{type:t,recordBody:r,headers:i,url:n}=e;function o(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(si(r))return!0;if(Ur(r))return o(r);var s=r[t];return si(s)?s:o(s)}function ts(e,t,r,i,n,o){return rs.apply(this,arguments)}function rs(){return rs=t((function*(e,t,r,i,n,o){if(void 0===o&&(o=0),o>10)return Uo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var s=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Jo(e)&&e.initiatorType===t&&(ei(i)||e.startTime>=i)&&(ei(n)||e.startTime<=n)));return s||(yield new Promise((e=>setTimeout(e,50*o))),ts(e,t,r,i,n,o+1))})),rs.apply(this,arguments)}function is(e){var{body:t,options:r,url:i}=e;if(ni(t))return null;var{hostname:n,isHostDenied:o}=Fn(i,r);if(o)return n+" is in deny list";if(ti(t))return t;if(ln(t))return t.textContent;if(ai(t))return Tn(t);if(Kr(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 ns=e=>!ii(e)&&("navigation"===e.entryType||"resource"===e.entryType);function os(e){var{entry:t,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:ei(a)?void 0:Math.round(a),endTime:ei(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ns(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ss=["video/","audio/"];function as(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function ls(){return ls=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:o}=Fn(i,r);return o?Promise.resolve(n+" is in deny list"):as(t)})),ls.apply(this,arguments)}function us(){return us=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),s=ss.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=Fn(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return ii(n)?as(t):Promise.resolve(n)})),us.apply(this,arguments)}function hs(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Qo("request",i.recordHeaders),o=Qo("response",i.recordHeaders),s=Rn(r,"fetch",(s=>function(){var a=t((function*(t,a){var l,u,h,c=new Request(t,a),d={};try{var v={};c.headers.forEach(((e,t)=>{v[t]=e})),n&&(d.requestHeaders=v),es({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(d.requestBody=yield function(e){return ls.apply(this,arguments)}({r:c,options:i,url:t})),u=r.performance.now(),l=yield s(c),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),o&&(d.responseHeaders=f),es({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(d.responseBody=yield function(e){return us.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{ts(r,"fetch",c.url,u,h).then((t=>{var r,i=os({entry:t,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var cs=null;function ds(e,t,i){if(!("performance"in t))return()=>{};if(cs)return Uo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Wo,i):Wo,o=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},s=Ko(o,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Qo("request",r.recordHeaders),n=Qo("response",r.recordHeaders),o=Rn(t.XMLHttpRequest.prototype,"open",(o=>function(s,a,l,u,h){void 0===l&&(l=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(es({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=is({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),es({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=is({body:v.response,options:r,url:a})),ts(t,"xmlhttprequest",f.url,c,d).then((t=>{var r=os({entry:t,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),l,u,h)}));return()=>{o()}}(o,t,n),l=hs(o,t,n)),cs=()=>{s(),a(),l(),cs=null}}var vs=e=>({name:"rrweb/network@1",observer:ds,options:e});sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:vs},sn.__PosthogExtensions__.rrweb={record:Zt,version:"v2"},sn.rrweb={record:Zt,version:"v2"},sn.rrwebConsoleRecord={getRecordConsolePlugin:Br},sn.getRecordNetworkPlugin=vs;var fs,ps,gs,ms,ys,bs,ws,_s,Cs={},Is=[],Ss=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ks=Array.isArray;function xs(e,t){for(var r in t)e[r]=t[r];return e}function As(e){var t=e.parentNode;t&&t.removeChild(e)}function Ts(e,t,r){var i,n,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?n=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?fs.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Es(e,s,i,n,null)}function Es(e,t,r,i,n){var o={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++gs:n,__i:-1,__u:0};return null==n&&null!=ps.vnode&&ps.vnode(o),o}function Ms(e){return e.children}function Ns(e,t){this.props=e,this.context=t}function Rs(e,t){if(null==t)return e.__?Rs(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Rs(e):null}function Fs(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Fs(e)}}function Os(e){(!e.__d&&(e.__d=!0)&&ms.push(e)&&!Ps.__r++||ys!==ps.debounceRendering)&&((ys=ps.debounceRendering)||bs)(Ps)}function Ps(){var e,t,r,i,n,o,s,a,l;for(ms.sort(ws);e=ms.shift();)e.__d&&(t=ms.length,i=void 0,o=(n=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((i=xs({},n)).__v=n.__v+1,ps.vnode&&ps.vnode(i),Vs(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?Rs(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,js(a,i,l),i.__e!=o&&Fs(i)),ms.length>t&&ms.sort(ws));Ps.__r=0}function Ls(e,t,r,i,n,o,s,a,l,u,h){var c,d,v,f,p,g=i&&i.__k||Is,m=t.length;for(r.__d=l,function(e,t,r){var i,n,o,s,a,l=t.length,u=r.length,h=u,c=0;for(e.__k=[],i=0;i<l;i++)null!=(n=e.__k[i]=null==(n=t[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Es(null,n,null,null,n):ks(n)?Es(Ms,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Es(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=Bs(n,r,s=i+c,h),n.__i=a,o=null,-1!==a&&(h--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&c--,"function"!=typeof n.type&&(n.__u|=65536)):a!==s&&(a===s+1?c++:a>s?h>l-s?c+=a-s:c--:c=a<s&&a==s-1?a-s:0,a!==i+c&&(n.__u|=65536))):(o=r[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Rs(o)),Gs(o,o,!1),r[i]=null,h--);if(h)for(i=0;i<u;i++)null!=(o=r[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Rs(o)),Gs(o,o))}(r,t,g),l=r.__d,c=0;c<m;c++)null!=(v=r.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?Cs:g[v.__i]||Cs,v.__i=c,Vs(e,v,d,n,o,s,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ys(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Ds(v,l,e):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);r.__d=l,r.__e=p}function Ds(e,t,r){var i,n;if("function"==typeof e.type){for(i=e.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=e,t=Ds(i[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Bs(e,t,r,i){var n=e.key,o=e.type,s=r-1,a=r+1,l=t[r];if(null===l||l&&n==l.key&&o===l.type)return r;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)&&n==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function Zs(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ss.test(t)?r:r+"px"}function $s(e,t,r,i,n){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Zs(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Zs(e.style,t,r[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]=r,r?i?r.u=i.u:(r.u=Date.now(),e.addEventListener(t,o?Hs:qs,o)):e.removeEventListener(t,o?Hs:qs,o);else{if(n)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==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function qs(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ps.event?ps.event(e):e)}function Hs(e){return this.l[e.type+!0](ps.event?ps.event(e):e)}function Vs(e,t,r,i,n,o,s,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=t.__e=r.__e]),(h=ps.__b)&&h(t);e:if("function"==typeof S)try{if(m=t.props,y=(h=S.contextType)&&i[h.__c],b=h?y?y.props.value:h.__:i,r.__c?g=(c=t.__c=r.__c).__=c.__E:("prototype"in S&&S.prototype.render?t.__c=c=new S(m,b):(t.__c=c=new Ns(m,b),c.constructor=S,c.render=zs),y&&y.sub(c),c.props=m,c.state||(c.state={}),c.context=b,c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=xs({},c.__s)),xs(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=t,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,b),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,b)||t.__v===r.__v)){for(t.__v!==r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<c._sb.length;w++)c.__h.push(c._sb[w]);c._sb=[],c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=b,c.props=m,c.__P=e,c.__e=!1,$=ps.__r,_=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(t),h=c.render(c.props,c.state,c.context),C=0;C<c._sb.length;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,$&&$(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++_<25);c.state=c.__s,null!=c.getChildContext&&(i=xs(xs({},i),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Ls(e,ks(I=null!=h&&h.type===Ms&&null==h.key?h.props.children:h)?I:[I],t,r,i,n,o,s,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),ps.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,i,n,o,s,a,l){var u,h,c,d,v,f,p,g=r.props,m=t.props,y=t.type;if("svg"===y&&(n=!0),null!=o)for(u=0;u<o.length;u++)if((v=o[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){e=v,o[u]=null;break}if(null==e){if(null===y)return document.createTextNode(m);e=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),o=null,a=!1}if(null===y)g===m||a&&e.data===m||(e.data=m);else{if(o=o&&fs.call(e.childNodes),g=r.props||Cs,!a&&null!=o)for(g={},u=0;u<e.attributes.length;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||$s(e,u,null,v,n));for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:"key"===u||a&&"function"!=typeof v||g[u]===v||$s(e,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Ls(e,ks(d)?d:[d],t,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&Rs(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&As(o[u]);a||(u="value",void 0!==f&&(f!==e[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&$s(e,u,f,g[u],!1),u="checked",void 0!==p&&p!==e[u]&&$s(e,u,p,g[u],!1))}return e}(r.__e,t,r,i,n,o,s,l,u);(h=ps.diffed)&&h(t)}function js(e,t,r){t.__d=void 0;for(var i=0;i<r.length;i++)Ys(r[i],r[++i],r[++i]);ps.__c&&ps.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ps.__e(e,t.__v)}}))}function Ys(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){ps.__e(e,r)}}function Gs(e,t,r){var i,n;if(ps.unmount&&ps.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ys(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ps.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Gs(i[n],t,r||"function"!=typeof e.type);r||null==e.__e||As(e.__e),e.__=e.__e=e.__d=void 0}function zs(e,t,r){return this.constructor(e,r)}function Ws(e,t,r){var i,n,o;ps.__&&ps.__(e,t),i=!1?null:t.__k,n=[],o=[],Vs(t,e=t.__k=Ts(Ms,null,[e]),i||Cs,Cs,void 0!==t.ownerSVGElement,i?null:t.firstChild?fs.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,o),js(n,e,o)}function Us(e,t,r){var i,n,o,s,a=xs({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?n=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?fs.call(arguments,2):r),Es(e.type,a,i||e.key,n||e.ref,null)}fs=Is.slice,ps={__e:function(e,t,r,i){for(var n,o,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(t){e=t}throw e}},gs=0,Ns.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xs({},this.state),"function"==typeof e&&(e=e(xs({},r),this.props)),e&&xs(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Os(this))},Ns.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Os(this))},Ns.prototype.render=Ms,ms=[],bs="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ws=function(e,t){return e.__v.__b-t.__v.__b},Ps.__r=0,_s=0;var Xs,Js,Ks,Qs,ea=0,ta=[],ra=[],ia=ps.__b,na=ps.__r,oa=ps.diffed,sa=ps.__c,aa=ps.unmount;function la(e,t){ps.__h&&ps.__h(Js,e,ea||t),ea=0;var r=Js.__H||(Js.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ra}),r.__[e]}function ua(e){return ea=1,function(e,t,r){var i=la(Xs++,2);if(i.t=e,!i.__c&&(i.__=[wa(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Js,!Js.u)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return e.__c}));if(n.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return n.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,r))};Js.u=!0;var o=Js.shouldComponentUpdate,s=Js.componentWillUpdate;Js.componentWillUpdate=function(e,t,r){if(this.__e){var i=o;o=void 0,n(e,t,r),o=i}s&&s.call(this,e,t,r)},Js.shouldComponentUpdate=n}return i.__N||i.__}(wa,e)}function ha(e,t){var r=la(Xs++,3);!ps.__s&&ba(r.__H,t)&&(r.__=e,r.i=t,Js.__H.__h.push(r))}function ca(e){return ea=5,da((function(){return{current:e}}),[])}function da(e,t){var r=la(Xs++,7);return ba(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function va(e){var t=Js.context[e.__c],r=la(Xs++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Js)),t.props.value):e.__}function fa(){for(var e;e=ta.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ma),e.__H.__h.forEach(ya),e.__H.__h=[]}catch(t){e.__H.__h=[],ps.__e(t,e.__v)}}ps.__b=function(e){Js=null,ia&&ia(e)},ps.__r=function(e){na&&na(e),Xs=0;var t=(Js=e.__c).__H;t&&(Ks===Js?(t.__h=[],Js.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ra,e.__N=e.i=void 0}))):(t.__h.forEach(ma),t.__h.forEach(ya),t.__h=[],Xs=0)),Ks=Js},ps.diffed=function(e){oa&&oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ta.push(t)&&Qs===ps.requestAnimationFrame||((Qs=ps.requestAnimationFrame)||ga)(fa)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ra&&(e.__=e.__V),e.i=void 0,e.__V=ra}))),Ks=Js=null},ps.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ma),e.__h=e.__h.filter((function(e){return!e.__||ya(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ps.__e(r,e.__v)}})),sa&&sa(e,t)},ps.unmount=function(e){aa&&aa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{ma(e)}catch(e){t=e}})),r.__H=void 0,t&&ps.__e(t,r.__v))};var pa="function"==typeof requestAnimationFrame;function ga(e){var t,r=function(){clearTimeout(i),pa&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);pa&&(t=requestAnimationFrame(r))}function ma(e){var t=Js,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Js=t}function ya(e){var t=Js;e.__c=e.__(),Js=t}function ba(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function wa(e,t){return"function"==typeof t?t(e):t}var _a=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),Ca=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Ia=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Sa=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),ka=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),xa=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Aa=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Ta=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Ea=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),Ma=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),Na=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Ra=dn("[Surveys]");function Fa(e){return!(!e.start_date||e.end_date)}function Oa(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Pa(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var La="seenSurvey_",Da="inProgressSurvey_",Ba=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Za=e=>{var t=""+La+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+La+e.id+"_"+e.current_iteration),t},$a=e=>{localStorage.getItem(Za(e))||localStorage.setItem(Za(e),"true")},qa=[ka.Popover,ka.Widget,ka.API],Ha={ignoreConditions:!1,ignoreDelay:!1,displayType:Na.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return oi(e)&&isFinite(e)&&Math.floor(e)===e});var Va="0123456789abcdef";class ja{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new ja(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Va.charAt(this.bytes[t]>>>4)+Va.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 ja(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ya{constructor(){this.T=0,this.M=0,this.N=new Wa}generate(){var e=this.generateOrAbort();if(ei(e)){this.T=0;var t=this.generateOrAbort();if(ei(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.T)this.T=e,this.R();else{if(!(e+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return ja.fromFieldsV7(this.T,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.N.nextUint32())}R(){this.M=1024*this.N.nextUint32()+(1023&this.N.nextUint32())}}var Ga,za=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};zi&&!ei(zi.crypto)&&crypto.getRandomValues&&(za=e=>crypto.getRandomValues(e));class Wa{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(za(this.F),this.O=0),this.F[this.O++]}}var Ua=()=>Xa().toString(),Xa=()=>(Ga||(Ga=new Ya)).generate(),Ja="Mobile",Ka="iOS",Qa="Android",el="Tablet",tl=Qa+" "+el,rl="iPad",il="Apple",nl=il+" Watch",ol="Safari",sl="BlackBerry",al="Samsung",ll=al+"Browser",ul=al+" Internet",hl="Chrome",cl=hl+" OS",dl=hl+" "+Ka,vl="Internet Explorer",fl=vl+" "+Ja,pl="Opera",gl=pl+" Mini",ml="Edge",yl="Microsoft "+ml,bl="Firefox",wl=bl+" "+Ka,_l="Nintendo",Cl="PlayStation",Il="Xbox",Sl=Qa+" "+Ja,kl=Ja+" "+ol,xl="Windows",Al=xl+" Phone",Tl="Nokia",El="Ouya",Ml="Generic",Nl=Ml+" "+Ja.toLowerCase(),Rl=Ml+" "+el.toLowerCase(),Fl="Konqueror",Ol="(\\d+(\\.\\d+)?)",Pl=new RegExp("Version/"+Ol),Ll=new RegExp(Il,"i"),Dl=new RegExp(Cl+" \\w+","i"),Bl=new RegExp(_l+" \\w+","i"),Zl=new RegExp(sl+"|PlayBook|BB10","i"),$l={"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 ql=(e,t)=>t&&Hr(t,il)||function(e){return Hr(e,ol)&&!Hr(e,hl)&&!Hr(e,Qa)}(e),Hl=function(e,t){return t=t||"",Hr(e," OPR/")&&Hr(e,"Mini")?gl:Hr(e," OPR/")?pl:Zl.test(e)?sl:Hr(e,"IE"+Ja)||Hr(e,"WPDesktop")?fl:Hr(e,ll)?ul:Hr(e,ml)||Hr(e,"Edg/")?yl:Hr(e,"FBIOS")?"Facebook "+Ja:Hr(e,"UCWEB")||Hr(e,"UCBrowser")?"UC Browser":Hr(e,"CriOS")?dl:Hr(e,"CrMo")||Hr(e,hl)?hl:Hr(e,Qa)&&Hr(e,ol)?Sl:Hr(e,"FxiOS")?wl:Hr(e.toLowerCase(),Fl.toLowerCase())?Fl:ql(e,t)?Hr(e,Ja)?kl:ol:Hr(e,bl)?bl:Hr(e,"MSIE")||Hr(e,"Trident/")?vl:Hr(e,"Gecko")?bl:""},Vl={[fl]:[new RegExp("rv:"+Ol)],[yl]:[new RegExp(ml+"?\\/"+Ol)],[hl]:[new RegExp("("+hl+"|CrMo)\\/"+Ol)],[dl]:[new RegExp("CriOS\\/"+Ol)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ol)],[ol]:[Pl],[kl]:[Pl],[pl]:[new RegExp("(Opera|OPR)\\/"+Ol)],[bl]:[new RegExp(bl+"\\/"+Ol)],[wl]:[new RegExp("FxiOS\\/"+Ol)],[Fl]:[new RegExp("Konqueror[:/]?"+Ol,"i")],[sl]:[new RegExp(sl+" "+Ol),Pl],[Sl]:[new RegExp("android\\s"+Ol,"i")],[ul]:[new RegExp(ll+"\\/"+Ol)],[vl]:[new RegExp("(rv:|MSIE )"+Ol)],Mozilla:[new RegExp("rv:"+Ol)]},jl=function(e,t){var r=Hl(e,t),i=Vl[r];if(ei(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},Yl=[[new RegExp(Il+"; "+Il+" (.*?)[);]","i"),e=>[Il,e&&e[1]||""]],[new RegExp(_l,"i"),[_l,""]],[new RegExp(Cl,"i"),[Cl,""]],[Zl,[sl,""]],[new RegExp(xl,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Al,""];if(new RegExp(Ja).test(t)&&!/IEMobile\b/.test(t))return[xl+" "+Ja,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=$l[i]||"";return/arm/i.test(t)&&(n="RT"),[xl,n]}return[xl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ka,t.join(".")]}return[Ka,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ei(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qa+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qa+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Qa,t.join(".")]}return[Qa,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cl,""]],[/Linux|debian/i,["Linux",""]]],Gl=function(e){return Bl.test(e)?_l:Dl.test(e)?Cl:Ll.test(e)?Il:new RegExp(El,"i").test(e)?El:new RegExp("("+Al+"|WPDesktop)","i").test(e)?Al:/iPad/.test(e)?rl:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?nl:Zl.test(e)?sl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Tl,"i").test(e)?Tl:/(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(Ja).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)?Qa:tl:Qa:new RegExp("(pda|"+Ja+")","i").test(e)?Nl:new RegExp(el,"i").test(e)&&!new RegExp(el+" pc","i").test(e)?Rl:""},zl=function(e){var t=Gl(e);return t===rl||t===tl||"Kobo"===t||"Kindle Fire"===t||t===Rl?el:t===_l||t===Il||t===Cl||t===El?"Console":t===nl?"Wearable":t?Ja:"Desktop"},Wl="$copy_autocapture",Ul=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Xl=Uint8Array,Jl=Uint16Array,Kl=Uint32Array,Ql=new Xl([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]),eu=new Xl([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]),tu=new Xl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ru=function(e,t){for(var r=new Jl(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new Kl(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},iu=ru(Ql,2),nu=iu[0],ou=iu[1];nu[28]=258,ou[258]=28;for(var su=ru(eu,0)[1],au=new Jl(32768),lu=0;lu<32768;++lu){var uu=(43690&lu)>>>1|(21845&lu)<<1;uu=(61680&(uu=(52428&uu)>>>2|(13107&uu)<<2))>>>4|(3855&uu)<<4,au[lu]=((65280&uu)>>>8|(255&uu)<<8)>>>1}var hu=function(e,t,r){for(var i=e.length,n=0,o=new Jl(t);n<i;++n)++o[e[n]-1];var s,a=new Jl(t);for(n=0;n<t;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new Jl(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],c=a[e[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[au[c]>>>l]=u}else for(s=new Jl(i),n=0;n<i;++n)s[n]=au[a[e[n]-1]++]>>>15-e[n];return s},cu=new Xl(288);for(lu=0;lu<144;++lu)cu[lu]=8;for(lu=144;lu<256;++lu)cu[lu]=9;for(lu=256;lu<280;++lu)cu[lu]=7;for(lu=280;lu<288;++lu)cu[lu]=8;var du=new Xl(32);for(lu=0;lu<32;++lu)du[lu]=5;var vu=hu(cu,9,0),fu=hu(du,5,0),pu=function(e){return(e/8>>0)+(7&e&&1)},gu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Jl?Jl:e instanceof Kl?Kl:Xl)(r-t);return i.set(e.subarray(t,r)),i},mu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},yu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},bu=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,o=r.slice();if(!n)return[new Xl(0),0];if(1==n){var s=new Xl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,c=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[u].f<r[c].f?u++:c++],l=r[u!=h&&r[u].f<r[c].f?u++:c++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new Jl(d+1),f=wu(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(o.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));i<n;++i){var y=o[i].s;if(!(v[y]>t))break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=o[i].s;v[b]<t?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new Xl(v),f]},wu=function(e,t,r){return-1==e.s?Math.max(wu(e.l,t,r+1),wu(e.r,t,r+1)):t[e.s]=r},_u=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Jl(++t),i=0,n=e[0],o=1,s=function(e){r[i++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++o;else{if(!n&&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(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=e[a]}return[r.subarray(0,i),t]},Cu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},Iu=function(e,t,r){var i=r.length,n=pu(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var o=0;o<i;++o)e[n+o+4]=r[o];return 8*(n+4+i)},Su=function(e,t,r,i,n,o,s,a,l,u,h){mu(t,h++,r),++n[256];for(var c=bu(n,15),d=c[0],v=c[1],f=bu(o,15),p=f[0],g=f[1],m=_u(d),y=m[0],b=m[1],w=_u(p),_=w[0],C=w[1],I=new Jl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=bu(I,7),x=k[0],A=k[1],T=19;T>4&&!x[tu[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Cu(n,cu)+Cu(o,du)+s,P=Cu(n,d)+Cu(o,p)+s+14+3*T+Cu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Iu(t,h,e.subarray(l,l+u));if(mu(t,h,1+(P<O)),h+=2,P<O){E=hu(d,v,0),M=d,N=hu(p,g,0),R=p;var L=hu(x,A,0);mu(t,h,b-257),mu(t,h+5,C-1),mu(t,h+10,T-4),h+=14;for(S=0;S<T;++S)mu(t,h+3*S,x[tu[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];mu(t,h,L[q]),h+=x[q],q>15&&(mu(t,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=vu,M=cu,N=fu,R=du;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;yu(t,h,E[q+257]),h+=M[q+257],q>7&&(mu(t,h,i[S]>>>23&31),h+=Ql[q]);var H=31&i[S];yu(t,h,N[H]),h+=R[H],H>3&&(yu(t,h,i[S]>>>5&8191),h+=eu[H])}else yu(t,h,E[i[S]]),h+=M[i[S]];return yu(t,h,E[256]),h+M[256]},ku=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xu=function(){for(var e=new Kl(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Au=function(e,t,r,i,n){return function(e,t,r,i,n,o){var s=e.length,a=new Xl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?u=Iu(l,u,e.subarray(h,c)):(l[h]=o,u=Iu(l,u,e.subarray(h,s)))}else{for(var d=ku[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Jl(32768),m=new Jl(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},_=new Kl(25e3),C=new Jl(288),I=new Jl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=w(h),M=32767&h,N=m[E];if(g[M]=N,m[E]=M,A<=h){var R=s-h;if((S>7e3||x>24576)&&R>423){u=Su(e,l,0,_,C,I,k,x,T,h-T,u),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==w(h-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,h),q=Math.min(258,R);D<=Z&&--L&&M!=N;){if(e[h+O]==e[h+O-D]){for(var H=0;H<q&&e[h+H]==e[h+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=h-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(M=N)-(N=g[M])+32768&32767}if(P){_[x++]=268435456|ou[O]<<18|su[P];var z=31&ou[O],W=31&su[P];k+=Ql[z]+eu[W],++C[257+z],++I[W],A=h+O,++S}else _[x++]=e[h],++C[e[h]]}}u=Su(e,l,o,_,C,I,k,x,T,h-T,u)}return gu(a,0,i+pu(u)+n)}(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,r,i,!0)},Tu=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Eu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=xu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Au(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=n.length;return function(e,t){var r=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&&Tu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Tu(n,o-8,r.d()),Tu(n,o-4,i),n}var Mu=function(e){var t,r,i,n,o="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=e.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ii(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=n+1)}return r>t&&(o+=e.substring(t,e.length)),o},Nu=!!rn||!!tn,Ru="text/plain",Fu=function(e,t,i){var n;void 0===i&&(i=!0);var[o,s]=e.split("?"),a=r({},t),l=null!==(n=null==s?void 0:s.split("&").map((e=>{var t,[r,n]=e.split("="),o=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],u=Tn(a);return u&&l.push(u),o+"?"+l.join("&")},Ou=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Pu=e=>{var{data:t,compression:r}=e;if(t){if(r===Ul.GZipJS){var i=Eu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Xl(e.length+(e.length>>>1)),n=0,o=function(e){i[n++]=e},s=0;s<r;++s){if(n+5>i.length){var a=new Xl(n+8+(r-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 gu(i,0,n)}(Ou(t)),{mtime:0}),n=new Blob([i],{type:Ru});return{contentType:Ru,body:n,estimatedSize:n.size}}if(r===Ul.Base64){var o=function(e){var t,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!e)return e;e=Mu(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[l++]=s.charAt(t)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<e.length);switch(u=h.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ou(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ou(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Lu=[];tn&&Lu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:o,estimatedSize:s}=null!==(t=Pu(e))&&void 0!==t?t:{},a=new Headers;pn(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(nn){var h=new nn;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),e.timeout)}}tn(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){cn.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{cn.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),rn&&Lu.push({transport:"XHR",method:e=>{var t,r=new rn;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Pu(e))&&void 0!==t?t:{};pn(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Ki&&Ki.sendBeacon&&Lu.push({transport:"sendBeacon",method:e=>{var t=Fu(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Pu(e))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Ki.sendBeacon(t,o)}catch(e){}}});var Du=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Bu(e,t,r){return Ou({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Zu={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Du(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Du(t,e))))),icontains:(e,t)=>t.map($u).some((t=>e.map($u).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map($u).every((t=>e.map($u).every((e=>!t.includes(e)))))},$u=e=>e.toLowerCase();function qu(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ei(n)||ii(n))return!1;var o=[String(n)],s=Zu[i.operator];return!!s&&s(i.values,o)}))}var Hu=dn("[Stylesheet Loader]"),Vu=zi,ju=Qi;function Yu(e){return"$survey_response_"+e}var Gu="#020617",zu={fontFamily:"inherit",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:Ia.Right,widgetType:Ca.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Wu(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 Uu(e){var t;void 0===e&&(e=zu.backgroundColor),"#"===e[0]&&(t=Wu(e)),e.startsWith("rgb")&&(t=e);var r={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()];if(r&&(t=Wu(r)),!t)return Gu;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Gu:"white"}return Gu}function Xu(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Hu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var Ju=(e,t,i)=>{var n=ph(e),o=ju.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=ju.createElement("div");((e,t,i)=>{var n=r({},zu,i),o=e.style,s=![Ia.Center,Ia.Left,Ia.Right].includes(n.position)||t===ka.Widget&&(null==i?void 0:i.widgetType)===Ca.Tab;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Uu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-text-color",Uu(n.ratingButtonColor)),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Uu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",Uu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Uu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackgroundColor)||n.inputBackground;null!=i&&i.inputBackgroundColor||"white"!==n.backgroundColor||(a="#f8f8f8"),o.setProperty("--ph-survey-input-background",a),o.setProperty("--ph-survey-input-text-color",(null==i?void 0:i.inputTextColor)||Uu(a)),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,e.type,e.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Xu(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Ku=(e,t)=>{if(!t)return null;var r=e[Yu(t)];return Ur(r)?[...r]:r},Qu=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=e;o?($a(i),o.capture(Ea.SENT,r({[Ma.SURVEY_NAME]:i.name,[Ma.SURVEY_ID]:i.id,[Ma.SURVEY_ITERATION]:i.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Ma.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:Ku(t,e.id)}))),[Ma.SURVEY_SUBMISSION_ID]:n,[Ma.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,{$set:{[Ba(i,"responded")]:!0}})),s&&(Vu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),fh(i))):Ra.error("[survey sent] event not captured, PostHog instance not found.")},eh=(e,t,i)=>{if(t){if(!i){var n=dh(e);t.capture(Ea.DISMISSED,r({[Ma.SURVEY_NAME]:e.name,[Ma.SURVEY_ID]:e.id,[Ma.SURVEY_ITERATION]:e.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ma.SURVEY_PARTIALLY_COMPLETED]:Object.values((null==n?void 0:n.responses)||{}).filter((e=>!ni(e))).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==n?void 0:n.responses,{[Ma.SURVEY_SUBMISSION_ID]:null==n?void 0:n.surveySubmissionId,[Ma.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:Ku((null==n?void 0:n.responses)||{},e.id)}))),$set:{[Ba(e,"dismissed")]:!0}})),fh(e),$a(e),Vu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ra.error("[survey dismissed] event not captured, PostHog instance not found.")},th=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),rh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,ih=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?rh(e.questions,th(e.questions)):e.questions,nh=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Ta.Always||vh(e)},oh=function(e,t){var r={__c:t="__cC"+_s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Os(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),sh=()=>va(oh),ah=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return Us(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function lh(e){return null!=e?e:"icontains"}function uh(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==Vu||null==(r=Vu.location)?void 0:r.href;if(!n)return!1;var o=[e.conditions.url],s=lh(null==(i=e.conditions)?void 0:i.urlMatchType);return Zu[s](o,[n])}var hh=e=>{var t=""+Da+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Da+e.id+"_"+e.current_iteration),t},ch=(e,t)=>{try{localStorage.setItem(hh(e),JSON.stringify(t))}catch(e){Ra.error("Error setting in-progress survey state in localStorage",e)}},dh=e=>{try{var t=localStorage.getItem(hh(e));if(t)return JSON.parse(t)}catch(e){Ra.error("Error getting in-progress survey state from localStorage",e)}return null},vh=e=>{var t=dh(e);return!ni(null==t?void 0:t.surveySubmissionId)},fh=e=>{try{localStorage.removeItem(hh(e))}catch(e){Ra.error("Error clearing in-progress survey state from localStorage",e)}};function ph(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var gh=0;function mh(e,t,r,i,n,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--gh,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return ps.vnode&&ps.vnode(u),u}var yh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),bh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),wh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),_h=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),Ch=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),Ih=mh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[mh("title",{id:"close-survey-title",children:"Close survey"}),mh("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"})]}),Sh=mh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[mh("g",{"clip-path":"url(#clip0_2415_6911)",children:[mh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:mh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),mh("g",{mask:"url(#mask0_2415_6911)",children:[mh("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"}),mh("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"}),mh("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"}),mh("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"}),mh("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"}),mh("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"})]})]}),mh("defs",{children:mh("clipPath",{id:"clip0_2415_6911",children:mh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function kh(){return mh("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Sh]})}function xh(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=e,{isPreviewMode:l}=va(oh);return mh("div",{className:"bottom-section",children:[!a&&mh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==zi||zi.open(o)),l?null==s||s():n()},children:t}),!i.whiteLabel&&mh(kh,{})]})}function Ah(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return mh("div",{class:"question-header",children:[mh(t.type===xa.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&ah({component:Ts("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Th(e){var{onClick:t}=e,{isPreviewMode:r}=va(oh);return mh("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ih})}mh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:mh("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"})});var Eh=zi;function Mh(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=e,{isPopup:a}=va(oh);return ha((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return xn(Eh,"keydown",e),()=>{Eh.removeEventListener("keydown",e)}}),[s]),mh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&mh(Th,{onClick:()=>s()}),mh("h3",{className:"thank-you-message-header",children:t}),r&&ah({component:Ts("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&mh(xh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Nh=e=>Ur(e)&&e.every((e=>ti(e)));function Rh(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=e,{isPreviewMode:l}=sh(),u=ca(null),[h,c]=ua((()=>ti(a)?a:""));ha((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var d="surveyQuestion"+s;return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:r,htmlFor:d}),mh("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>{c(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:h})]}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:!h&&!t.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Fh(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=e;return mh(Ms,{children:[mh("div",{className:"question-container",children:mh(Ah,{question:t,forceDisableHtml:r})}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Oh(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=e,l=t.scale,u=10===t.scale?0:1,[h,c]=ua((()=>oi(a)?a:Ur(a)&&a.length>0&&oi(parseInt(a[0]))?parseInt(a[0]):ti(a)&&oi(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=sh(),v=e=>d?s(e):o(e);return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:r}),mh("div",{className:"rating-section",children:[mh("div",{className:"rating-options",children:["emoji"===t.display&&mh("div",{className:"rating-options-emoji",children:(3===t.scale?Dh:Bh).map(((e,r)=>mh("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===h?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;c(e),t.skipSubmitButton&&v(e)},children:e},r)))}),"number"===t.display&&mh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Hh(t.scale).map(((e,r)=>mh(Ph,{displayQuestionIndex:i,active:h===e,appearance:n,num:e,setActiveNumber:e=>{c(e),t.skipSubmitButton&&v(e)}},r)))})]}),mh("div",{className:"rating-text",children:[mh("div",{children:t.lowerBoundLabel}),mh("div",{children:t.upperBoundLabel})]})]})]}),mh(xh,{text:t.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(h)&&!t.optional,appearance:n,onSubmit:()=>o(h),onPreviewSubmit:()=>s(h),skipSubmitButton:t.skipSubmitButton})]})}function Ph(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return mh("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Lh(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=e,u=ca(null),h=da((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=rh(t,th(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[c,d]=ua((()=>((e,t)=>ti(e)||Nh(e)?e:t===xa.SingleChoice?null:[])(l,t.type))),[v,f]=ua((()=>((e,t)=>{if(ti(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Nh(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=sh(),g=t.type===xa.SingleChoice,m=t.type===xa.MultipleChoice,y=t.skipSubmitButton&&g&&!t.hasOpenChoice,b=(e,t)=>{if(t){var i=!v.isSelected;return f((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(g)return d(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(y&&(s(e),p&&a(e)));m&&Ur(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),g&&d(t)},_=e=>{e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!t.optional&&(!!ii(c)||(!(!Ur(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Ur(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:i}),mh("fieldset",{className:"multiple-choice-options limit-height",children:[mh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===e:Ur(c)&&c.includes(e);return mh("label",{className:i?"choice-option-open":"",children:[mh("div",{className:"response-choice",children:[mh("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,i),id:o,"aria-controls":s}),mh("span",{children:i?e+":":e})]}),i&&mh("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:t=>{v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Dh=[wh,bh,yh],Bh=[_h,wh,bh,yh,Ch],Zh=[1,2,3,4,5],$h=[1,2,3,4,5,6,7],qh=[0,1,2,3,4,5,6,7,8,9,10];function Hh(e){switch(e){case 5:default:return Zh;case 7:return $h;case 10:return qh}}var Vh=zi,jh=Qi,Yh="ph:show_survey_widget",Gh="PHWidgetSurveyClickListener";function zh(e,t,r){var i,n=e.questions[t],o=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Aa.End:o;if(n.branching.type===Aa.End)return Aa.End;if(n.branching.type===Aa.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Aa.ResponseBased){if(n.type===xa.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Aa.End?Aa.End:o}}else if(n.type===xa.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))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")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Aa.End?Aa.End:o}}return o}return Ra.warn("Falling back to next question index due to unexpected branching type"),o}var Wh=250,Uh=20,Xh=12;class Jh{constructor(e){var t=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePopoverSurvey=e=>{var t;this.B(e.id),this.Z(e);var i=(null==(t=e.appearance)?void 0:t.surveyPopupDelaySeconds)||0,{shadow:n}=Ju(e,this._posthog);if(i<=0)return Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$}),n);var o=setTimeout((()=>{if(this.P.delete(e.id),!uh(e))return this.$(e);Ws(mh(rc,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*i);this.P.set(e.id,o)},this.q=e=>{var{shadow:t,isNewlyCreated:r}=Ju(e,this._posthog);r&&Ws(mh(nc,{posthog:this._posthog,survey:e},e.id),t)},this.H=e=>{this.V(e);var t=this.L.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Gh),this.L.delete(e.id),Ra.info("Removed click listener for survey "+e.id))},this.j=(e,t)=>{var r=jh.querySelector(t),i=this.L.get(e.id);if(r){if(this.q(e),i){if(r===i.element)return;Ra.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.H(e)}if(!r.hasAttribute(Gh)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Ia.NextToTrigger?function(e,t){try{var r=e.getBoundingClientRect(),i=Vh.innerHeight,n=Vh.innerWidth,o=Wh,s=r.left+r.width/2-t/2;s+t>n-Uh&&(s=n-t-Uh),s<Uh&&(s=Uh);var a=Xh,l=i-r.bottom,u=r.top,h=l<o&&u>l;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:zu.zIndex}}catch(e){return Ra.warn("Failed to calculate trigger position:",e),null}}(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||zu.maxWidth)):{};Vh.dispatchEvent(new CustomEvent(Yh,{detail:{surveyId:e.id,position:n}}))};xn(r,"click",n),r.setAttribute(Gh,"true"),this.L.set(e.id,{element:r,listener:n,survey:e}),Ra.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.H(e)},this.renderPopover=e=>{var{shadow:t}=Ju(e,this._posthog);Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$}),t)},this.renderSurvey=(e,t)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this.Y(e),Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.G(e)&&t.W(e)&&t.U(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===ka.Popover||e.type===ka.Widget)),i=t.X(r),n=new Set;i.forEach((e=>{if(e.type===ka.Widget){var r,i,o,s;if((null==(r=e.appearance)?void 0:r.widgetType)===Ca.Tab)return void t.q(e);if((null==(i=e.appearance)?void 0:i.widgetType)===Ca.Selector&&null!=(o=e.appearance)&&o.widgetSelector)n.add(e.id),t.j(e,null==(s=e.appearance)?void 0:s.widgetSelector)}ii(t.J)&&e.type===ka.Popover&&t.handlePopoverSurvey(e)})),t.L.forEach((e=>{var{survey:r}=e;n.has(r.id)||t.H(r)}))}),e)},this.Z=e=>{ii(this.J)||Ra.error("Survey "+this.J+" already in focus. Cannot add survey "+e.id+"."),this.J=e.id},this.$=e=>{this.J!==e.id&&Ra.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.B(e.id),this.K(),this.J=null,this.V(e)},this._posthog=e,this.J=null}B(e){var t=this.P.get(e);t&&(clearTimeout(t),this.P.delete(e))}cancelSurvey(e){this.P.has(e)&&(Ra.info("Cancelled pending survey "+e),this.B(e),this.J===e&&(this.J=null))}X(e){return e.sort(((e,t)=>{var r,i,n=vh(e),o=vh(t);if(n&&!o)return-1;if(!n&&o)return 1;var s=e.schedule===Ta.Always,a=t.schedule===Ta.Always;return s&&!a?1:!s&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}Y(e){if(!this.D.has(e.id))try{var t,{params:r,autoSubmit:i}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ei(a)){var l=decodeURIComponent(s),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);t[c]||(t[c]=[]),t[c].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(Vh.location.search);if(0===Object.keys(r).length)return;Ra.info("[Survey Prefill] Detected URL prefill parameters");var n=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],o=Yu(e.id);try{switch(e.type){case xa.SingleChoice:if(!e.choices||0===e.choices.length)return void cn.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=e.choices.length)return void cn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=e.choices[s];break;case xa.MultipleChoice:if(!e.choices||0===e.choices.length)return void cn.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void cn.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&cn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=l;break;case xa.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||u<0||u>h)return void cn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=u;break;default:cn.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){cn.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,r);if(0===Object.keys(n).length)return void Ra.warn("[Survey Prefill] No valid responses after conversion");var o=Ua();ch(e,{surveySubmissionId:o,responses:n,lastQuestionIndex:0}),Ra.info("[Survey Prefill] Stored prefilled responses in localStorage");var s=i&&(null==(t=this._posthog.config.surveys)?void 0:t.autoSubmitIfComplete)&&function(e,t){return e.questions.every((e=>{if(e.optional)return!0;if(e.type===xa.Link||e.type===xa.Open)return!0;if(!e.id)return!1;var r=Yu(e.id);return t.hasOwnProperty(r)}))}(e,n);s&&this.ee(e,n,o),this.D.add(e.id)}catch(e){Ra.error("[Survey Prefill] Error handling URL prefill:",e)}}ee(e,t,r){var i,n,o=null!==(i=null==(n=this._posthog.config.surveys)?void 0:n.autoSubmitDelay)&&void 0!==i?i:800;Ra.info("[Survey Prefill] Auto-submit scheduled"),this.te=setTimeout((()=>{Ra.info("[Survey Prefill] Auto-submitting survey"),Qu({responses:t,survey:e,surveySubmissionId:r,posthog:this._posthog,isSurveyCompleted:!0})}),o)}re(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}G(e){return!e.conditions||uh(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!on)return!1;var n=zl(on);return Zu[lh(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ju||!ju.querySelector(e.conditions.selector))}(e)}ie(e){return nh(e)||this.re(e.internal_targeting_flag_key)||vh(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Fa(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!qa.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.re(e.linked_flag_key,n)?this.re(e.targeting_flag_key)?this.ie(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(Za(e))&&!nh(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}W(e){var t;if(!Oa(e)&&!Pa(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}U(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.re(r)}))}V(e){try{var t=jh.querySelector(ph(e,!0));null!=t&&t.shadowRoot&&Ws(null,t.shadowRoot),null==t||t.remove()}catch(t){Ra.warn("Failed to remove survey "+e.id+" from DOM:",t)}}K(){this.te&&(clearTimeout(this.te),this.te=void 0)}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.J,surveyTimeouts:this.P,handleWidget:this.q,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.j,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.re.bind(this)}}}function Kh(e,t){if(jh&&Vh){var r,i=new Jh(e);if(e.config.disable_surveys_automatic_display)return Ra.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Ra.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ei(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),xn(jh,"visibilitychange",(()=>{jh.hidden?ei(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Qh(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;ha((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,n=t.type===ka.Widget,o=uh(t),s=(null==(e=t.appearance)?void 0:e.widgetType)===Ca.Tab&&n;if(!o)return Ra.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Ra.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};xn(Vh,"popstate",o),xn(Vh,"hashchange",o);var s=Vh.history.pushState,a=Vh.history.replaceState;return Vh.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},Vh.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},()=>{Vh.removeEventListener("popstate",o),Vh.removeEventListener("hashchange",o),Vh.history.pushState=s,Vh.history.replaceState=a}}}),[n,t,r,i])}function ec(e,t,r){if(void 0===t&&(t=Ia.Right),e===ka.ExternalSurvey)return{};switch(t){case Ia.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ia.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ia.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ia.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ia.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ia.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ia.Left:return{left:"30px"};case Ia.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Ia.Right:return{right:e===ka.Widget&&r===Ca.Tab?"60px":"30px"}}}function tc(e){switch(void 0===e&&(e=Sa.Right),e){case Sa.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sa.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sa.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Sa.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function rc(e){var t,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{})}=e,y=ca(null),b=Number.isInteger(d),w=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:C,hidePopupWithViewTransition:I}=function(e,t,r,i,n,o,s){var[a,l]=ua(i||0===r||e.type===ka.ExternalSurvey),[u,h]=ua(!1),c=()=>{var t=()=>{o&&n(e),l(!1)};jh.startViewTransition?jh.startViewTransition((()=>{var e;null==s||null==(e=s.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},d=t=>{t.detail.surveyId===e.id&&c()};return ha((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{uh(e)&&(l(!0),Vh.dispatchEvent(new Event("PHSurveyShown")),t.capture(Ea.SHOWN,{[Ma.SURVEY_NAME]:e.name,[Ma.SURVEY_ID]:e.id,[Ma.SURVEY_ITERATION]:e.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(xn(Vh,"PHSurveyClosed",d),xn(Vh,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),Vh.removeEventListener("PHSurveyClosed",d),Vh.removeEventListener("PHSurveySent",n)}}return o(),()=>{Vh.removeEventListener("PHSurveyClosed",d),Vh.removeEventListener("PHSurveySent",n)}}}else Ra.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Qh({survey:e,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,w,b,v,f,y),S=C||d===l.questions.length,k=da((()=>{var e=dh(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{eh(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Ua(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return _?mh(oh.Provider,{value:k,children:mh("div",{className:"ph-survey",style:r({},ec(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?mh(Mh,{header:(null==(o=l.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=l.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||zu,onClose:()=>{I(),m()}}):mh(ic,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function ic(e){var{survey:t,forceDisableHtml:i,posthog:n}=e,[o,s]=ua((()=>{var e=dh(t);return null!=e&&e.responses&&Ra.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:a,onPopupSurveyDismissed:l,isPopup:u,onPreviewSubmit:h,surveySubmissionId:c,isPreviewMode:d}=va(oh),[v,f]=ua((()=>{var e=dh(t);return a||(null==e?void 0:e.lastQuestionIndex)||0})),p=da((()=>ih(t)),[t]);ha((()=>{d&&!ei(a)&&f(a)}),[a,d]);var g=p.at(v);return g?mh("form",{className:"survey-form",name:"surveyForm",children:[u&&mh(Th,{onClick:()=>{l()}}),mh("div",{className:"survey-box",children:oc({question:g,forceDisableHtml:i,displayQuestionIndex:v,appearance:t.appearance||zu,onSubmit:e=>(e=>{var{res:i,displayQuestionIndex:a,questionId:l}=e;if(n)if(l){var u=Yu(l),h=r({},o,{[u]:i});s(h);var d=zh(t,a,i),v=d===Aa.End;v||(f(d),ch(t,{surveySubmissionId:c,responses:h,lastQuestionIndex:d})),(t.enable_partial_responses||v)&&Qu({responses:h,survey:t,surveySubmissionId:c,isSurveyCompleted:v,posthog:n})}else Ra.error("onNextButtonClick called without a questionId.");else Ra.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:v,questionId:g.id}),onPreviewSubmit:h,initialValue:g.id?o[Yu(g.id)]:void 0})})]}):null}function nc(e){var t,r,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=e,[d,v]=ua(!0),[f,p]=ua(!1),[g,m]=ua({}),y=()=>{p(!f)};if(ha((()=>{var e;if(h){if(!c){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&m({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Ra.info("Received show event for feedback button survey "+l.id),m(r.detail.position||{}),y())};return xn(Vh,Yh,t),()=>{Vh.removeEventListener(Yh,t)}}}else Ra.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Qh({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==Ta.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return mh(Ms,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&mh("button",{className:"ph-survey-widget-tab "+((null==(o=l.appearance)?void 0:o.tabPosition)===Sa.Top?"widget-tab-top":""),onClick:y,disabled:c,style:tc(null==(s=l.appearance)?void 0:s.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&mh(rc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var oc=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case xa.Open:return Ts(Rh,r({},u,{question:t,key:t.id}));case xa.Link:return Ts(Fh,r({},u,{question:t,key:t.id}));case xa.Rating:return Ts(Oh,r({},u,{question:t,key:t.id}));case xa.SingleChoice:case xa.MultipleChoice:return Ts(Lh,r({},u,{question:t,key:t.id}));default:return Ra.error("Unsupported question type: "+t.type),null}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.generateSurveys=Kh,sn.extendPostHogWithSurveys=Kh;var sc=dn("[Error tracking]");function ac(){return new Ci([new Li,new Gi,new Bi,new Di,new ji,new Vi,new $i,new Yi],Pi("web:javascript",Ei,Ri))}class lc{constructor(e){var t,r;this.ne=[],this.oe=ac(),this._instance=e,this.ne=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property($n))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],o=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.ne=n,this._instance.persistence&&this._instance.persistence.register({[$n]:this.ne,[qn]:o})}get se(){var e,t=!!this._instance.get_property(qn),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.oe.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ae(t)){if(this.le(t))return void sc.info("Skipping exception capture because a suppression rule matched");if(!this.se&&this.ue(t))return void sc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.he(t))return void sc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}le(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ti(r)&&r.length>0&&e.$exception_types.push(r),ti(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.ne.some((e=>{var r=e.values.map((e=>{var r,i=Zu[e.operator],n=Ur(e.value)?e.value:[e.value],o=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}ue(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}he(e){if(e.length>0){var t,r,i,n,o=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],s=o[o.length-1];return null!==(i=null==s||null==(n=s.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ae(e){return!ni(e)&&Ur(e)}}var uc=dn("[ExceptionAutocapture]"),hc=ac();function cc(e){var{event:t,error:r}=e;return hc.buildFromUnknown(r||t,{mechanism:{handled:!1}})}var dc={wrapOnError:e=>{var t=zi;t||uc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=cc({event:n[0],error:n[4]});return e(s),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=zi;t||uc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,o=cc({event:i});return e(o),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||uc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var o=i.join(" "),s=cc({error:i.find((e=>e instanceof Error)),event:o});return e(s),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.errorWrappingFunctions=dc,sn.posthogErrorWrappingFunctions=dc;var vc=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Ur(e)||e.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}t!==ho&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{};var fc={_patchFetch:(e,r,i)=>Rn(zi,"fetch",(n=>function(){var o=t((function*(t,o){var s=new Request(t,o);return vc(e,r,i,s),n(s)}));return function(e,t){return o.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Rn(zi.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return vc(e,t,r,u),i.call(this,n,u.url,s,a,l)}))};sn.__PosthogExtensions__.tracingHeadersPatchFns=fc,sn.postHogTracingHeadersPatchFns=fc;var pc,gc,mc=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},yc=function(e){if("loading"===document.readyState)return"loading";var t=mc();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"},bc=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},wc=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var i=e,n=i.id?"#"+i.id:bc(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(t||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;e=i.parentNode}}catch(e){}return r},_c=-1,Cc=function(){return _c},Ic=function(e){addEventListener("pageshow",(function(t){t.persisted&&(_c=t.timeStamp,e(t))}),!0)},Sc=function(){var e=mc();return e&&e.activationStart||0},kc=function(e,t){var r=mc(),i="navigate";return Cc()>=0?i="back-forward-cache":r&&(document.prerendering||Sc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.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}},xc=function(e,t,r){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},r||{})),i}}catch(e){}},Ac=function(e,t,r,i){var n,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(n||0))||void 0===n)&&(n=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Tc=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ec=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Mc=function(e){var t=!1;return function(){t||(e(),t=!0)}},Nc=-1,Rc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Fc=function(e){"hidden"===document.visibilityState&&Nc>-1&&(Nc="visibilitychange"===e.type?e.timeStamp:0,Pc())},Oc=function(){addEventListener("visibilitychange",Fc,!0),addEventListener("prerenderingchange",Fc,!0)},Pc=function(){removeEventListener("visibilitychange",Fc,!0),removeEventListener("prerenderingchange",Fc,!0)},Lc=function(){return Nc<0&&(Nc=Rc(),Oc(),Ic((function(){setTimeout((function(){Nc=Rc(),Oc()}),0)}))),{get firstHiddenTime(){return Nc}}},Dc=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Bc=[1800,3e3],Zc=function(e,t){t=t||{},Dc((function(){var r,i=Lc(),n=kc("FCP"),o=xc("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Sc(),0),n.entries.push(e),r(!0)))}))}));o&&(r=Ac(e,n,Bc,t.reportAllChanges),Ic((function(i){n=kc("FCP"),r=Ac(e,n,Bc,t.reportAllChanges),Tc((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},$c=[.1,.25],qc=0,Hc=1/0,Vc=0,jc=function(e){e.forEach((function(e){e.interactionId&&(Hc=Math.min(Hc,e.interactionId),Vc=Math.max(Vc,e.interactionId),qc=Vc?(Vc-Hc)/7+1:0)}))},Yc=function(){return pc?qc:performance.interactionCount||0},Gc=function(){"interactionCount"in performance||pc||(pc=xc("event",jc,{type:"event",buffered:!0,durationThreshold:0}))},zc=[],Wc=new Map,Uc=0,Xc=[],Jc=function(e){if(Xc.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=zc[zc.length-1],r=Wc.get(e.interactionId);if(r||zc.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Wc.set(i.id,i),zc.push(i)}zc.sort((function(e,t){return t.latency-e.latency})),zc.length>10&&zc.splice(10).forEach((function(e){return Wc.delete(e.id)}))}}},Kc=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Mc(e),"hidden"===document.visibilityState?e():(r=t(e),Ec(e)),r},Qc=[200,500],ed=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Dc((function(){var r;Gc();var i,n=kc("INP"),o=function(e){Kc((function(){e.forEach(Jc);var t=function(){var e=Math.min(zc.length-1,Math.floor((Yc()-Uc)/50));return zc[e]}();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,i())}))},s=xc("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});i=Ac(e,n,Qc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ec((function(){o(s.takeRecords()),i(!0)})),Ic((function(){Uc=Yc(),zc.length=0,Wc.clear(),n=kc("INP"),i=Ac(e,n,Qc,t.reportAllChanges)})))})))},td=[],rd=[],id=0,nd=new WeakMap,od=new Map,sd=-1,ad=function(e){td=td.concat(e),ld()},ld=function(){sd<0&&(sd=Kc(ud))},ud=function(){od.size>10&&od.forEach((function(e,t){Wc.has(t)||od.delete(t)}));var e=zc.map((function(e){return nd.get(e.entries[0])})),t=rd.length-50;rd=rd.filter((function(r,i){return i>=t||e.includes(r)}));for(var r=new Set,i=0;i<rd.length;i++){var n=rd[i];hd(n.startTime,n.processingEnd).forEach((function(e){r.add(e)}))}var o=td.length-1-50;td=td.filter((function(e,t){return e.startTime>id&&t>o||r.has(e)})),sd=-1};Xc.push((function(e){e.interactionId&&e.target&&!od.has(e.interactionId)&&od.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;id=Math.max(id,e.processingEnd);for(var i=rd.length-1;i>=0;i--){var n=rd[i];if(Math.abs(r-n.renderTime)<=8){(t=n).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:r,entries:[e]},rd.push(t)),(e.interactionId||"first-input"===e.entryType)&&nd.set(e,t),ld()}));var hd=function(e,t){for(var r,i=[],n=0;r=td[n];n++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},cd=[2500,4e3],dd={},vd={onLCP:function(e,t){!function(e,t){t=t||{},Dc((function(){var r,i=Lc(),n=kc("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Sc(),0),n.entries=[e],r())}))},s=xc("largest-contentful-paint",o);if(s){r=Ac(e,n,cd,t.reportAllChanges);var a=Mc((function(){dd[n.id]||(o(s.takeRecords()),s.disconnect(),dd[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Kc(a)}),{once:!0,capture:!0})})),Ec(a),Ic((function(i){n=kc("LCP"),r=Ac(e,n,cd,t.reportAllChanges),Tc((function(){n.value=performance.now()-i.timeStamp,dd[n.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=mc();if(r){var i=r.activationStart||0,n=e.entries[e.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),l=Math.max(a,o?o.responseEnd-i:0),u=Math.max(l,n.startTime-i);t={element:wc(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(t.url=n.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Zc(Mc((function(){var r,i=kc("CLS",0),n=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,o.push(e)):(n=e.value,o=[e])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=xc("layout-shift",s);a&&(r=Ac(e,i,$c,t.reportAllChanges),Ec((function(){s(a.takeRecords()),r(!0)})),Ic((function(){n=0,i=kc("CLS",0),r=Ac(e,i,$c,t.reportAllChanges),Tc((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var n=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];n&&(r={largestShiftTarget:wc(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:yc(i.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Zc((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:yc(Cc())};if(e.entries.length){var r=mc(),i=e.entries[e.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:yc(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){gc||(gc=xc("long-animation-frame",ad)),ed((function(t){var r=function(e){var t=e.entries[0],r=nd.get(t),i=t.processingStart,n=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=hd(t.startTime,n),a=e.entries.find((function(e){return e.target})),l=a&&a.target||od.get(t.interactionId),u=[t.startTime+t.duration,n].concat(s.map((function(e){return e.startTime+e.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:wc(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:yc(t.startTime)};return Object.assign(e,{attribution:c})}(t);e(r)}),t)}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.postHogWebVitalsCallbacks=vd,sn.postHogWebVitalsCallbacks=vd;class fd{constructor(e){this.disabled=!1===e;var t=Kr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var pd=dn("[AutoCapture]");function gd(e,t){return t.length>e?t.slice(0,e)+"...":t}function md(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!fo(t));return t}function yd(e,t,r,i){var n=e.tagName.toLowerCase(),o={tag_name:n};So.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=gd(1024,Vo(e)):o.$el_text=gd(1024,Co(e)));var s=wo(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),pn(e.attributes,(function(r){var n;if((!Po(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&Ho(r.value)&&(n=r.name,!ti(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=yo(s).join(" ")),o["attr__"+r.name]=gd(1024,s)}}));for(var a=1,l=1,u=e;u=md(u);)a++,u.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function bd(e,t){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],h=e;h.parentNode&&!po(h,"body");)mo(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(pn(u,(e=>{var t=Oo(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=t&&f&&Ho(f)&&f),Hr(wo(e),"ph-no-capture")&&(p=!0),d.push(yd(e,o,s,a));var r=function(e){if(!Oo(e))return{};var t={};return pn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&Ho(i)&&(t[r]=i)}})),t}(e);gn(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?d[0].$el_text=Vo(e):d[0].$el_text=Co(e)),f){var g,m;d[0].attr__href=f;var y=null==(g=An(f))?void 0:g.host,b=null==zi||null==(m=zi.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:gn({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Yo(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class wd{constructor(e){this.ce=!1,this.de=null,this.ve=!1,this.instance=e,this.rageclicks=new fd(e.config.rageclick),this.fe=null}get pe(){var e,t,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}ge(){if(this.isBrowserSupported()){if(zi&&Qi){var e=e=>{e=e||(null==zi?void 0:zi.event);try{this.me(e)}catch(e){pd.error("Failed to capture event",e)}};if(xn(Qi,"submit",e,{capture:!0}),xn(Qi,"change",e,{capture:!0}),xn(Qi,"click",e,{capture:!0}),this.pe.capture_copied_text){var t=e=>{e=e||(null==zi?void 0:zi.event),this.me(e,Wl)};xn(Qi,"copy",t,{capture:!0}),xn(Qi,"cut",t,{capture:!0})}}}else pd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ce&&(this.ge(),this.ce=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.ve=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Dn]:!!e.autocapture_opt_out}),this.de=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.fe=e}getElementSelectors(e){var t,r=[];return null==(t=this.fe)||t.forEach((t=>{var i=null==Qi?void 0:Qi.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Dn],i=this.de;if(ii(i)&&!si(r)&&!this.instance.ye())return!1;var n=null!==(t=this.de)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}me(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Io(e);if(go(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Mo(i,this.instance.config.rageclick)&&this.me(e,"$rageclick");var n=t===Wl;if(i&&Fo(i,e,this.pe,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=bd(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.pe.element_attribute_ignorelist,elementsChainAsString:this.ve});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),t===Wl){var l,u=_o(null==zi||null==(l=zi.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Xr(null==Qi?void 0:Qi.querySelectorAll)}}var _d={};function Cd(e){return function(e,t){var r=_d[e];if(r)return r;var i=t[e];if(Jr(i)&&!an())return _d[e]=i.bind(t);var n=t.document;if(n&&Xr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(i=s[e]),n.head.removeChild(o)}catch(t){cn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Xr(i)?_d[e]=i.bind(t):i}("MutationObserver",e)}function Id(e,t){return oi(e)&&e>=t}class Sd{be(e){var t,r,i,n,o,s=this.we((null==e?void 0:e.__onCapture)||this._e.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(e,t){this.Ce=[],this.we=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.Ie=e=>{var t=function(e){var t=Io(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ii(t)||this.Se(t)||this.Ce.push(t),this.Ce.length&&ei(this.ke)&&(this.ke=sn.setTimeout((()=>{this.xe()}),1e3))},this.Ae=()=>{var e=Date.now();e%50==0&&this.Ce.forEach((t=>{ei(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Te=()=>{this.Ee=Date.now()},this.instance=e,this.pe=this.be(t),this._onCapture=this.pe.__onCapture}start(e){this.Me(),this.Ne(),this.Re(),this.Fe(e)}Fe(e){if(!this.Oe){var t=Cd(sn);this.Oe=new t((e=>{this.Pe(e)})),this.Oe.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Oe)||e.disconnect(),this.Oe=void 0,sn.removeEventListener("click",this.Ie),sn.removeEventListener("scroll",this.Ae,{capture:!0}),sn.removeEventListener("selectionchange",this.Te)}Pe(e){this.Le=Date.now()}Me(){xn(sn,"click",this.Ie)}Ne(){xn(sn,"scroll",this.Ae,{capture:!0})}Re(){xn(sn,"selectionchange",this.Te)}Se(e){if(!e)return!0;if(!this.pe.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(vo(e.node))return!0;var r=this.Ce.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!po(e.node,"html")&&fo(e.node)&&!So.includes(e.node.tagName.toLowerCase()))}xe(){if(this.Ce.length){clearTimeout(this.ke),this.ke=void 0;var e=this.Ce;for(var t of(this.Ce=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Le&&t.timestamp<=this.Le?this.Le-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ee&&t.timestamp<=this.Ee?this.Ee-t.timestamp:void 0;var i=Id(t.scrollDelayMs,this.pe.scroll_threshold_ms),n=Id(t.selectionChangedDelayMs,this.pe.selection_change_threshold_ms),o=Id(t.mutationDelayMs,this.pe.mutation_threshold_ms),s=Id(t.absoluteDelayMs,1.1*this.pe.mutation_threshold_ms),a=oi(t.scrollDelayMs)&&t.scrollDelayMs<this.pe.scroll_threshold_ms,l=oi(t.mutationDelayMs)&&t.mutationDelayMs<this.pe.mutation_threshold_ms,u=oi(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.pe.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Le,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):t.absoluteDelayMs<this.pe.mutation_threshold_ms&&this.Ce.push(t))}this.Ce.length&&ei(this.ke)&&(this.ke=sn.setTimeout((()=>{this.xe()}),1e3))}}_e(e,t){this.instance.capture("$dead_click",r({},t,bd(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.pe.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)})}}sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Sd(e,t);var kd=dn("[ExternalScriptsLoader]"),xd=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return kd.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Qi?void 0:Qi.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Qi)return r("document not found");var i=Qi.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Qi.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Qi.body.appendChild(i)};null!=Qi&&Qi.body?a():null==Qi||Qi.addEventListener("DOMContentLoaded",a)};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{var i="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(i="/array/"+e.config.token+"/config.js"),"toolbar"===t){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=e.requestRouter.endpointFor("assets",i);xd(e,o,r)},sn.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);xd(e,i,r)};var Ad="";var Td=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ed(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Qi),Ad)return Ad;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Ua();!Ad&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";t.cookie=s+";max-age=3",t.cookie.includes(n)&&(t.cookie=s+";max-age=0",Ad=o)}return Ad}(e);if(!r){var i=(e=>{var t=e.match(Td);return t?t[0]:""})(e);i!==r&&cn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Md={De:()=>!!Qi,Be:function(e){cn.error("cookieStore error: "+e)},Ze:function(e){if(Qi){try{for(var t=e+"=",r=Qi.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},$e:function(e){var t;try{t=JSON.parse(Md.Ze(e))||{}}catch(e){}return t},qe:function(e,t,r,i,n){if(Qi)try{var o="",s="",a=Ed(Qi.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}n&&(s="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&cn.warn("cookieStore warning: large cookie, len="+u.length),Qi.cookie=u,u}catch(e){return}},He:function(e,t){if(null!=Qi&&Qi.cookie)try{Md.qe(e,"",-1,t)}catch(e){return}}},Nd=null,Rd={De:function(){if(!ii(Nd))return Nd;var e=!0;if(ei(zi))e=!1;else try{var t="__mplssupport__";Rd.qe(t,"xyz"),'"xyz"'!==Rd.Ze(t)&&(e=!1),Rd.He(t)}catch(t){e=!1}return e||cn.error("localStorage unsupported; falling back to cookie store"),Nd=e,e},Be:function(e){cn.error("localStorage error: "+e)},Ze:function(e){try{return null==zi?void 0:zi.localStorage.getItem(e)}catch(e){Rd.Be(e)}return null},$e:function(e){try{return JSON.parse(Rd.Ze(e))||{}}catch(e){}return null},qe:function(e,t){try{null==zi||zi.localStorage.setItem(e,JSON.stringify(t))}catch(e){Rd.Be(e)}},He:function(e){try{null==zi||zi.localStorage.removeItem(e)}catch(e){Rd.Be(e)}}},Fd=["distinct_id",Gn,zn,lo,ao],Od=r({},Rd,{$e:function(e){try{var t={};try{t=Md.$e(e)||{}}catch(e){}var r=gn(t,JSON.parse(Rd.Ze(e)||"{}"));return Rd.qe(e,r),r}catch(e){}return null},qe:function(e,t,r,i,n,o){try{Rd.qe(e,t,void 0,void 0,o);var s={};Fd.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Md.qe(e,s,r,i,n,o)}catch(e){Rd.Be(e)}},He:function(e,t){try{null==zi||zi.localStorage.removeItem(e),Md.He(e,t)}catch(e){Rd.Be(e)}}}),Pd={},Ld={De:function(){return!0},Be:function(e){cn.error("memoryStorage error: "+e)},Ze:function(e){return Pd[e]||null},$e:function(e){return Pd[e]||null},qe:function(e,t){Pd[e]=t},He:function(e){delete Pd[e]}},Dd=null,Bd={De:function(){if(!ii(Dd))return Dd;if(Dd=!0,ei(zi))Dd=!1;else try{var e="__support__";Bd.qe(e,"xyz"),'"xyz"'!==Bd.Ze(e)&&(Dd=!1),Bd.He(e)}catch(e){Dd=!1}return Dd},Be:function(e){cn.error("sessionStorage error: ",e)},Ze:function(e){try{return null==zi?void 0:zi.sessionStorage.getItem(e)}catch(e){Bd.Be(e)}return null},$e:function(e){try{return JSON.parse(Bd.Ze(e))||null}catch(e){}return null},qe:function(e,t){try{null==zi||zi.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Bd.Be(e)}},He:function(e){try{null==zi||zi.sessionStorage.removeItem(e)}catch(e){Bd.Be(e)}}},Zd=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class $d{constructor(e){this._instance=e}get pe(){return this._instance.config}get consent(){return this.Ve()?Zd.DENIED:this.je}isOptedOut(){return"always"===this.pe.cookieless_mode||(this.consent===Zd.DENIED||this.consent===Zd.PENDING&&(this.pe.opt_out_capturing_by_default||"on_reject"===this.pe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Zd.DENIED}optInOut(e){this.Ye.qe(this.Ge,e?1:0,this.pe.cookie_expiration,this.pe.cross_subdomain_cookie,this.pe.secure_cookie)}reset(){this.Ye.He(this.Ge,this.pe.cross_subdomain_cookie)}get Ge(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get je(){var e=this.Ye.Ze(this.Ge);return vi(e)?Zd.GRANTED:Hr(fi,e)?Zd.DENIED:Zd.PENDING}get Ye(){if(!this.ze){var e=this.pe.opt_out_capturing_persistence_type;this.ze="localStorage"===e?Rd:Md;var t="localStorage"===e?Md:Rd;t.Ze(this.Ge)&&(this.ze.Ze(this.Ge)||this.optInOut(vi(t.Ze(this.Ge))),t.He(this.Ge,this.pe.cross_subdomain_cookie))}return this.ze}Ve(){return!!this.pe.respect_dnt&&!!kn([null==Ki?void 0:Ki.doNotTrack,null==Ki?void 0:Ki.msDoNotTrack,sn.doNotTrack],(e=>vi(e)))}}var qd=dn("[Dead Clicks]"),Hd=()=>!0,Vd=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Vn)),i=e.instance.config.capture_dead_clicks;return si(i)?i:!!Kr(i)||r};class jd{get lazyLoadedDeadClicksAutocapture(){return this.We}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Vn]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Ue((()=>{this.Xe()}))}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?qd.error("failed to load script",t):e()}))}Xe(){var e;if(Qi){if(!this.We&&null!=(e=sn.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.We=sn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.We.start(Qi),qd.info("starting...")}}else qd.error("`document` not found. Cannot start.")}stop(){this.We&&(this.We.stop(),this.We=void 0,qd.info("stopping..."))}}var Yd=dn("[ExceptionAutocapture]");class Gd{constructor(e){var t,r,i;this.Je=()=>{var e;if(zi&&this.isEnabled&&null!=(e=sn.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=sn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=sn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=sn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ke&&this.pe.capture_unhandled_errors&&(this.Ke=t(this.captureException.bind(this))),!this.Qe&&this.pe.capture_unhandled_rejections&&(this.Qe=r(this.captureException.bind(this))),!this.et&&this.pe.capture_console_errors&&(this.et=i(this.captureException.bind(this)))}catch(e){Yd.error("failed to start",e),this.tt()}}},this._instance=e,this.rt=!(null==(t=this._instance.persistence)||!t.props[Zn]),this.pe=this.it(),this.nt=new gi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,C:Yd}),this.startIfEnabled()}it(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(e)?t=r({},t,e):(ei(e)?this.rt:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.pe.capture_console_errors||this.pe.capture_unhandled_errors||this.pe.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Yd.info("enabled"),this.Ue(this.Je))}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Yd.error("failed to load script",t);e()}))}tt(){var e,t,r;null==(e=this.Ke)||e.call(this),this.Ke=void 0,null==(t=this.Qe)||t.call(this),this.Qe=void 0,null==(r=this.et)||r.call(this),this.et=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.rt=!!t||!1,this.pe=this.it(),this._instance.persistence&&this._instance.persistence.register({[Zn]:this.rt}),this.startIfEnabled()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.nt.consumeRateLimit(i)?Yd.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class zd{constructor(e){var t;this._instance=e,this.ot=(null==zi||null==(t=zi.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.st&&this.st(),this.st=void 0,cn.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(zi&&zi.history){var r=this;null!=(e=zi.history.pushState)&&e.__posthog_wrapped__||Rn(zi.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r.lt("pushState")})),null!=(t=zi.history.replaceState)&&t.__posthog_wrapped__||Rn(zi.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r.lt("replaceState")})),this.ut()}}lt(e){try{var t,r=null==zi||null==(t=zi.location)?void 0:t.pathname;if(!r)return;r!==this.ot&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ot=r}catch(t){cn.error("Error capturing "+e+" pageview",t)}}ut(){if(!this.st){var e=()=>{this.lt("popstate")};xn(zi,"popstate",e),this.st=()=>{zi&&zi.removeEventListener("popstate",e)}}}}var Wd=dn("[SegmentIntegration]");function Ud(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Ua();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(ro,"identified")),t()},n=r.user();"then"in n&&Xr(n.then)?n.then((e=>i(e))):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Wd.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Wd.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Wd.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);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()}))}))}var Xd="posthog-js";function Jd(e,t){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,c,d;if(!("*"===s||s.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=t.exception)?void 0:l.values)||[],p=f.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||t.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:t.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(g),t}}class Kd{constructor(e,t,r,i,n,o){this.name=Xd,this.setupOnce=function(s){s(Jd(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var Qd=null!=zi&&zi.location?Nn(zi.location.hash,"__posthog")||Nn(location.hash,"state"):null,ev="_postHogToolbarParams",tv=dn("[Toolbar]"),rv=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(rv||{});class iv{constructor(e){this.instance=e}ht(e){sn.ph_toolbar_state=e}ct(){var e;return null!==(e=sn.ph_toolbar_state)&&void 0!==e?e:rv.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),!zi||!Qi)return!1;e=null!=e?e:zi.location,r=null!=r?r:zi.history;try{if(!t){try{zi.localStorage.setItem("test","test"),zi.localStorage.removeItem("test")}catch(e){return!1}t=null==zi?void 0:zi.localStorage}var i,n=Qd||Nn(e.hash,"__posthog")||Nn(e.hash,"state"),o=n?bn((()=>JSON.parse(atob(decodeURIComponent(n)))))||bn((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(ev)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}dt(e){var t=sn.ph_load_toolbar||sn.ph_load_editor;!ni(t)&&Xr(t)?t(e,this.instance):tv.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Qi||!Qi.getElementById(uo));if(!zi||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(zi.localStorage.setItem(ev,JSON.stringify(r({},n,{source:void 0}))),this.ct()===rv.LOADED)this.dt(n);else if(this.ct()===rv.UNINITIALIZED){var o;this.ht(rv.LOADING),null==(o=sn.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return tv.error("[Toolbar] Failed to load",e),void this.ht(rv.UNINITIALIZED);this.ht(rv.LOADED),this.dt(n)})),xn(zi,"turbolinks:load",(()=>{this.ht(rv.UNINITIALIZED),this.loadToolbar(n)}))}return!0}vt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}var nv=dn("[TracingHeaders]");class ov{constructor(e){this.ft=void 0,this.gt=void 0,this.Je=()=>{var e,t;ei(this.ft)&&(null==(e=sn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ei(this.gt)&&(null==(t=sn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return nv.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.Ue(this.Je):(null==(e=this.ft)||e.call(this),null==(t=this.gt)||t.call(this),this.ft=void 0,this.gt=void 0)}}var sv="https?://(.*)",av=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lv=mn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],av),uv="<masked>",hv=["li_fat_id"];function cv(e,t,r){if(!Qi)return{};var i,n=t?mn([],av,r||[]):[],o=dv(Mn(Qi.URL,n,uv),e),s=(i={},pn(hv,(function(e){var t=Md.Ze(e);i[e]=t||null})),i);return gn(s,o)}function dv(e,t){var r=lv.concat(t||[]),i={};return pn(r,(function(t){var r=En(e,t);i[t]=r||null})),i}function vv(e){var t=function(e){return e?0===e.search(sv+"google.([^/?]*)")?"google":0===e.search(sv+"bing.com")?"bing":0===e.search(sv+"yahoo.com")?"yahoo":0===e.search(sv+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!ii(t)){i.$search_engine=t;var n=Qi?En(Qi.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function fv(){return navigator.language||navigator.userLanguage}function pv(){return(null==Qi?void 0:Qi.referrer)||"$direct"}function gv(e,t){var r=e?mn([],av,t||[]):[],i=null==en?void 0:en.href.substring(0,1e3);return{r:pv().substring(0,1e3),u:i?Mn(i,r,uv):void 0}}function mv(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=An(r))?void 0:t.host};if(i){n.$current_url=i;var o=An(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=dv(i);gn(n,s)}if(r){var a=vv(r);gn(n,a)}return n}function yv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function bv(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function wv(e,t){if(!on)return{};var r,i=e?mn([],av,t||[]):[],[n,o]=function(e){for(var t=0;t<Yl.length;t++){var[r,i]=Yl[t],n=r.exec(e),o=n&&(Xr(i)?i(n,e):i);if(o)return o}return["",""]}(on);return gn(_n({$os:n,$os_version:o,$browser:Hl(on,navigator.vendor),$device:Gl(on),$device_type:zl(on),$timezone:yv(),$timezone_offset:bv()}),{$current_url:Mn(null==en?void 0:en.href,i,uv),$host:null==en?void 0:en.host,$pathname:null==en?void 0:en.pathname,$raw_user_agent:on.length>1e3?on.substring(0,997)+"...":on,$browser_version:jl(on,navigator.vendor),$browser_language:fv(),$browser_language_prefix:(r=fv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==zi?void 0:zi.screen.height,$screen_width:null==zi?void 0:zi.screen.width,$viewport_height:null==zi?void 0:zi.innerHeight,$viewport_width:null==zi?void 0:zi.innerWidth,$lib:"web",$lib_version:un.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var _v=dn("[Web Vitals]"),Cv=9e5;class Iv{constructor(e){var t;this.yt=!1,this.ce=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.bt=()=>{clearTimeout(this.wt),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._t=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ei(i))_v.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Ct();if(!ei(n))if(ni(null==e?void 0:e.name)||ni(null==e?void 0:e.value))_v.error("Invalid metric received",e);else if(this.It&&e.value>=this.It)_v.error("Ignoring metric with value >= "+this.It,e);else this.F.url!==n&&(this.bt(),this.wt=setTimeout(this.bt,this.flushToCaptureTimeoutMs)),ei(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=ei(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.F.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.bt()}},this.Je=()=>{var e,t,r,i,n=sn.__PosthogExtensions__;ei(n)||ei(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._t.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._t.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._t.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._t.bind(this)),this.ce=!0):_v.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.yt=!(null==(t=this._instance.persistence)||!t.props[Hn]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=Kr(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(r)?(null==(t=this._instance.persistence)?void 0:t.props[jn])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get It(){var e=Kr(this._instance.config.capture_performance)&&oi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Cv;return 0<e&&e<=6e4?Cv:e}get isEnabled(){var e=null==en?void 0:en.protocol;if("http:"!==e&&"https:"!==e)return _v.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:si(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return si(t)?t:this.yt}startIfEnabled(){this.isEnabled&&!this.ce&&(_v.info("enabled, starting..."),this.Ue(this.Je))}onRemoteConfig(e){var t=Kr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Kr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Hn]:t}),this._instance.persistence.register({[jn]:r})),this.yt=t,this.startIfEnabled()}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(t=>{t?_v.error("failed to load script",t):e()}))}Ct(){var e=zi?zi.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?mn([],av,r||[]):[];return Mn(e,i,uv)}_v.error("Could not determine current URL")}}var Sv=dn("[Heatmaps]");function kv(e){return Kr(e)&&"clientX"in e&&"clientY"in e&&oi(e.clientX)&&oi(e.clientY)}class xv{constructor(e){var t;this.yt=!1,this.ce=!1,this.St=null,this.instance=e,this.yt=!(null==(t=this.instance.persistence)||!t.props[Bn]),this.rageclicks=new fd(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Kr(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 ei(this.instance.config.capture_heatmaps)?ei(this.instance.config.enable_heatmaps)?this.yt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ce)return;Sv.info("starting..."),this.kt(),this.xt()}else{var e;clearInterval(null!==(e=this.St)&&void 0!==e?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bn]:t}),this.yt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.F;return this.F=void 0,e}Tt(e){this.Ie(e.originalEvent,"deadclick")}xt(){this.St&&clearInterval(this.St),this.St=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Qi)?setInterval(this.Et.bind(this),this.flushIntervalMilliseconds):null}kt(){zi&&Qi&&(this.Mt=this.Et.bind(this),xn(zi,"beforeunload",this.Mt),this.Nt=e=>this.Ie(e||(null==zi?void 0:zi.event)),xn(Qi,"click",this.Nt,{capture:!0}),this.Rt=e=>this.Ft(e||(null==zi?void 0:zi.event)),xn(Qi,"mousemove",this.Rt,{capture:!0}),this.Ot=new jd(this.instance,Hd,this.Tt.bind(this)),this.Ot.startIfEnabled(),this.Pt=this.xt.bind(this),xn(Qi,"visibilitychange",this.Pt),this.ce=!0)}At(){var e;zi&&Qi&&(this.Mt&&zi.removeEventListener("beforeunload",this.Mt),this.Nt&&Qi.removeEventListener("click",this.Nt,{capture:!0}),this.Rt&&Qi.removeEventListener("mousemove",this.Rt,{capture:!0}),this.Pt&&Qi.removeEventListener("visibilitychange",this.Pt),clearTimeout(this.Lt),null==(e=this.Ot)||e.stop(),this.ce=!1)}Dt(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var i=e;i&&fo(i)&&!po(i,"body");){if(i===r)return!1;if(Hr(t,null==zi?void 0:zi.getComputedStyle(i).position))return!0;i=xo(i)}return!1}(Io(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Ie(e,t){var i;if(void 0===t&&(t="click"),!vo(e.target)&&kv(e)){var n=this.Dt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Bt(r({},n,{type:"rageclick"})),this.Bt(n)}}Ft(e){!vo(e.target)&&kv(e)&&(clearTimeout(this.Lt),this.Lt=setTimeout((()=>{this.Bt(this.Dt(e,"mousemove"))}),500))}Bt(e){if(zi){var t=zi.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?mn([],av,i||[]):[],o=Mn(t,n,uv);this.F=this.F||{},this.F[o]||(this.F[o]=[]),this.F[o].push(e)}}Et(){this.F&&!Qr(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Av{constructor(e){this._instance=e}doPageView(e,t){var r,i=this.Zt(e,t);return this.$t={pathname:null!==(r=null==zi?void 0:zi.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.Zt(e,null==(t=this.$t)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.$t)?void 0:e.pageViewId}}Zt(e,t){var r=this.$t;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(ei(o)||ei(s)||ei(a)||ei(l)||ei(u)||ei(h))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=o<=1?1:pi(s/o,0,1,cn),d=o<=1?1:pi(a/o,0,1,cn),v=l<=1?1:pi(u/l,0,1,cn),f=l<=1?1:pi(h/l,0,1,cn);i=gn(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Tv=dn("[FeatureFlags]"),Ev=dn("[FeatureFlags]",{debugEnabled:!0}),Mv="$active_feature_flags",Nv="$override_feature_flags",Rv="$feature_flag_payloads",Fv="$override_feature_flag_payloads",Ov="$feature_flag_request_id",Pv="$feature_flag_evaluated_at",Lv=e=>{var t={};for(var[r,i]of yn(e||{}))i&&(t[r]=i);return t},Dv=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):Tv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Bv=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Zv{constructor(e){this.qt=!1,this.Ht=!1,this.Vt=!1,this.jt=!1,this.Yt=!1,this.Gt=!1,this.zt=!1,this._instance=e,this.featureFlagEventHandlers=[]}Wt(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Tv.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t})):[]}Ut(){return this.Wt().length>0}flags(){if(this._instance.config.__preview_remote_config)this.Gt=!0;else{var e=!this.Xt&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Jt({disableFlags:e})}}get hasLoadedFlags(){return this.Ht}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Xn),t=this._instance.get_property(Nv),i=this._instance.get_property(Fv);if(!i&&!t)return e||{};var n=gn({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var s of o){var a,l,u=n[s],h=null==t?void 0:t[s],c=ei(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=ei(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[s],f=r({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});if(c!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v)f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[s]=f}return this.qt||(Tv.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.qt=!0),n}getFlagVariants(){var e=this._instance.get_property(Wn),t=this._instance.get_property(Nv);if(!t)return e||{};for(var r=gn({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this.qt||(Tv.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.qt=!0),r}getFlagPayloads(){var e=this._instance.get_property(Rv),t=this._instance.get_property(Fv);if(!t)return e||{};for(var r=gn({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this.qt||(Tv.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.qt=!0),r}reloadFeatureFlags(){this.jt||this._instance.config.advanced_disable_feature_flags||this.Xt||(this.Xt=setTimeout((()=>{this.Jt()}),5))}Kt(){clearTimeout(this.Xt),this.Xt=void 0}ensureFlagsLoaded(){this.Ht||this.Vt||this.Xt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.jt=e}Jt(e){var t;if(this.Kt(),!this._instance.ye())if(this.Vt)this.Yt=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Jn)||{}),group_properties:this._instance.get_property(Kn)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.Ut()&&(i.evaluation_environments=this.Wt());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);n&&(i.timezone=yv()),this.Vt=!0,this._instance.Qt({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,n=!0;(200===e.statusCode&&(this.Yt||(this.$anon_distinct_id=void 0),n=!1),this.Vt=!1,this.Gt)||(this.Gt=!0,this._instance.er(null!==(r=e.json)&&void 0!==r?r:{}));if(!i.disable_flags||this.Yt)if(this.zt=!n,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Bv.FeatureFlags))Tv.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var o;if(!i.disable_flags)this.receivedFeatureFlags(null!==(o=e.json)&&void 0!==o?o:{},n);this.Yt&&(this.Yt=!1,this.Jt())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.Ht||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,n=this._instance.get_property(Ov)||void 0,o=this._instance.get_property(Pv)||void 0,s=this._instance.get_property(to)||{};if((t.send_event||!("send_event"in t))&&(!(e in s)||!s[e].includes(i))){var a,l,u,h,c,d,v,f,p;Ur(s[e])?s[e].push(i):s[e]=[i],null==(a=this._instance.persistence)||a.register({[to]:s});var g=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:o,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.zt};ei(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),ei(null==g?void 0:g.original_variant)&&ei(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ei(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return r}Tv.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Ut()&&(i.evaluation_environments=this.Wt()),this._instance.Qt({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.Ht||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ei(r)?void 0:!!r}Tv.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){this.Ht=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=Dv(e),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var h=e.requestId,c=e.evaluatedAt;if(Ur(l)){Tv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;v<l.length;v++)d[l[v]]=!0;t&&t.register({[Mv]:l,[Wn]:d})}else{var f=l,p=u,g=a;e.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),t&&t.register(r({[Mv]:Object.keys(Lv(f)),[Wn]:f||{},[Rv]:p||{},[Xn]:g||{}},h?{[Ov]:h}:{},c?{[Pv]:c}:{}))}}}(e,this._instance.persistence,i,n,o),this.tr(t)}}override(e,t){void 0===t&&(t=!1),Tv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Tv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Nv),this._instance.persistence.unregister(Fv),this.tr(),Ev.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this.qt=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Nv),Ev.info("Flag overrides cleared");else if(r.flags){if(Ur(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Nv]:i})}else this._instance.persistence.register({[Nv]:r.flags});Ev.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Fv),Ev.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Fv]:r.payloads}),Ev.info("Payload overrides set",{payloads:r.payloads}))),void this.tr()}this.tr()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ht){var{flags:t,flagVariants:r}=this.rr();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,o=(this._instance.get_property(Un)||[]).find((t=>t.flagKey===e)),s={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this._instance.persistence)||n.register({[Mv]:Object.keys(Lv(l)),[Wn]:l}),this.tr()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Un),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Un),null==(i=this._instance.persistence)||i.register({[Un]:n}),e(n)}}})}rr(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}tr(e){var{flags:t,flagVariants:r}=this.rr();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Jn)||{};this._instance.register({[Jn]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Jn)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Kn)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Kn]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Kn)||{};this._instance.register({[Kn]:r({},t,{[e]:{}})})}else this._instance.unregister(Kn)}reset(){this.Ht=!1,this.Vt=!1,this.jt=!1,this.Yt=!1,this.Gt=!1,this.zt=!1,this.$anon_distinct_id=void 0,this.Kt(),this.qt=!1}}var $v=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class qv{constructor(e,t){this.pe=e,this.props={},this.ir=!1,this.nr=(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.Ye=this.sr(e),this.load(),e.debug&&cn.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.ar}sr(e){-1===$v.indexOf(e.persistence.toLowerCase())&&(cn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Rd.De()?Rd:"localstorage+cookie"===t&&Od.De()?Od:"sessionstorage"===t&&Bd.De()?Bd:"memory"===t?Ld:"cookie"===t?Md:Od.De()?Od:Md}properties(){var e={};return pn(this.props,(function(t,r){if(r===Wn&&Kr(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else s=r,a=!1,(ii(o=co)?a:Ji&&o.indexOf===Ji?-1!=o.indexOf(s):(pn(o,(function(e){if(a||(a=e===s))return vn})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.ar){var e=this.Ye.$e(this.nr);e&&(this.props=gn({},e))}}save(){this.ar||this.Ye.qe(this.nr,this.props,this.lr,this.ur,this.hr,this.pe.debug)}remove(){this.Ye.He(this.nr,!1),this.Ye.He(this.nr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Kr(e)){ei(t)&&(t="None"),this.lr=ei(r)?this.cr:r;var i=!1;if(pn(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Kr(e)){this.lr=ei(t)?this.cr:t;var r=!1;if(pn(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.ir){var e=cv(this.pe.custom_campaign_params,this.pe.mask_personal_data_properties,this.pe.custom_personal_data_properties);Qr(_n(e))||this.register(e),this.ir=!0}}update_search_keyword(){var e;this.register((e=null==Qi?void 0:Qi.referrer)?vv(e):{})}update_referrer_info(){var e;this.register_once({$referrer:pv(),$referring_domain:null!=Qi&&Qi.referrer&&(null==(e=An(Qi.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[so]||this.register_once({[ao]:gv(this.pe.mask_personal_data_properties,this.pe.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pn([so,oo],(t=>{var r=this.props[t];r&&pn(r,(function(t,r){e["$initial_"+jr(r)]=t}))}));var t,r,i=this.props[ao];if(i){var n=(t=mv(i),r={},pn(t,(function(e,t){r["$initial_"+jr(t)]=e})),r);gn(e,n)}return e}safe_merge(e){return pn(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this.cr=this.lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.sr(e),n=this.props;this.clear(),this.Ye=i,this.props=n,this.save()}}set_disabled(e){this.ar=e,this.ar?this.remove():this.save()}set_cross_subdomain(e){e!==this.ur&&(this.ur=e,this.remove(),this.save())}set_secure(e){e!==this.hr&&(this.hr=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ln]||{};r[e]=t,this.props[Ln]=r,this.save()}remove_event_timer(e){var t=(this.props[Ln]||{})[e];return ei(t)||(delete this.props[Ln][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Hv{constructor(){this.dr={},this.dr={}}on(e,t){return this.dr[e]||(this.dr[e]=[]),this.dr[e].push(t),()=>{this.dr[e]=this.dr[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.dr[e]||[])r(t);for(var i of this.dr["*"]||[])i(e,t)}}function Vv(e,t,r){if(ni(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class jv{constructor(e){this.vr=new Hv,this.pr=(e,t)=>this.gr(e,t)&&this.mr(e,t)&&this.yr(e,t)&&this.br(e,t),this.gr=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.wr=new Set,this._r=new Set}init(){var e;if(!ei(null==(e=this._instance)?void 0:e.Cr)){var t;null==(t=this._instance)||t.Cr(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ei(null==(t=this._instance)?void 0:t.Cr)&&(e.forEach((e=>{var t,r;null==(t=this._r)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.wr)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.wr.has(e)||this.wr.has(null==t?void 0:t.event))&&this._r&&(null==(r=this._r)?void 0:r.size)>0&&this._r.forEach((e=>{this.Ir(t,e)&&this.vr.emit("actionCaptured",e.name)}))}Sr(e){this.onAction("actionCaptured",(t=>e(t)))}Ir(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.pr(e,r))return!0;return!1}onAction(e,t){return this.vr.on(e,t)}mr(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Vv(i,t.url,t.url_matching||"contains"))return!1}return!0}yr(e,t){return!!this.kr(e,t)&&(!!this.Ar(e,t)&&!!this.Tr(e,t))}kr(e,t){var r;if(null==t||!t.href)return!0;var i=this.Er(e);if(i.length>0)return i.some((e=>Vv(e.href,t.href,t.href_matching||"exact")));var n,o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!o&&Vv((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}Ar(e,t){var r;if(null==t||!t.text)return!0;var i=this.Er(e);if(i.length>0)return i.some((e=>Vv(e.text,t.text,t.text_matching||"exact")||Vv(e.$el_text,t.text,t.text_matching||"exact")));var n,o,s,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!ni(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),o=t.text,s=t.text_matching||"exact",n.some((e=>Vv(e,o,s))))}Tr(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var o=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch(e){return!1}return!1}Er(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}br(e,t){return null==t||!t.properties||0===t.properties.length||qu(t.properties.reduce(((e,t)=>{var r=Ur(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class Yv{constructor(e){this._instance=e,this.Mr=new Map,this.Nr=new Map,this.Rr=new Map}Fr(e,t){return!!e&&qu(e.propertyFilters,null==t?void 0:t.properties)}Or(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}Pr(e,t,r){var i,n=(r===_a.Activation?this.Mr:this.Nr).get(e),o=[];return null==(i=this._instance)||i.getSurveys((e=>{o=e.filter((e=>null==n?void 0:n.includes(e.id)))})),o.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Fr(o,t)}))}register(e){var t;ei(null==(t=this._instance)?void 0:t.Cr)||(this.Lr(e),this.Dr(e))}Dr(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==t.length){if(null==this.Br){this.Br=new jv(this._instance),this.Br.init();this.Br.Sr((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,i,n,o;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Br)||n.register(e.conditions.actions.values),null==(o=e.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((t=>{if(t&&t.name){var r=this.Rr.get(t.name);r&&r.push(e.id),this.Rr.set(t.name,r||[e.id])}})))}))}}Lr(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t.Cr(((e,t)=>{this.onEvent(e,t)})),this.Mr=this.Or(e,_a.Activation),this.Nr=this.Or(e,_a.Cancellation)}}onEvent(e,t){var r,i=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[eo])||[];if(Ea.SHOWN===e&&t&&i.length>0){var n;Ra.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:i});var o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var s=i.indexOf(o);s>=0&&(i.splice(s,1),this.Zr(i))}}else{if(this.Nr.has(e)){var a=this.Pr(e,t,_a.Cancellation);a.length>0&&(Ra.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:a.map((e=>e.id))}),a.forEach((e=>{var t,r=i.indexOf(e.id);r>=0&&i.splice(r,1),null==(t=this._instance)||t.cancelPendingSurvey(e.id)})),this.Zr(i))}if(this.Mr.has(e)){Ra.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Mr.get(e)});var l=this.Pr(e,t,_a.Activation);this.Zr(i.concat(l.map((e=>e.id))||[]))}}}onAction(e){var t,r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[eo])||[];this.Rr.has(e)&&this.Zr(r.concat(this.Rr.get(e)||[]))}Zr(e){var t;Ra.info("updating activated surveys",{activatedSurveys:e}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[eo]:[...new Set(e)]})}getSurveys(){var e,t=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[eo];return t||[]}getEventToSurveys(){return this.Mr}$r(){return this.Br}}class Gv{constructor(e){this.qr=void 0,this._surveyManager=null,this.Hr=!1,this.Vr=!1,this.jr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ni(t))return Ra.warn("Flags not loaded yet. Not loading surveys.");var r=Ur(t);this.qr=r?t.length>0:t,Ra.info("flags response received, isSurveysEnabled: "+this.qr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(La)||null!=r&&r.startsWith(Da))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.Vr)Ra.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ra.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ra.info("Not loading surveys in cookieless mode without consent.");else{var e=null==sn?void 0:sn.__PosthogExtensions__;if(e){if(!ei(this.qr)||this._instance.config.advanced_enable_surveys){var t=this.qr||this._instance.config.advanced_enable_surveys;this.Vr=!0;try{var r=e.generateSurveys;if(r)return void this.Yr(r,t);var i=e.loadExternalDependency;if(!i)return void this.Gr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.Gr("Could not load surveys script",r):this.Yr(e.generateSurveys,t)}))}catch(e){throw this.Gr("Error initializing surveys",e),e}finally{this.Vr=!1}}}else Ra.error("PostHog Extensions not found.")}}Yr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Yv(this._instance),Ra.info("Surveys loaded successfully"),this.zr({isLoaded:!0})}Gr(e,t){Ra.error(e,t),this.zr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.jr.push(e),this._surveyManager&&this.zr({isLoaded:!0}),()=>{this.jr=this.jr.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Ra.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(Qn);if(r&&!t)return e(r,{isLoaded:!0});if(this.Hr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Hr=!0,this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var r;this.Hr=!1;var i=t.statusCode;if(200!==i||!t.json){var n="Surveys API could not be loaded, status: "+i;return Ra.error(n),e([],{isLoaded:!1,error:n})}var o,s=t.json.surveys||[],a=s.filter((e=>Fa(e)&&(Oa(e)||Pa(e))));a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a));return null==(r=this._instance.persistence)||r.register({[Qn]:s}),e(s,{isLoaded:!0})}})}catch(e){throw this.Hr=!1,e}}zr(e){for(var t of this.jr)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Ra.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ra.warn("init was not called")}Wr(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Ur(e){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.Wr(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ni(this._surveyManager))return Ra.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.Ur(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ni(this._surveyManager)?(Ra.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var o=this.Ur(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var r;if(ni(this._surveyManager))Ra.warn("init was not called");else{var i="string"==typeof e?this.Wr(e):e;if(null!=i&&i.id)if(qa.includes(i.type)){var n=null==Qi?void 0:Qi.querySelector(t);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(Ra.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Ra.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,n),Ra.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);Ra.warn("Survey element not found")}else Ra.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ra.warn("Survey not found")}}displaySurvey(e,t){var i;if(ni(this._surveyManager))Ra.warn("init was not called");else{var n=this.Wr(e);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void Ra.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==Na.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,t.selector)}else Ra.warn("Survey not found")}}cancelPendingSurvey(e){ni(this._surveyManager)?Ra.warn("init was not called"):this._surveyManager.cancelSurvey(e)}}var zv=dn("[RateLimiter]");class Wv{constructor(e){var t,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{zv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void zv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=e.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=(new Date).getTime(),o=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(no))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:n};o.tokens+=(n-o.last)/1e3*this.captureEventsPerSecond,o.last=n,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||e||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||e||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==(i=this.instance.persistence)||i.set_property(no,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Uv=dn("[RemoteConfig]");class Xv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=sn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Xr(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Uv.error("PostHog Extensions not found. Cannot load remote config."),e())}Jr(e){this._instance.Qt({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Uv.info("Using preloaded remote config",this.remoteConfig),void this.er(this.remoteConfig);if(this._instance.ye())return void Uv.warn("Remote config is disabled. Falling back to local config.");this.Xr((e=>{if(!e)return Uv.info("No config found after loading remote JS config. Falling back to JSON."),void this.Jr((e=>{this.er(e)}));this.er(e)}))}catch(e){Uv.error("Error loading remote config",e)}}er(e){e?this._instance.config.__preview_remote_config?(this._instance.er(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Uv.info("__preview_remote_config is disabled. Logging config instead",e):Uv.error("Failed to fetch remote config from PostHog.")}}var Jv=3e3;class Kv{constructor(e,t){this.Kr=!0,this.Qr=[],this.ei=pi((null==t?void 0:t.flush_interval_ms)||Jv,250,5e3,cn.createLogger("flush interval"),Jv),this.ti=e}enqueue(e){this.Qr.push(e),this.ri||this.ii()}unload(){this.ni();var e=this.Qr.length>0?this.oi():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.ti(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Kr=!1,this.ii()}ii(){var e=this;this.Kr||(this.ri=setTimeout((()=>{if(this.ni(),this.Qr.length>0){var t=this.oi(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Ur(r.data)&&pn(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.ti(r)};for(var i in t)r()}}),this.ei))}ni(){clearTimeout(this.ri),this.ri=void 0}oi(){var e={};return pn(this.Qr,(t=>{var i,n=t,o=(n?n.batchKey:null)||n.url;ei(e[o])&&(e[o]=r({},n,{data:[]})),null==(i=e[o].data)||i.push(n.data)})),this.Qr=[],e}}var Qv=["retriesPerformedSoFar"];class ef{constructor(e){this.si=!1,this.ai=3e3,this.Qr=[],this._instance=e,this.Qr=[],this.li=!0,!ei(zi)&&"onLine"in zi.navigator&&(this.li=zi.navigator.onLine,this.ui=()=>{this.li=!0,this.Et()},this.hi=()=>{this.li=!1},xn(zi,"online",this.ui),xn(zi,"offline",this.hi))}get length(){return this.Qr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,Qv);oi(t)&&t>0&&(n.url=Fu(n.url,{retry_count:t})),this._instance.Qt(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.ci(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}ci(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this.Qr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cn.warn(n),this.si||(this.si=!0,this.di())}di(){if(this.vi&&clearTimeout(this.vi),0===this.Qr.length)return this.si=!1,void(this.vi=void 0);this.vi=setTimeout((()=>{this.li&&this.Qr.length>0&&this.Et(),this.di()}),this.ai)}Et(){var e=Date.now(),t=[],r=this.Qr.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this.Qr=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.vi&&(clearTimeout(this.vi),this.vi=void 0),this.si=!1,ei(zi)||(this.ui&&(zi.removeEventListener("online",this.ui),this.ui=void 0),this.hi&&(zi.removeEventListener("offline",this.hi),this.hi=void 0)),this.Qr))try{this._instance.Qt(r({},e,{transport:"sendBeacon"}))}catch(e){cn.error(e)}this.Qr=[]}}class tf{constructor(e){this.fi=()=>{var e,t,r,i;this.pi||(this.pi={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.pi.lastScrollY=Math.ceil(o),this.pi.maxScrollY=Math.max(o,null!==(e=this.pi.maxScrollY)&&void 0!==e?e:0),this.pi.maxScrollHeight=Math.max(s,null!==(t=this.pi.maxScrollHeight)&&void 0!==t?t:0),this.pi.lastContentY=a,this.pi.maxContentY=Math.max(a,null!==(r=this.pi.maxContentY)&&void 0!==r?r:0),this.pi.maxContentHeight=Math.max(l,null!==(i=this.pi.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this.pi}resetContext(){var e=this.pi;return setTimeout(this.fi,0),e}startMeasuringScrollPosition(){xn(zi,"scroll",this.fi,{capture:!0}),xn(zi,"scrollend",this.fi,{capture:!0}),xn(zi,"resize",this.fi)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==zi?void 0:zi.document.documentElement;var e=Ur(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==zi?void 0:zi.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return zi&&(zi.scrollY||zi.pageYOffset||zi.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return zi&&(zi.scrollX||zi.pageXOffset||zi.document.documentElement.scrollLeft)||0}}var rf=e=>gv(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class nf{constructor(e,t,r,i){this.gi=e=>{var t=this.mi();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.yi(this._instance)};this.bi.register({[io]:r})}},this._instance=e,this.wi=t,this.bi=r,this.yi=i||rf,this.wi.onSessionId(this.gi)}mi(){return this.bi.props[io]}getSetOnceProps(){var e,t=null==(e=this.mi())?void 0:e.props;return t?"r"in t?mv(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return pn(_n(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+jr(r)]=t})),e}}var of=dn("[SessionId]");class sf{on(e,t){return this.Ci.on(e,t)}constructor(e,t,r){var i;if(this.Ii=[],this.Si=void 0,this.Ci=new Hv,this.ki=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.pe=e.config,this.bi=e.persistence,this.xi=void 0,this.Ai=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ti=t||Ua,this.Ei=r||Ua;var n=this.pe.persistence_name||this.pe.token,o=this.pe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pi(o,60,36e3,of.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Mi(),this.Ni="ph_"+n+"_window_id",this.Ri="ph_"+n+"_primary_window_exists",this.Fi()){var s=Bd.$e(this.Ni),a=Bd.$e(this.Ri);s&&!a?this.xi=s:Bd.He(this.Ni),Bd.qe(this.Ri,!0)}if(null!=(i=this.pe.bootstrap)&&i.sessionID)try{var l=(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.pe.bootstrap.sessionID);this.Oi(this.pe.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){of.error("Invalid sessionID in bootstrap",e)}this.Pi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ei(this.Ii)&&(this.Ii=[]),this.Ii.push(e),this.Ai&&e(this.Ai,this.xi),()=>{this.Ii=this.Ii.filter((t=>t!==e))}}Fi(){return"memory"!==this.pe.persistence&&!this.bi.ar&&Bd.De()}Li(e){e!==this.xi&&(this.xi=e,this.Fi()&&Bd.qe(this.Ni,e))}Di(){return this.xi?this.xi:this.Fi()?Bd.$e(this.Ni):null}Oi(e,t,r){e===this.Ai&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Ai=e,this.bi.register({[Gn]:[t,e,r]}))}Bi(){var e=this.bi.props[Gn];return Ur(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Oi(null,null,null)}destroy(){clearTimeout(this.Zi),this.Zi=void 0,this.Si&&zi&&(zi.removeEventListener("beforeunload",this.Si,{capture:!1}),this.Si=void 0),this.Ii=[]}Pi(){this.Si=()=>{this.Fi()&&Bd.He(this.Ri)},xn(zi,"beforeunload",this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.pe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,o]=this.Bi(),s=this.Di(),a=oi(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,h=!u&&!e&&this.ki(r,i);u||h||a?(n=this.Ti(),s=this.Ei(),of.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.Ei(),l=!0);var c=0===i||!e||a?r:i,d=0===o?(new Date).getTime():o;return this.Li(s),this.Oi(n,c,d),e||this.Mi(),l&&this.Ii.forEach((e=>e(n,s,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}Mi(){clearTimeout(this.Zi),this.Zi=setTimeout((()=>{var[e]=this.Bi();if(this.ki((new Date).getTime(),e)){var t=this.Ai;this.resetSessionId(),this.Ci.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var af=["$set_once","$set"],lf=dn("[SiteApps]");class uf{constructor(e){this._instance=e,this.$i=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qi(e,t){if(t){var r=this.globalsForEvent(t);this.$i.push(r),this.$i.length>1e3&&(this.$i=this.$i.slice(10))}}get siteAppLoaders(){var e;return null==(e=sn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Cr(this.qi.bind(this));this.Hi=()=>{e(),this.$i=[],this.Hi=void 0}}}globalsForEvent(e){var t,n,o,s,a,l,u;if(!e)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,af),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this.$i.length&&(lf.info("Processing "+this.$i.length+" events for site app with id "+e.id),this.$i.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this.Hi)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,lf.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:e=>{n(e)}});o&&(t.processEvent=o),i=!0}catch(t){lf.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){lf.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Vi(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ji(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){lf.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Vi(),void this._instance.on("eventCaptured",(e=>this.ji(e)))):void lf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Hi)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var o=function(e){var t;sn["__$$ph_site_app_"+e]=n._instance,null==(t=sn.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return lf.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:s,url:a}of e.siteApps)o(s)}else lf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var hf=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&$r(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>$r(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},cf=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),df="i.posthog.com";class vf{constructor(e){this.Yi={},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 flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+df,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Yi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Yi[this.apiHost]=cf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Yi[this.apiHost]=cf.EU:this.Yi[this.apiHost]=cf.CUSTOM),this.Yi[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===cf.CUSTOM)return this.apiHost+t;var r=df+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var ff={icontains:(e,t)=>!!zi&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!zi&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!zi&&Du(t.href,e),not_regex:(e,t)=>!!zi&&!Du(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class pf{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{pf.Gi("retrieved web experiments from the server"),t.zi=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t.zi)pf.Gi("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zi)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ti(i)&&e.variants[i]&&t.Wi(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var o=e.variants[n];pf.Ui(o)&&t.Wi(e.name,n,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())pf.Gi("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.zi))return this.zi=new Map,this.loadIfEnabled(),void this.previewWebExperiment();pf.Gi("applying feature flags",e),e.forEach((e=>{var t;if(this.zi&&null!=(t=this.zi)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zi)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Wi(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=pf.getWindowLocation();if(null!=e&&e.search){var t=En(null==e?void 0:e.search,"__experiment_id"),r=En(null==e?void 0:e.search,"__experiment_variant");t&&r&&(pf.Gi("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Xi(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}Xi(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(pf.Gi("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Wi(i[0].name,t,i[0].variants[t].transforms))}static Ui(e){return!ni(e.conditions)&&(pf.Ji(e)&&pf.Ki(e))}static Ji(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,o=pf.getWindowLocation();return!!o&&(null==(r=e.conditions)||!r.url||ff[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==zi?void 0:zi.location}static Ki(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.utm))return!0;var r=cv();if(r.utm_source){var i,n,o,s,a,l,u,h,c=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Gi(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];cn.info("[WebExperiments] "+e,r)}Wi(e,t,r){this._is_bot()?pf.Gi("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;pf.Gi("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):pf.Gi("Control variants leave the page unmodified.")}_is_bot(){return Ki&&this._instance?hf(Ki,this._instance.config.custom_blocked_useragents):void 0}}var gf=dn("[PostHog ExternalIntegrations]"),mf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class yf{constructor(e){this._instance=e}Ue(e,t){var r;null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return gf.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,o;(!i||null!=(r=sn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.Ue(mf[t],(()=>{var r;null==(r=sn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=sn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(o=sn.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[t])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var bf="[SessionRecording]",wf=dn(bf);class _f{get started(){var e;return!(null==(e=this.Qi)||!e.isStarted)}get status(){return this.Qi?this.Qi.status:this.en&&!this.tn?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.en=!1,this.rn=void 0,this._instance=e,!this._instance.sessionManager)throw wf.error("started without valid sessionManager"),new Error(bf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(bf+' cannot be used with cookieless_mode="always"')}get tn(){var e,t=!(null==(e=this._instance.get_property(Yn))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return zi&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.tn||null==(t=this.Qi)||!t.isStarted){var r=!ei(Object.assign)&&!ei(Array.from);this.tn&&r?(this.nn(e),wf.info("starting")):this.stopRecording()}}nn(e){var t,r,i;this.tn&&(null!=sn&&null!=(t=sn.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=sn.__PosthogExtensions__)&&r.initSessionRecording?this.sn(e):null==(i=sn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.an,(t=>{if(t)return wf.error("could not load recorder",t);this.sn(e)})))}stopRecording(){var e,t;null==(e=this.rn)||e.call(this),this.rn=void 0,null==(t=this.Qi)||t.stop()}ln(){var e;null==(e=this._instance.persistence)||e.unregister(zn)}un(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,o=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.ln();var s=null==t?void 0:t.minimumDurationMilliseconds;n.register({[Yn]:r({enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ei(s)?null:s,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};o(),null==(t=this.rn)||t.call(this),this.rn=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.un(e),this.en=!0,this.startIfEnabledOrStop()):this.en=!0:wf.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.Qi)&&r.log?this.Qi.log(e,t):wf.warn("log called before recorder was ready")}get an(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Yn);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}sn(e){var t,r;if(null==(t=sn.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Qi||(this.Qi=null==(r=sn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Qi._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Qi.start(e)}onRRwebEmit(e){var t;null==(t=this.Qi)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Qi||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this.Qi)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Qi||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this.Qi)||e.overrideSampling()}overrideTrigger(e){var t,r;this.Qi||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this.Qi)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Qi)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.Qi)||!r.tryAddCustomEvent(e,t))}}var Cf={},If=()=>{},Sf="posthog",kf=!Nu&&-1===(null==on?void 0:on.indexOf("MSIE"))&&-1===(null==on?void 0:on.indexOf("Mozilla")),xf=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Sn(null==Qi?void 0:Qi.location),persistence:"localStorage+cookie",persistence_name:"",loaded:If,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:en&&ti(null==en?void 0:en.search)&&-1!==en.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==zi||null==(t=zi.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;cn.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Jv},error_tracking:{},_onCapture:If,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},Af=e=>{var t={};ei(e.process_person)||(t.person_profiles=e.process_person),ei(e.xhr_headers)||(t.request_headers=e.xhr_headers),ei(e.cookie_name)||(t.persistence_name=e.cookie_name),ei(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ei(e.store_google)||(t.save_campaign_params=e.store_google),ei(e.verbose)||(t.debug=e.verbose);var r=gn({},t,e);return Ur(e.property_blacklist)&&(ei(e.property_denylist)?r.property_denylist=e.property_blacklist:Ur(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:cn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Tf{constructor(){this.__forceAllowLocalhost=!1}get hn(){return this.__forceAllowLocalhost}set hn(e){cn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ef{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new Tf,this.cn=!1,this.version=un.LIB_VERSION,this.dn=new Hv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xf(),this.SentryIntegration=Kd,this.sentryIntegration=e=>function(e,t){var r=Jd(e,t);return{name:Xd,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.vn=!1,this.fn=null,this.pn=null,this.gn=null,this.featureFlags=new Zv(this),this.toolbar=new iv(this),this.scrollManager=new tf(this),this.pageViewManager=new Av(this),this.surveys=new Gv(this),this.experiments=new pf(this),this.exceptions=new lc(this),this.rateLimiter=new Wv(this),this.requestRouter=new vf(this),this.consent=new $d(this),this.externalIntegrations=new yf(this),this.people={set:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>cn.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Sf){var i,n=null!==(i=Cf[r])&&void 0!==i?i:new Ef;return n._init(e,t,r),Cf[r]=n,Cf[Sf][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ei(e)||ri(e))return cn.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.mn(t.debug),this.yn=t,this.bn=[],t.person_profiles&&(this.pn=t.person_profiles),this.set_config(gn({},xf(t.defaults),Af(t),{name:i,token:e})),this.config.on_xhr_error&&cn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ul.GZipJS;var o=this.wn();this.persistence=new qv(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new qv(r({},this.config,{persistence:"sessionStorage"}),o);var s=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._n=new Kv((e=>this.Cn(e)),this.config.request_queue_config),this.In=new ef(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new sf(this),this.sessionPropsManager=new nf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Sn(l)}),0)):(cn.info("Initializing extensions synchronously"),this.Sn(l)),un.DEBUG=un.DEBUG||this.config.debug,un.DEBUG&&cn.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(Ua()),d=null!=(u=t.bootstrap)&&u.isIdentifiedID?c:t.bootstrap.distinctID;this.persistence.set_property(ro,null!=(h=t.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.kn()){var v,f,p=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),g=Object.keys((null==(f=t.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((e=>p[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ho,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Ua());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ro,"anonymous")}return xn(zi,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Ud(this,(()=>this.xn())):this.xn(),Xr(this.config._onCapture)&&this.config._onCapture!==If&&(cn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&cn.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Sn(e){var t=performance.now();this.historyAutocapture=new zd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new ov(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new uf(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new _f(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new wd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new xv(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Iv(this)})),r.push((()=>{this.exceptionObserver=new Gd(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new jd(this,Vd),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.An){var e=this.An;this.An=void 0,this.er(e)}})),this.Tn(r,t)}Tn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Tn(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){cn.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&cn.info("PostHog extensions initialized ("+i+"ms)")}er(e){var t,r,i,n,o,s,a,l;if(!Qi||!Qi.body)return cn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.er(e)}),500);this.config.__preview_deferred_init_extensions&&(this.An=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Hr(e.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hr(e.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.pn?this.pn:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}xn(){try{this.config.loaded(this)}catch(e){cn.critical("`loaded` function failed",e)}this.En(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Mn()}),1),new Xv(this).load(),this.featureFlags.flags()}En(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._n)||e.enable()))}_dom_loaded(){this.is_capturing()&&fn(this.__request_queue,(e=>this.Cn(e))),this.__request_queue=[],this.En()}_handle_unload(){var e,t;this.config.request_batching?(this.Nn()&&this.capture("$pageleave"),null==(e=this._n)||e.unload(),null==(t=this.In)||t.unload()):this.Nn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Qt(e){this.__loaded&&(kf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Fu(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,o=r({},e);o.timeout=o.timeout||6e4,o.url=Fu(o.url,{_:(new Date).getTime().toString(),ver:un.LIB_VERSION,compression:o.compression});var s=null!==(t=o.transport)&&void 0!==t?t:"fetch",a=Lu.filter((e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport))),l=null!==(i=null==(n=kn(a,(e=>e.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(o)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}Cn(e){this.In?this.In.retriableRequest(e):this.Qt(e)}_execute_array(e){var t,r=[],i=[],n=[];fn(e,(e=>{e&&(t=e[0],Ur(t)?n.push(e):Xr(e)?e.call(this):Ur(e)&&"alias"===t?r.push(e):Ur(e)&&-1!==t.indexOf("capture")&&Xr(this[t])?n.push(e):i.push(e))}));var o=function(e,t){fn(e,(function(e){if(Ur(e[0])){var r=t;pn(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(r,this),o(i,this),o(n,this)}kn(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._n){if(this.is_capturing())if(!ei(e)&&ti(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=t&&t.$current_url&&!ti(null==t?void 0:t.$current_url)&&(cn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(null==i?void 0:i.timestamp)||a,u=Ua(),h={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c=this.Rn(null==i?void 0:i.$set_once);if(c&&(h.$set_once=c),(h=Cn(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ei(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),e===Ea.DISMISSED||e===Ea.SENT){var d=null==t?void 0:t[Ma.SURVEY_ID],v=null==t?void 0:t[Ma.SURVEY_ITERATION];$a({id:d,current_iteration:v}),h.$set=r({},h.$set,{[Ba({id:d,current_iteration:v},e===Ea.SENT?"responded":"dismissed")]:!0})}var f=r({},h.properties.$set,h.$set);if(Qr(f)||this.setPersonPropertiesForFlags(f),!ni(this.config.before_send)){var p=this.Fn(h);if(!p)return;h=p}this.dn.emit("eventCaptured",h);var g={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Cn(g):this._n.enqueue(g),h}cn.critical("This capture call is ignored due to client rate limiting.")}}else cn.error("No event name provided to posthog.capture")}else cn.uninitializedWarning("posthog.capture")}Cr(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var s=o?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ti(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&cn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=wv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&gn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.In)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===cf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||o?"$pageleave"!==e||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gn(a,u),"$pageview"===e&&Qi&&(a.title=Qi.title),!ei(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}on&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=gn({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ur(this.config.property_denylist)?pn(this.config.property_denylist,(function(e){delete a[e]})):cn.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&&(cn.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,e));var g=this.On();return a.$process_person_profile=g,g&&!o&&this.Pn("_calculate_event_properties"),a}Rn(e){var t;if(!this.persistence||!this.On())return e;if(this.cn)return e;var r=this.persistence.get_initial_props(),i=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),n=gn({},r,i||{},e||{}),o=this.config.sanitize_properties;return o&&(cn.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),this.cn=!0,Qr(n)?void 0:n}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ln(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,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.dn.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Ha),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return cn.uninitializedWarning("posthog.identify");if(oi(e)&&(e=e.toString(),cn.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()))cn.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.');else if(e!==ho){if(this.Pn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Pn)&&(this.unregister(Pn),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(ro)||"anonymous");e!==n&&s?(this.persistence.set_property(ro,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.gn=Bu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(to))}}else cn.critical('The string "'+ho+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else cn.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Pn("posthog.setPersonProperties")){var i=Bu(this.get_distinct_id(),e,t);this.gn!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.gn=i):cn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Pn("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}}else cn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Pn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(cn.info("reset"),!this.__loaded)return cn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(ro,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.gn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ho,$device_id:null},"");else{var s=this.config.get_device_id(Ua());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}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.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,o=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(e,t){return e===this.get_property(On)?(cn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Pn("posthog.alias")?(ei(t)&&(t=this.get_distinct_id()),e!==t?(this.Ln(Pn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(cn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Kr(e)){var i,n,o,s,a;gn(this.config,Af(e));var l=this.wn();null==(i=this.persistence)||i.update_config(this.config,t,l),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new qv(r({},this.config,{persistence:"sessionStorage"}),l);var u=this.mn(this.config.debug);si(u)&&(this.config.debug=u),si(this.config.debug)&&(this.config.debug?(un.DEBUG=!0,Rd.De()&&Rd.qe("ph_debug","true"),cn.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(un.DEBUG=!1,Rd.De()&&Rd.He("ph_debug"))),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(s=this.heatmaps)||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Dn(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={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(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||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)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Sf;return t!==Sf&&(t=Sf+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(ro))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(ro))}On(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Pn])&&(null==(t=this.persistence)||null==(t=t.props)||!t[lo]))}Nn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.On()||this.Pn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Pn(e){return"never"===this.config.person_profiles?(cn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ln(lo,!0),!0)}wn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Dn(){var e,t,r,i,n=this.wn();(null==(e=this.persistence)?void 0:e.ar)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t.ar)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){if("always"!==this.config.cookieless_mode){var t,r;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=new sf(this),this.persistence&&(this.sessionPropsManager=new nf(this,this.sessionManager,this.persistence)),this.sessionRecording=new _f(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Dn(),this.En(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ei(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(r=null==e?void 0:e.captureEventName)&&void 0!==r?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Mn()}else cn.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Dn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ho,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.Mn())):cn.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Zd.GRANTED?"granted":e===Zd.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Dn()}_is_bot(){return Ki?hf(Ki,this.config.custom_blocked_useragents):void 0}Mn(){Qi&&("visible"===Qi.visibilityState?this.vn||(this.vn=!0,this.capture("$pageview",{title:Qi.title},{send_instantly:!0}),this.fn&&(Qi.removeEventListener("visibilitychange",this.fn),this.fn=null)):this.fn||(this.fn=this.Mn.bind(this),xn(Qi,"visibilitychange",this.fn)))}debug(e){!1===e?(null==zi||zi.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==zi||zi.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)`."),this.set_config({debug:!0}))}ye(){var e,t,r,i,n,o,s,a=this.yn||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cn.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=cn,o=(t="advanced_disable_flags")in(e=a)&&!ei(e[t]),s=r in e&&!ei(e[r]),o?e[t]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}Fn(e){if(ni(this.config.before_send))return e;var t=Ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),ni(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return li(e.event)?cn.warn(n+". This can cause unexpected behavior."):cn.info(n),null}r.properties&&!Qr(r.properties)||cn.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager.$t)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}mn(e){var t=si(e)&&!e,r=Rd.De()&&"true"===Rd.Ze("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=wn(e.prototype[t[r]])}(Ef,["identify"]);var Mf,Nf;Mf=Cf[Sf]=new Ef,(Nf=sn.posthog)&&pn(Nf._i,(function(e){if(e&&Ur(e)){var t=Mf.init(e[0],e[1],e[2]),r=Nf[e[2]]||Nf;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),sn.posthog=Mf,function(){function e(){e.done||(e.done=!0,kf=!1,pn(Cf,(function(e){e._dom_loaded()})))}null!=Qi&&Qi.addEventListener?"complete"===Qi.readyState?e():xn(Qi,"DOMContentLoaded",e,{capture:!1}):zi&&cn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
1
|
+
!function(){"use strict";function e(e,t,r,i,n,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=t.apply(r,i);function a(t){e(s,n,o,a,l,"next",t)}function l(t){e(s,n,o,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),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||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(e){if(v[e])return v[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in c?c[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return v[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 u=l[e].prototype;return document.body.removeChild(a),u?v[e]=u:t.prototype}catch(e){return t.prototype}}var p={};function g(e,t,r){var i,n=e+"."+String(r);if(p[n])return p[n].call(t);var o=f(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(t)):t[r]}var m={};function y(e,t,r){var i=e+"."+String(r);if(m[i])return m[i].bind(t);var n=f(e)[r];return"function"!=typeof n?t[r]:(m[i]=n,n.bind(t))}var b={childNodes:function(e){return g("Node",e,"childNodes")},parentNode:function(e){return g("Node",e,"parentNode")},parentElement:function(e){return g("Node",e,"parentElement")},textContent:function(e){return g("Node",e,"textContent")},contains:function(e,t){return y("Node",e,"contains")(t)},getRootNode:function(e){return y("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?g("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null},querySelector:function(e,t){return g("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return g("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(e){return e.nodeType===e.ELEMENT_NODE}function _(e){var t=e&&"host"in e&&"mode"in e&&b.host(e)||null;return Boolean(t&&"shadowRoot"in t&&b.shadowRoot(t)===e)}function C(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>S(t,e.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?L(n,t):n}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=e,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var E="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function N(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(R,((e,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return e;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),c=l.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+u+h.join("/")+u+")"}))}var D,B,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function z(e,t){return t&&""!==t.trim()?U(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(e,t){var r=G.get(e);if(r||(r=e.createElement("a"),G.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?z(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=t.length);){var o=i(j);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),n.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?L(i,U(e)):"object"===t&&"data"===r?z(e,i):i:z(e,i):i}function J(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(b.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&K(b.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(w(e)){if(n=e,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(e))return!1;n=b.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(K(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,i);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 r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),y={},w=e.attributes.length,_=0;_<w;_++){var C=e.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(e){return null==e?void 0:e.href}(e);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&e.sheet&&!(e.innerText||b.textContent(e)||"").trim().length){var R=I(e.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:e,type:M(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(e.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&e.open)try{y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var P=e.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var Z=e,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(g){var{width:G,height:z}=e.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(e)||void 0,needBlock:g,rootId:p,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:o}=t,s=b.parentNode(e),a=s&&s.tagName,l=b.textContent(e),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=I(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=L(l,U(t.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:o}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(e)||"",rootId:m};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:E}=t,{preserveWhiteSpace:M=!0}=t;E||(E=Q(e,s,a,void 0===E));var R,F=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(e,"not serialized"),null;R=i.hasNode(e)?i.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"===N(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(F,f)&&(M||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(i.add(e,O),R===H)return null;y&&y(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(e);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(M=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(e))){var Z=re(B,D);Z&&O.childNodes.push(Z)}var q=null;if(w(e)&&(q=b.shadowRoot(e)))for(var j of Array.from(b.childNodes(q))){var Y=re(j,D);Y&&(C(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(e);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var 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)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(e,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var o=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),n=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});t&&k(e,t)}}),x),O}let ie=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 ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},oe={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var se={};function ae(e){if(se[e])return se[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in oe?oe[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return se[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 u=l[e].prototype;return document.body.removeChild(a),u?se[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var o=ae(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(le[n]=s,s.call(t)):t[r]}var he={};function ce(e,t,r){var i=e+"."+String(r);if(he[i])return he[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(he[i]=n,n.bind(t))}function de(){return ae("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return ce("Node",e,"contains")(t)},getRootNode:function(e){return ce("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:de};function fe(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var pe="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.",ge={map:{},getId:()=>(console.error(pe),-1),getNode:()=>(console.error(pe),null),removeNodeFromMap(){console.error(pe)},has:()=>(console.error(pe),!1),reset(){console.error(pe)}};function me(e,t,r){void 0===r&&(r={});var i=null,n=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();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,s)}),u))}}function ye(e,t,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ge=new Proxy(ge,{get:(e,t,r)=>("map"===t&&console.error(pe),Reflect.get(e,t,r))}));var we=Date.now;function _e(e){var t,r,i,n,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=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.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=ve.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function ke(e,t,r,i){if(!e)return!1;var n=Se(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(K(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===H}function Ae(e,t){if(_(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=ve.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Ae(i,t))}function Te(e){return Boolean(e.changedTouches)}function Ee(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Re=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(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):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Fe(e){var t,r=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(r=ve.host(ve.getRootNode(e))),r}function Oe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Fe(r);)r=t;return r}(e);return ve.contains(t,r)}function Pe(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Oe(e))}var Le=(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))(Le||{}),De=(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))(De||{}),Be=(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))(Be||{}),Ze=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ze||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),qe=(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))(qe||{});function He(e){return"__ln"in e}class Ve{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)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&&He(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&He(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.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 je,Ye=(e,t)=>e+"@"+t;class Ge{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ve,i=e=>{for(var t=e,r=H;r===H;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var o=ve.parentNode(n);if(o&&Pe(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Fe(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=re(n,{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=>{Ee(e,this.mirror)&&this.iframeManager.addIframe(e),Me(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(n)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(n),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)We(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||n(o);for(var s of this.addedSet)Ue(this.droppedSet,s)||We(this.removes,s,this.mirror)?Ue(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(ve.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(ve.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=ve.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=ve.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=ve.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{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 r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+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};(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))}})),a(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(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var o=M(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){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(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===h?u:[u,h]:s._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(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 r=this.mirror.getId(t),i=_(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ae(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ye(r,i)]?ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!_(e.target)||!C(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ye(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.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 ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function We(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=ve.parentNode(t),o=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ve.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(e,t,r)}function Ue(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=ve.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Je=e=>{if(!je)return e;return function(){try{return e(...arguments)}catch(e){if(je&&!0===je(e))return;throw e}}},Ke=[];function Qe(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 et(e,t){var r=new Ge;Ke.push(r),r.init(e);var i=new(de())(Je(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Be).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!ke(a,o,s,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Ze.Mouse;break;case"touch":l=Ze.Touch;break;case"pen":l=Ze.Pen}l===Ze.Touch?Be[e]===Be.MouseDown?u="TouchStart":Be[e]===Be.MouseUp&&(u="TouchEnd"):Ze.Pen}else Te(i)&&(l=Ze.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Ze.Touch||u.startsWith("Mouse")&&l===Ze.Mouse)&&(l=null)):Be[e]===Be.Click&&(l=h,h=null);var c=Te(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Je(t)(r({type:Be[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Be[e]){case Be.MouseDown:case Be.MouseUp:a=a.replace("mouse","pointer");break;case Be.TouchStart:case Be.TouchEnd:return}u.push(fe(a,l,i))})),Je((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=e;return fe("scroll",Je(me(Je((e=>{var s=Qe(e);if(s&&!ke(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=_e(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function ot(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function st(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Je((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...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),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=me(Je((e=>{var r=Date.now()-o;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],o=null})),a),h=Je(me(Je((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:r,y:i,id:n.getId(t),timeOffset:we()-o}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),s,{trailing:!1})),c=[fe("mousemove",h,i),fe("touchmove",h,i),fe("drag",h,i)];return Je((()=>{c.forEach((e=>e()))}))}(e),s=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,o=-1;return fe("resize",Je(me(Je((()=>{var e=Ce(),t=Ie();n===e&&o===t||(r({width:Number(t),height:Number(e)}),n=e,o=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=e;function v(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=ve.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!ke(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var c=t.value,v=!1,p=M(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:t,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(t,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var o=nt.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){nt.set(e,i);var s=n.getId(e);Je(t)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((e=>fe(e,Je(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((e=>ye(e[0],e[1],{set(){Je(v)({target:this,isTrusted:!1})}},!1,g)))),Je((()=>{p.forEach((e=>e()))}))}(e),h=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=e,a=Je((e=>me(Je((o=>{var s=Qe(o);if(s&&!ke(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=s;t({type:e,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),o.media||500))),l=[fe("play",a(qe.Play),s),fe("pause",a(qe.Pause),s),fe("seeked",a(qe.Seeked),s),fe("volumechange",a(qe.VolumeChange),s),fe("ratechange",a(qe.RateChange),s)];return Je((()=>{l.forEach((e=>e()))}))}(e),c=()=>{},d=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(c=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=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:Je(((e,t,o)=>{var[s,a]=o,{id:l,styleId:u}=st(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({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:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({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:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var h={};ht("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(ht("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),ht("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),ht("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((e=>{var[t,o]=e;c[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[t].insertRule,{apply:Je(((e,t,o)=>{var[s,a]=o,{id:l,styleId:u}=st(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...ot(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(c[t].deleteRule,{apply:Je(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=st(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...ot(t),s]}]}),e.apply(t,o)}))})})),Je((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=u,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=c[t].insertRule,r.prototype.deleteRule=c[t].deleteRule}))}))}(e,{win:n}),d=at(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Je(((e,t,s)=>{var l,[u,h,c]=s;if(n.has(u))return a.apply(t,[u,h,c]);var{id:d,styleId:v}=st(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:h,priority:c},index:ot(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Je(((e,t,s)=>{var a,[u]=s;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:c}=st(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:ot(t.parentRule)}),e.apply(t,s)}))}),Je((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,r){var i=new s(e,t,r);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=be(r.fonts,"add",(function(e){return function(r){return setTimeout(Je((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Je((()=>{n.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=e,s=!0,a=Je((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;u<l;u++){var h=e.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;ke(c,i,n,!0)||ke(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),fe("selectionchange",a)}(e),g=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?be(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),m=[];for(var y of e.plugins)m.push(y.observer(y.callback,n,y.options));return Je((()=>{Ke.forEach((e=>e.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((e=>e()))}))}function ut(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 ct{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),s=n.get(t);return s||(s=this.generateIdFn(),n.set(t,s),o.set(s,t)),s}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var n=i.get(t);return n||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){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 dt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ct(V)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.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){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Le.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Le.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Le.Meta:case Le.Load:case Le.DomContentLoaded:return!1;case Le.Plugin:return t;case Le.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Le.IncrementalSnapshot:switch(t.data.source){case De.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(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(C(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(r({},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(ve.host(e))),this.restoreHandlers.push(at({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 r=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),o=ve.shadowRoot(this);return o&&Pe(this)&&r.addShadowRoot(o,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),gt=0;gt<64;gt++)pt[ft.charCodeAt(gt)]=gt;var mt=new Map;var yt=(e,t,r)=>{if(e&&(_t(e,t)||"object"==typeof e)){var i=function(e,t){var r=mt.get(e);return r||(r=new Map,mt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function bt(e,t,r){if(e instanceof Array)return e.map((e=>bt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=ft[r[t]>>2],n+=ft[(3&r[t])<<4|r[t+1]>>4],n+=ft[(15&r[t+1])<<2|r[t+2]>>6],n+=ft[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]}:_t(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var wt=(e,t,r)=>e.map((e=>bt(e,t,r))),_t=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,i){var n=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!ke(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function It(e,t,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var h=e.apply(this,l);if(yt(h,o,this),"tagName"in this.canvas&&!ke(this.canvas,i,n,!0)){var c=wt(l,o,this),d={type:t,property:a,args:c};r(this.canvas,d)}return h}}));s.push(l)}catch(i){var u=ye(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var St,kt,xt,At,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Et="undefined"!=typeof window&&window.Blob&&new Blob([(St=Tt,Uint8Array.from(atob(St),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Mt(e){var t;try{if(!(t=Et&&(window.URL||window.webkitURL).createObjectURL(Et)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(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:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{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,r,i,n,o){var s=this,a=Ct(r,i,n,!0),l=new Map,u=new Mt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/e,d=0,v=e=>{var a,f;d&&e-d<c?h=requestAnimationFrame(v):(d=e,(a=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),a).forEach(function(){var e=t((function*(e){var t,r=s.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,h=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(t){return e.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ct(e,t,r,!1),n=function(e,t,r,i){var n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=be(t.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return ke(this.canvas,r,i,!0)||setTimeout((()=>{var r=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,i){var n=[];return n.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,o))),{type:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Rt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Re),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 r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],o=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),i.styleIds.push(t)};for(var s of e)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ft{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).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 Ot=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Pt=document.createElement("iframe");document.body.appendChild(Pt),Array.from=(null==(n=Pt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pt)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt,Dt,Bt=new x;function Zt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=e;je=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Bt.reset();var L,D=!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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=e=>{for(var t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};kt=(e,r)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Ke[0])?void 0:o.isFrozen())||s.type===Le.FullSnapshot||s.type===Le.IncrementalSnapshot&&s.data.source===De.Mutation||Ke.forEach((e=>e.unfreeze())),O)null==t||t(q(s),r);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Le.FullSnapshot)L=s,Z=0;else if(s.type===Le.IncrementalSnapshot){if(s.data.source===De.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xt(!0)}};var H=e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.Mutation},e)})},V=e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Scroll},e)}),j=e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),Y=new Rt({mutationCb:H,adoptedStyleSheetCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),G=new dt({mirror:Bt,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:kt});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Bt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Ft;At=new Nt({recordCanvas:I,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Bt,sampling:b.canvas,dataURLOptions:w});var U=new vt({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:At,keepIframeSrcFn:N,processedNodeManager:W},mirror:Bt});xt=function(e){if(void 0===e&&(e=!1),C){kt({type:Le.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Y.reset(),U.init(),Ke.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!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}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Bt,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:e=>{Ee(e,Bt)&&G.addIframe(e),Me(e,Bt)&&Y.trackLinkElement(e),Ne(e)&&U.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:N});if(!t)return console.warn("Failed to snapshot the document");kt({type:Le.FullSnapshot,data:{node:t,initialOffset:_e(window)}},e),Ke.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Bt.getId(document))}};try{var X=[],J=e=>{var t;return Je(lt)({mutationCb:H,mousemoveCb:(e,t)=>kt({type:Le.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:j,fontCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:e,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Bt,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:At,ignoreCSSAttributes:R,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:Le.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{X.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var K=()=>{xt(),X.push(J(document)),Ot=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(fe("DOMContentLoaded",(()=>{kt({type:Le.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(fe("load",(()=>{kt({type:Le.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((e=>e())),W.destroy(),Ot=!1,je=void 0}}catch(e){console.warn(e)}}Zt.addCustomEvent=(e,t)=>{if(!Ot)throw new Error("please add custom event after start recording");kt({type:Le.Custom,data:{tag:e,payload:t}})},Zt.freezePage=()=>{Ke.forEach((e=>e.freeze()))},Zt.takeFullSnapshot=e=>{if(!Ot)throw new Error("please take full snapshot after start recording");xt(e)},Zt.mirror=Bt,(Dt=Lt||(Lt={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var $t,qt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Wt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ut={};function Xt(e){if(Ut[e])return Ut[e];var t=globalThis[e],r=t.prototype,i=e in zt?zt[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Wt?Wt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return Ut[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 u=l[e].prototype;return document.body.removeChild(a),u?Ut[e]=u:r}catch(e){return r}}var Jt={};function Kt(e,t,r){var i,n=e+"."+String(r);if(Jt[n])return Jt[n].call(t);var o=Xt(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Jt[n]=s,s.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Kt("Node",e,"childNodes")},parentNode:function(e){return Kt("Node",e,"parentNode")},parentElement:function(e){return Kt("Node",e,"parentElement")},textContent:function(e){return Kt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Kt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Kt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Kt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Kt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){Gt(this,"idNodeMap",new Map),Gt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{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 nr))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 or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in or?or[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in sr?sr[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&s)return ar[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 u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function hr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var o=lr(e),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(t)):t[r]}var cr={};function dr(e,t,r){var i=e+"."+String(r);if(cr[i])return cr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(cr[i]=n,n.bind(t))}var vr={childNodes:function(e){return hr("Node",e,"childNodes")},parentNode:function(e){return hr("Node",e,"parentNode")},parentElement:function(e){return hr("Node",e,"parentElement")},textContent:function(e){return hr("Node",e,"textContent")},contains:function(e,t){return dr("Node",e,"contains")(t)},getRootNode:function(e){return dr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(e,t,r)=>("map"===t&&console.error(fr),Reflect.get(e,t,r))}));var gr=Date.now;function mr(e){return e?e.nodeType===e.ELEMENT_NODE?e:vr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=vr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(e))&&(r=vr.host(vr.getRootNode(e))),r}function br(e){for(var t,r=e;t=yr(r);)r=t;return r}function wr(e){var t=e.ownerDocument;if(!t)return!1;var r=br(e);return vr.contains(t,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){jt(this,"id",1),jt(this,"styleIDMap",new WeakMap),jt(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):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function e(t,r){var i,n,o=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,r),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,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,i,n,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=vr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.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=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(vr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(vr.contains(t,e)||wr(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,o=r.getId(t);if(!r.has(o))return!0;var s=vr.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=mr(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ir(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.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,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return gr},on:function(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:o,parentId:s}=n;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,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(s in t){var h=t[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(e,t,r){void 0===r&&(r={});var i=null,n=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();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,s)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"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 xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($t=xr.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(e){Ht(this,"fileName"),Ht(this,"functionName"),Ht(this,"lineNumber"),Ht(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?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Nr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Er)?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: "+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(Er)}),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,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Mr)}),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 Ar({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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,r=e.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=t.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=t.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Rr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Fr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Or(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Fr(e[i])&&Or(e[i],t-1))return!0;return!1}function Pr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.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(Fr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Fr(e)&&Or(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.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]=Rr(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 Lr={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 Dr(e,t,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=t.error,o=Nr.parse(i).map((e=>e.toString())),s=[Pr(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(t.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?_r.patch(t,r,(t=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((e=>Pr(e,n.stringifyOptions)));++s<n.lengthThreshold?e({level:r,trace:h,payload:c}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Br=e=>({name:"rrweb/console@1",observer:Dr,options:e}),Zr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],$r=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Zr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},qr=["$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 Hr(e,t){return-1!==e.indexOf(t)}var Vr=function(e){return e.trim()},jr=function(e){return e.replace(/^\$/,"")};var Yr=Array.isArray,Gr=Object.prototype,zr=Gr.hasOwnProperty,Wr=Gr.toString,Ur=Yr||function(e){return"[object Array]"===Wr.call(e)},Xr=e=>"function"==typeof e,Jr=e=>Xr(e)&&-1!==e.toString().indexOf("[native code]"),Kr=e=>e===Object(e)&&!Ur(e),Qr=e=>{if(Kr(e)){for(var t in e)if(zr.call(e,t))return!1;return!0}return!1},ei=e=>void 0===e,ti=e=>"[object String]"==Wr.call(e),ri=e=>ti(e)&&0===e.trim().length,ii=e=>null===e,ni=e=>ei(e)||ii(e),oi=e=>"[object Number]"==Wr.call(e),si=e=>"[object Boolean]"===Wr.call(e),ai=e=>e instanceof FormData,li=e=>Hr(qr,e);function ui(e){return null===e||"object"!=typeof e}function hi(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function ci(e){return!ei(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var di=[!0,"true",1,"1","yes"],vi=e=>Hr(di,e),fi=[!1,"false",0,"0","no"];function pi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),oi(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),pi(n||r,t,r,i))}class gi{constructor(e){this.o={},this.h=e.h,this.m=pi(e.bucketSize,0,100,e.C),this.I=pi(e.refillRate,0,this.m,e.C),this.S=pi(e.refillInterval,0,864e5,e.C)}k(e,t){var r=t-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var n=i*this.I;e.tokens=Math.min(e.tokens+n,this.m),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.o[i];return n?this.k(n,r):(n={tokens:this.m,lastAccess:r},this.o[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.h)||t.call(this,e)),0===n.tokens)}stop(){this.o={}}}var mi,yi,bi,wi=e=>e instanceof Error;function _i(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return bi&&r.length===yi||(yi=r.length,bi=r.reduce(((r,i)=>{mi||(mi={});var n=mi[i];if(n)r[n[0]]=n[1];else for(var o=e(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,mi[i]=[l,u];break}}return r}),{})),bi}}class Ci{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Ur(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,o,s={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(o=e.synthetic)&&void 0!==o&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:_i(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var Ii="?";function Si(e,t,r,i,n){var o={platform:e,filename:t,function:"<anonymous>"===r?Ii:r,in_app:!0};return ei(i)||(o.lineno=i),ei(n)||(o.colno=n),o}var ki=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:Ii,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},xi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ai=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ti=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ei=(e,t)=>{var r=xi.exec(e);if(r){var[,i,n,o]=r;return Si(t,i,Ii,+n,+o)}var s=Ai.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=Ti.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,u]=ki(s[1]||Ii,s[2]);return Si(t,u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Mi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ni=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ri=(e,t)=>{var r=Mi.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Ni.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||Ii;return[o,n]=ki(o,n),Si(t,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Fi=/\(error: (.*)\)/,Oi=50;function Pi(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var o=[],s=t.split("\n"),a=n;a<s.length;a++){var l=s[a];if(!(l.length>1024)){var u=Fi.test(l)?l.replace(Fi,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,e);if(c){o.push(c);break}}if(o.length>=Oi)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Oi).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Ii});var i}))}(o)}}class Li{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ti(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return hi(e,"DOMException")}isDOMError(e){return hi(e,"DOMError")}}class Di{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bi{constructor(){}match(e){return hi(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Zi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class $i{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Zi);return i&&(t=i[1],r=i[2]),[t,r]}}var qi=["fatal","error","warning","log","info","debug"];function Hi(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class Vi{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ci(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Hi(e)}isSeverityLevel(e){return ti(e)&&!ri(e)&&qi.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(wi(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class ji{match(e){return ci(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hi(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Yi{match(e){return ui(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gi{match(e){return hi(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ui(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){if(ui(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}}var zi="undefined"!=typeof window?window:void 0,Wi="undefined"!=typeof globalThis?globalThis:zi;"undefined"==typeof self&&(Wi.self=Wi),"undefined"==typeof File&&(Wi.File=function(){});var Ui=Array.prototype,Xi=Ui.forEach,Ji=Ui.indexOf,Ki=null==Wi?void 0:Wi.navigator,Qi=null==Wi?void 0:Wi.document,en=null==Wi?void 0:Wi.location,tn=null==Wi?void 0:Wi.fetch,rn=null!=Wi&&Wi.XMLHttpRequest&&"withCredentials"in new Wi.XMLHttpRequest?Wi.XMLHttpRequest:void 0,nn=null==Wi?void 0:Wi.AbortController,on=null==Ki?void 0:Ki.userAgent,sn=null!=zi?zi:{},an=()=>!!zi.Zone,ln=e=>e instanceof Document,un={DEBUG:!1,LIB_VERSION:"1.301.2"},hn=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={A:function(t){if(zi&&(un.DEBUG||sn.POSTHOG_DEBUG||r)&&!ei(zi.console)&&zi.console){for(var i=("__rrweb_original__"in zi.console[t]?zi.console[t].__rrweb_original__:zi.console[t]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(e,...o)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.A("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>hn(e+" "+t,r)};return i},cn=hn("[PostHog.js]"),dn=cn.createLogger,vn={};function fn(e,t,r){if(Ur(e))if(Xi&&e.forEach===Xi)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===vn)return}function pn(e,t,r){if(!ni(e)){if(Ur(e))return fn(e,t,r);if(ai(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===vn)return}else for(var n in e)if(zr.call(e,n)&&t.call(r,e[n],n)===vn)return}}var gn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return fn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},mn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return fn(r,(function(t){fn(t,(function(t){e.push(t)}))})),e};function yn(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var bn=function(e){try{return e()}catch(e){return}},wn=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){cn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cn.critical(e)}}},_n=function(e){var t={};return pn(e,(function(e,r){(ti(e)&&e.length>0||oi(e))&&(t[r]=e)})),t};function Cn(e,t){return r=e,i=e=>ti(e)&&!ii(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Ur(t)?(o=[],fn(t,(t=>{o.push(e(t))}))):(o={},pn(t,((t,r)=>{n.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,i,n}var In=["herokuapp.com","vercel.app","netlify.app"];function Sn(e){var t=null==e?void 0:e.hostname;if(!ti(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of In)if(r===i)return!1;return!0}function kn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function xn(e,t,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:o})}var An=e=>{var t=null==Qi?void 0:Qi.createElement("a");return ei(t)?null:(t.href=e,t)},Tn=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return pn(e,(function(e,t){ei(e)||ei(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},En=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===t){r=o;break}}if(!Ur(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){cn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Mn=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],l=s[0],u=(a||"").split("&"),h=[],c=0;c<u.length;c++){var d=u[c].split("=");Ur(d)&&(t.includes(d[0])?h.push(d[0]+"="+r):h.push(u[c]))}var v=l;return null!=a&&(v+="?"+h.join("&")),null!=o&&(v+="#"+o),v},Nn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Rn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Fn(e,t){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of t.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var On="$people_distinct_id",Pn="__alias",Ln="__timers",Dn="$autocapture_disabled_server_side",Bn="$heatmaps_enabled_server_side",Zn="$exception_capture_enabled_server_side",$n="$error_tracking_suppression_rules",qn="$error_tracking_capture_extension_exceptions",Hn="$web_vitals_enabled_server_side",Vn="$dead_clicks_enabled_server_side",jn="$web_vitals_allowed_metrics",Yn="$session_recording_remote_config",Gn="$sesid",zn="$session_is_sampled",Wn="$enabled_feature_flags",Un="$early_access_features",Xn="$feature_flag_details",Jn="$stored_person_properties",Kn="$stored_group_properties",Qn="$surveys",eo="$surveys_activated",to="$flag_call_reported",ro="$user_state",io="$client_session_props",no="$capture_rate_limit",oo="$initial_campaign_params",so="$initial_referrer_info",ao="$initial_person_info",lo="$epp",uo="__POSTHOG_TOOLBAR__",ho="$posthog_cookieless",co=[On,Pn,"__cmpns",Ln,"$session_recording_enabled_server_side",Bn,Gn,Wn,$n,ro,Un,Xn,Kn,Jn,Qn,to,io,no,oo,so,lo,ao];function vo(e){return e instanceof Element&&(e.id===uo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function fo(e){return!!e&&1===e.nodeType}function po(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function go(e){return!!e&&3===e.nodeType}function mo(e){return!!e&&11===e.nodeType}function yo(e){return e?Vr(e).split(/\s+/):[]}function bo(e){var t=null==zi?void 0:zi.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function wo(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 yo(t)}function _o(e){return ni(e)?null:Vr(e).split(/(\s+)/).filter((e=>Ho(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(e){var t="";return Oo(e)&&!Po(e)&&e.childNodes&&e.childNodes.length&&pn(e.childNodes,(function(e){var r;go(e)&&e.textContent&&(t+=null!==(r=_o(e.textContent))&&void 0!==r?r:"")})),Vr(t)}function Io(e){return ei(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var So=["a","button","form","input","select","textarea","label"];function ko(e,t){if(ei(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function xo(e){var t=e.parentNode;return!(!t||!fo(t))&&t}var Ao=["next","previous","prev",">","<"],To=10;var Eo=[".ph-no-rageclick",".ph-no-capture"];function Mo(e,t){if(!zi||No(e))return!1;var r,i,n;si(t)?(r=!!t&&Eo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Eo,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Ro(e,!1);return!function(e,t){if(!1===e||ei(e))return!1;var r;if(!0===e)r=Ao;else{if(!Ur(e))return!1;if(e.length>To)return cn.error("[PostHog] content_ignorelist array cannot exceed "+To+" items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,o.map((e=>{var t;return{safeText:Co(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!ko(o,r)}var No=e=>!e||po(e,"html")||!fo(e),Ro=(e,t)=>{if(!zi||No(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=xo(n);if(!o)break;if(t||So.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=zi.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Fo(e,t,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!zi||No(e))return!1;if(null!=(o=r)&&o.url_allowlist&&!bo(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&bo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Ro(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ei(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var o of e)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!ko(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=zi.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(So.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function Oo(e){for(var t=e;t.parentNode&&!po(t,"body");t=t.parentNode){var r=wo(t);if(Hr(r,"ph-sensitive")||Hr(r,"ph-no-capture"))return!1}if(Hr(wo(e),"ph-include"))return!0;var i=e.type||"";if(ti(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ti(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 Po(e){return!!(po(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||po(e,"select")||po(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Lo="(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})",Do=new RegExp("^(?:"+Lo+")$"),Bo=new RegExp(Lo),Zo="\\d{3}-?\\d{2}-?\\d{4}",$o=new RegExp("^("+Zo+")$"),qo=new RegExp("("+Zo+")");function Ho(e,t){if(void 0===t&&(t=!0),ni(e))return!1;if(ti(e)){if(e=Vr(e),(t?Do:Bo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?$o:qo).test(e))return!1}return!0}function Vo(e){var t=Co(e);return Ho(t=(t+" "+jo(e)).trim())?t:""}function jo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&pn(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Co(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+jo(e)).trim())}catch(e){cn.error("[AutoCapture]",e)}})),t}function Yo(e){return function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))n+="."+o.replace(/"/g,"");var s=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return yn(s).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Go(t.toString())]=Go(r.toString())})),n+=":",n+=yn(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:zo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return yn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Go(e){return e.replace(/"|\\"/g,'\\"')}function zo(e){var t=e.attr__class;return t?Ur(t)?t:yo(t):void 0}var Wo={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",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Uo=dn("[Recorder]"),Xo=e=>"navigation"===e.entryType,Jo=e=>"resource"===e.entryType;function Ko(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Xo(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>os({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Xo(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>os({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Qo(e,t){return!!t&&(si(t)||t[e])}function es(e){var{type:t,recordBody:r,headers:i,url:n}=e;function o(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(si(r))return!0;if(Ur(r))return o(r);var s=r[t];return si(s)?s:o(s)}function ts(e,t,r,i,n,o){return rs.apply(this,arguments)}function rs(){return rs=t((function*(e,t,r,i,n,o){if(void 0===o&&(o=0),o>10)return Uo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var s=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Jo(e)&&e.initiatorType===t&&(ei(i)||e.startTime>=i)&&(ei(n)||e.startTime<=n)));return s||(yield new Promise((e=>setTimeout(e,50*o))),ts(e,t,r,i,n,o+1))})),rs.apply(this,arguments)}function is(e){var{body:t,options:r,url:i}=e;if(ni(t))return null;var{hostname:n,isHostDenied:o}=Fn(i,r);if(o)return n+" is in deny list";if(ti(t))return t;if(ln(t))return t.textContent;if(ai(t))return Tn(t);if(Kr(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 ns=e=>!ii(e)&&("navigation"===e.entryType||"resource"===e.entryType);function os(e){var{entry:t,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:ei(a)?void 0:Math.round(a),endTime:ei(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ns(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ss=["video/","audio/"];function as(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function ls(){return ls=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:o}=Fn(i,r);return o?Promise.resolve(n+" is in deny list"):as(t)})),ls.apply(this,arguments)}function us(){return us=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),s=ss.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=Fn(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return ii(n)?as(t):Promise.resolve(n)})),us.apply(this,arguments)}function hs(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Qo("request",i.recordHeaders),o=Qo("response",i.recordHeaders),s=Rn(r,"fetch",(s=>function(){var a=t((function*(t,a){var l,u,h,c=new Request(t,a),d={};try{var v={};c.headers.forEach(((e,t)=>{v[t]=e})),n&&(d.requestHeaders=v),es({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(d.requestBody=yield function(e){return ls.apply(this,arguments)}({r:c,options:i,url:t})),u=r.performance.now(),l=yield s(c),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),o&&(d.responseHeaders=f),es({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(d.responseBody=yield function(e){return us.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{ts(r,"fetch",c.url,u,h).then((t=>{var r,i=os({entry:t,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var cs=null;function ds(e,t,i){if(!("performance"in t))return()=>{};if(cs)return Uo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Wo,i):Wo,o=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},s=Ko(o,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Qo("request",r.recordHeaders),n=Qo("response",r.recordHeaders),o=Rn(t.XMLHttpRequest.prototype,"open",(o=>function(s,a,l,u,h){void 0===l&&(l=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(es({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=is({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),es({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=is({body:v.response,options:r,url:a})),ts(t,"xmlhttprequest",f.url,c,d).then((t=>{var r=os({entry:t,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),l,u,h)}));return()=>{o()}}(o,t,n),l=hs(o,t,n)),cs=()=>{s(),a(),l(),cs=null}}var vs=e=>({name:"rrweb/network@1",observer:ds,options:e});sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:vs},sn.__PosthogExtensions__.rrweb={record:Zt,version:"v2"},sn.rrweb={record:Zt,version:"v2"},sn.rrwebConsoleRecord={getRecordConsolePlugin:Br},sn.getRecordNetworkPlugin=vs;var fs,ps,gs,ms,ys,bs,ws,_s,Cs={},Is=[],Ss=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ks=Array.isArray;function xs(e,t){for(var r in t)e[r]=t[r];return e}function As(e){var t=e.parentNode;t&&t.removeChild(e)}function Ts(e,t,r){var i,n,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?n=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?fs.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Es(e,s,i,n,null)}function Es(e,t,r,i,n){var o={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++gs:n,__i:-1,__u:0};return null==n&&null!=ps.vnode&&ps.vnode(o),o}function Ms(e){return e.children}function Ns(e,t){this.props=e,this.context=t}function Rs(e,t){if(null==t)return e.__?Rs(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Rs(e):null}function Fs(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Fs(e)}}function Os(e){(!e.__d&&(e.__d=!0)&&ms.push(e)&&!Ps.__r++||ys!==ps.debounceRendering)&&((ys=ps.debounceRendering)||bs)(Ps)}function Ps(){var e,t,r,i,n,o,s,a,l;for(ms.sort(ws);e=ms.shift();)e.__d&&(t=ms.length,i=void 0,o=(n=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((i=xs({},n)).__v=n.__v+1,ps.vnode&&ps.vnode(i),Vs(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?Rs(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,js(a,i,l),i.__e!=o&&Fs(i)),ms.length>t&&ms.sort(ws));Ps.__r=0}function Ls(e,t,r,i,n,o,s,a,l,u,h){var c,d,v,f,p,g=i&&i.__k||Is,m=t.length;for(r.__d=l,function(e,t,r){var i,n,o,s,a,l=t.length,u=r.length,h=u,c=0;for(e.__k=[],i=0;i<l;i++)null!=(n=e.__k[i]=null==(n=t[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Es(null,n,null,null,n):ks(n)?Es(Ms,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Es(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=Bs(n,r,s=i+c,h),n.__i=a,o=null,-1!==a&&(h--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&c--,"function"!=typeof n.type&&(n.__u|=65536)):a!==s&&(a===s+1?c++:a>s?h>l-s?c+=a-s:c--:c=a<s&&a==s-1?a-s:0,a!==i+c&&(n.__u|=65536))):(o=r[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Rs(o)),Gs(o,o,!1),r[i]=null,h--);if(h)for(i=0;i<u;i++)null!=(o=r[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Rs(o)),Gs(o,o))}(r,t,g),l=r.__d,c=0;c<m;c++)null!=(v=r.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?Cs:g[v.__i]||Cs,v.__i=c,Vs(e,v,d,n,o,s,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ys(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Ds(v,l,e):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);r.__d=l,r.__e=p}function Ds(e,t,r){var i,n;if("function"==typeof e.type){for(i=e.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=e,t=Ds(i[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Bs(e,t,r,i){var n=e.key,o=e.type,s=r-1,a=r+1,l=t[r];if(null===l||l&&n==l.key&&o===l.type)return r;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)&&n==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function Zs(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ss.test(t)?r:r+"px"}function $s(e,t,r,i,n){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Zs(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Zs(e.style,t,r[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]=r,r?i?r.u=i.u:(r.u=Date.now(),e.addEventListener(t,o?Hs:qs,o)):e.removeEventListener(t,o?Hs:qs,o);else{if(n)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==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function qs(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ps.event?ps.event(e):e)}function Hs(e){return this.l[e.type+!0](ps.event?ps.event(e):e)}function Vs(e,t,r,i,n,o,s,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=t.__e=r.__e]),(h=ps.__b)&&h(t);e:if("function"==typeof S)try{if(m=t.props,y=(h=S.contextType)&&i[h.__c],b=h?y?y.props.value:h.__:i,r.__c?g=(c=t.__c=r.__c).__=c.__E:("prototype"in S&&S.prototype.render?t.__c=c=new S(m,b):(t.__c=c=new Ns(m,b),c.constructor=S,c.render=zs),y&&y.sub(c),c.props=m,c.state||(c.state={}),c.context=b,c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=xs({},c.__s)),xs(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=t,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,b),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,b)||t.__v===r.__v)){for(t.__v!==r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<c._sb.length;w++)c.__h.push(c._sb[w]);c._sb=[],c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=b,c.props=m,c.__P=e,c.__e=!1,$=ps.__r,_=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(t),h=c.render(c.props,c.state,c.context),C=0;C<c._sb.length;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,$&&$(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++_<25);c.state=c.__s,null!=c.getChildContext&&(i=xs(xs({},i),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Ls(e,ks(I=null!=h&&h.type===Ms&&null==h.key?h.props.children:h)?I:[I],t,r,i,n,o,s,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),ps.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,i,n,o,s,a,l){var u,h,c,d,v,f,p,g=r.props,m=t.props,y=t.type;if("svg"===y&&(n=!0),null!=o)for(u=0;u<o.length;u++)if((v=o[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){e=v,o[u]=null;break}if(null==e){if(null===y)return document.createTextNode(m);e=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),o=null,a=!1}if(null===y)g===m||a&&e.data===m||(e.data=m);else{if(o=o&&fs.call(e.childNodes),g=r.props||Cs,!a&&null!=o)for(g={},u=0;u<e.attributes.length;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||$s(e,u,null,v,n));for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:"key"===u||a&&"function"!=typeof v||g[u]===v||$s(e,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Ls(e,ks(d)?d:[d],t,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&Rs(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&As(o[u]);a||(u="value",void 0!==f&&(f!==e[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&$s(e,u,f,g[u],!1),u="checked",void 0!==p&&p!==e[u]&&$s(e,u,p,g[u],!1))}return e}(r.__e,t,r,i,n,o,s,l,u);(h=ps.diffed)&&h(t)}function js(e,t,r){t.__d=void 0;for(var i=0;i<r.length;i++)Ys(r[i],r[++i],r[++i]);ps.__c&&ps.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ps.__e(e,t.__v)}}))}function Ys(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){ps.__e(e,r)}}function Gs(e,t,r){var i,n;if(ps.unmount&&ps.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ys(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ps.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Gs(i[n],t,r||"function"!=typeof e.type);r||null==e.__e||As(e.__e),e.__=e.__e=e.__d=void 0}function zs(e,t,r){return this.constructor(e,r)}function Ws(e,t,r){var i,n,o;ps.__&&ps.__(e,t),i=!1?null:t.__k,n=[],o=[],Vs(t,e=t.__k=Ts(Ms,null,[e]),i||Cs,Cs,void 0!==t.ownerSVGElement,i?null:t.firstChild?fs.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,o),js(n,e,o)}function Us(e,t,r){var i,n,o,s,a=xs({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?n=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?fs.call(arguments,2):r),Es(e.type,a,i||e.key,n||e.ref,null)}fs=Is.slice,ps={__e:function(e,t,r,i){for(var n,o,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(t){e=t}throw e}},gs=0,Ns.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xs({},this.state),"function"==typeof e&&(e=e(xs({},r),this.props)),e&&xs(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Os(this))},Ns.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Os(this))},Ns.prototype.render=Ms,ms=[],bs="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ws=function(e,t){return e.__v.__b-t.__v.__b},Ps.__r=0,_s=0;var Xs,Js,Ks,Qs,ea=0,ta=[],ra=[],ia=ps.__b,na=ps.__r,oa=ps.diffed,sa=ps.__c,aa=ps.unmount;function la(e,t){ps.__h&&ps.__h(Js,e,ea||t),ea=0;var r=Js.__H||(Js.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ra}),r.__[e]}function ua(e){return ea=1,function(e,t,r){var i=la(Xs++,2);if(i.t=e,!i.__c&&(i.__=[wa(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Js,!Js.u)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return e.__c}));if(n.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return n.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,r))};Js.u=!0;var o=Js.shouldComponentUpdate,s=Js.componentWillUpdate;Js.componentWillUpdate=function(e,t,r){if(this.__e){var i=o;o=void 0,n(e,t,r),o=i}s&&s.call(this,e,t,r)},Js.shouldComponentUpdate=n}return i.__N||i.__}(wa,e)}function ha(e,t){var r=la(Xs++,3);!ps.__s&&ba(r.__H,t)&&(r.__=e,r.i=t,Js.__H.__h.push(r))}function ca(e){return ea=5,da((function(){return{current:e}}),[])}function da(e,t){var r=la(Xs++,7);return ba(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function va(e){var t=Js.context[e.__c],r=la(Xs++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Js)),t.props.value):e.__}function fa(){for(var e;e=ta.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ma),e.__H.__h.forEach(ya),e.__H.__h=[]}catch(t){e.__H.__h=[],ps.__e(t,e.__v)}}ps.__b=function(e){Js=null,ia&&ia(e)},ps.__r=function(e){na&&na(e),Xs=0;var t=(Js=e.__c).__H;t&&(Ks===Js?(t.__h=[],Js.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ra,e.__N=e.i=void 0}))):(t.__h.forEach(ma),t.__h.forEach(ya),t.__h=[],Xs=0)),Ks=Js},ps.diffed=function(e){oa&&oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ta.push(t)&&Qs===ps.requestAnimationFrame||((Qs=ps.requestAnimationFrame)||ga)(fa)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ra&&(e.__=e.__V),e.i=void 0,e.__V=ra}))),Ks=Js=null},ps.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ma),e.__h=e.__h.filter((function(e){return!e.__||ya(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ps.__e(r,e.__v)}})),sa&&sa(e,t)},ps.unmount=function(e){aa&&aa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{ma(e)}catch(e){t=e}})),r.__H=void 0,t&&ps.__e(t,r.__v))};var pa="function"==typeof requestAnimationFrame;function ga(e){var t,r=function(){clearTimeout(i),pa&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);pa&&(t=requestAnimationFrame(r))}function ma(e){var t=Js,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Js=t}function ya(e){var t=Js;e.__c=e.__(),Js=t}function ba(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function wa(e,t){return"function"==typeof t?t(e):t}var _a=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),Ca=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Ia=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Sa=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),ka=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),xa=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Aa=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Ta=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Ea=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),Ma=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),Na=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Ra=dn("[Surveys]");function Fa(e){return!(!e.start_date||e.end_date)}function Oa(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Pa(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var La="seenSurvey_",Da="inProgressSurvey_",Ba=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Za=e=>{var t=""+La+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+La+e.id+"_"+e.current_iteration),t},$a=e=>{localStorage.getItem(Za(e))||localStorage.setItem(Za(e),"true")},qa=[ka.Popover,ka.Widget,ka.API],Ha={ignoreConditions:!1,ignoreDelay:!1,displayType:Na.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return oi(e)&&isFinite(e)&&Math.floor(e)===e});var Va="0123456789abcdef";class ja{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new ja(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Va.charAt(this.bytes[t]>>>4)+Va.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 ja(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ya{constructor(){this.T=0,this.M=0,this.N=new Wa}generate(){var e=this.generateOrAbort();if(ei(e)){this.T=0;var t=this.generateOrAbort();if(ei(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.T)this.T=e,this.R();else{if(!(e+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return ja.fromFieldsV7(this.T,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.N.nextUint32())}R(){this.M=1024*this.N.nextUint32()+(1023&this.N.nextUint32())}}var Ga,za=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};zi&&!ei(zi.crypto)&&crypto.getRandomValues&&(za=e=>crypto.getRandomValues(e));class Wa{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(za(this.F),this.O=0),this.F[this.O++]}}var Ua=()=>Xa().toString(),Xa=()=>(Ga||(Ga=new Ya)).generate(),Ja="Mobile",Ka="iOS",Qa="Android",el="Tablet",tl=Qa+" "+el,rl="iPad",il="Apple",nl=il+" Watch",ol="Safari",sl="BlackBerry",al="Samsung",ll=al+"Browser",ul=al+" Internet",hl="Chrome",cl=hl+" OS",dl=hl+" "+Ka,vl="Internet Explorer",fl=vl+" "+Ja,pl="Opera",gl=pl+" Mini",ml="Edge",yl="Microsoft "+ml,bl="Firefox",wl=bl+" "+Ka,_l="Nintendo",Cl="PlayStation",Il="Xbox",Sl=Qa+" "+Ja,kl=Ja+" "+ol,xl="Windows",Al=xl+" Phone",Tl="Nokia",El="Ouya",Ml="Generic",Nl=Ml+" "+Ja.toLowerCase(),Rl=Ml+" "+el.toLowerCase(),Fl="Konqueror",Ol="(\\d+(\\.\\d+)?)",Pl=new RegExp("Version/"+Ol),Ll=new RegExp(Il,"i"),Dl=new RegExp(Cl+" \\w+","i"),Bl=new RegExp(_l+" \\w+","i"),Zl=new RegExp(sl+"|PlayBook|BB10","i"),$l={"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 ql=(e,t)=>t&&Hr(t,il)||function(e){return Hr(e,ol)&&!Hr(e,hl)&&!Hr(e,Qa)}(e),Hl=function(e,t){return t=t||"",Hr(e," OPR/")&&Hr(e,"Mini")?gl:Hr(e," OPR/")?pl:Zl.test(e)?sl:Hr(e,"IE"+Ja)||Hr(e,"WPDesktop")?fl:Hr(e,ll)?ul:Hr(e,ml)||Hr(e,"Edg/")?yl:Hr(e,"FBIOS")?"Facebook "+Ja:Hr(e,"UCWEB")||Hr(e,"UCBrowser")?"UC Browser":Hr(e,"CriOS")?dl:Hr(e,"CrMo")||Hr(e,hl)?hl:Hr(e,Qa)&&Hr(e,ol)?Sl:Hr(e,"FxiOS")?wl:Hr(e.toLowerCase(),Fl.toLowerCase())?Fl:ql(e,t)?Hr(e,Ja)?kl:ol:Hr(e,bl)?bl:Hr(e,"MSIE")||Hr(e,"Trident/")?vl:Hr(e,"Gecko")?bl:""},Vl={[fl]:[new RegExp("rv:"+Ol)],[yl]:[new RegExp(ml+"?\\/"+Ol)],[hl]:[new RegExp("("+hl+"|CrMo)\\/"+Ol)],[dl]:[new RegExp("CriOS\\/"+Ol)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ol)],[ol]:[Pl],[kl]:[Pl],[pl]:[new RegExp("(Opera|OPR)\\/"+Ol)],[bl]:[new RegExp(bl+"\\/"+Ol)],[wl]:[new RegExp("FxiOS\\/"+Ol)],[Fl]:[new RegExp("Konqueror[:/]?"+Ol,"i")],[sl]:[new RegExp(sl+" "+Ol),Pl],[Sl]:[new RegExp("android\\s"+Ol,"i")],[ul]:[new RegExp(ll+"\\/"+Ol)],[vl]:[new RegExp("(rv:|MSIE )"+Ol)],Mozilla:[new RegExp("rv:"+Ol)]},jl=function(e,t){var r=Hl(e,t),i=Vl[r];if(ei(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},Yl=[[new RegExp(Il+"; "+Il+" (.*?)[);]","i"),e=>[Il,e&&e[1]||""]],[new RegExp(_l,"i"),[_l,""]],[new RegExp(Cl,"i"),[Cl,""]],[Zl,[sl,""]],[new RegExp(xl,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Al,""];if(new RegExp(Ja).test(t)&&!/IEMobile\b/.test(t))return[xl+" "+Ja,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=$l[i]||"";return/arm/i.test(t)&&(n="RT"),[xl,n]}return[xl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ka,t.join(".")]}return[Ka,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ei(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qa+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qa+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Qa,t.join(".")]}return[Qa,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cl,""]],[/Linux|debian/i,["Linux",""]]],Gl=function(e){return Bl.test(e)?_l:Dl.test(e)?Cl:Ll.test(e)?Il:new RegExp(El,"i").test(e)?El:new RegExp("("+Al+"|WPDesktop)","i").test(e)?Al:/iPad/.test(e)?rl:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?nl:Zl.test(e)?sl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Tl,"i").test(e)?Tl:/(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(Ja).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)?Qa:tl:Qa:new RegExp("(pda|"+Ja+")","i").test(e)?Nl:new RegExp(el,"i").test(e)&&!new RegExp(el+" pc","i").test(e)?Rl:""},zl=function(e){var t=Gl(e);return t===rl||t===tl||"Kobo"===t||"Kindle Fire"===t||t===Rl?el:t===_l||t===Il||t===Cl||t===El?"Console":t===nl?"Wearable":t?Ja:"Desktop"},Wl="$copy_autocapture",Ul=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Xl=Uint8Array,Jl=Uint16Array,Kl=Uint32Array,Ql=new Xl([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]),eu=new Xl([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]),tu=new Xl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ru=function(e,t){for(var r=new Jl(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new Kl(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},iu=ru(Ql,2),nu=iu[0],ou=iu[1];nu[28]=258,ou[258]=28;for(var su=ru(eu,0)[1],au=new Jl(32768),lu=0;lu<32768;++lu){var uu=(43690&lu)>>>1|(21845&lu)<<1;uu=(61680&(uu=(52428&uu)>>>2|(13107&uu)<<2))>>>4|(3855&uu)<<4,au[lu]=((65280&uu)>>>8|(255&uu)<<8)>>>1}var hu=function(e,t,r){for(var i=e.length,n=0,o=new Jl(t);n<i;++n)++o[e[n]-1];var s,a=new Jl(t);for(n=0;n<t;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new Jl(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],c=a[e[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[au[c]>>>l]=u}else for(s=new Jl(i),n=0;n<i;++n)s[n]=au[a[e[n]-1]++]>>>15-e[n];return s},cu=new Xl(288);for(lu=0;lu<144;++lu)cu[lu]=8;for(lu=144;lu<256;++lu)cu[lu]=9;for(lu=256;lu<280;++lu)cu[lu]=7;for(lu=280;lu<288;++lu)cu[lu]=8;var du=new Xl(32);for(lu=0;lu<32;++lu)du[lu]=5;var vu=hu(cu,9,0),fu=hu(du,5,0),pu=function(e){return(e/8>>0)+(7&e&&1)},gu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Jl?Jl:e instanceof Kl?Kl:Xl)(r-t);return i.set(e.subarray(t,r)),i},mu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},yu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},bu=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,o=r.slice();if(!n)return[new Xl(0),0];if(1==n){var s=new Xl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,c=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[u].f<r[c].f?u++:c++],l=r[u!=h&&r[u].f<r[c].f?u++:c++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new Jl(d+1),f=wu(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(o.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));i<n;++i){var y=o[i].s;if(!(v[y]>t))break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=o[i].s;v[b]<t?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new Xl(v),f]},wu=function(e,t,r){return-1==e.s?Math.max(wu(e.l,t,r+1),wu(e.r,t,r+1)):t[e.s]=r},_u=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Jl(++t),i=0,n=e[0],o=1,s=function(e){r[i++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++o;else{if(!n&&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(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=e[a]}return[r.subarray(0,i),t]},Cu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},Iu=function(e,t,r){var i=r.length,n=pu(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var o=0;o<i;++o)e[n+o+4]=r[o];return 8*(n+4+i)},Su=function(e,t,r,i,n,o,s,a,l,u,h){mu(t,h++,r),++n[256];for(var c=bu(n,15),d=c[0],v=c[1],f=bu(o,15),p=f[0],g=f[1],m=_u(d),y=m[0],b=m[1],w=_u(p),_=w[0],C=w[1],I=new Jl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=bu(I,7),x=k[0],A=k[1],T=19;T>4&&!x[tu[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Cu(n,cu)+Cu(o,du)+s,P=Cu(n,d)+Cu(o,p)+s+14+3*T+Cu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Iu(t,h,e.subarray(l,l+u));if(mu(t,h,1+(P<O)),h+=2,P<O){E=hu(d,v,0),M=d,N=hu(p,g,0),R=p;var L=hu(x,A,0);mu(t,h,b-257),mu(t,h+5,C-1),mu(t,h+10,T-4),h+=14;for(S=0;S<T;++S)mu(t,h+3*S,x[tu[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];mu(t,h,L[q]),h+=x[q],q>15&&(mu(t,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=vu,M=cu,N=fu,R=du;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;yu(t,h,E[q+257]),h+=M[q+257],q>7&&(mu(t,h,i[S]>>>23&31),h+=Ql[q]);var H=31&i[S];yu(t,h,N[H]),h+=R[H],H>3&&(yu(t,h,i[S]>>>5&8191),h+=eu[H])}else yu(t,h,E[i[S]]),h+=M[i[S]];return yu(t,h,E[256]),h+M[256]},ku=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xu=function(){for(var e=new Kl(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Au=function(e,t,r,i,n){return function(e,t,r,i,n,o){var s=e.length,a=new Xl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?u=Iu(l,u,e.subarray(h,c)):(l[h]=o,u=Iu(l,u,e.subarray(h,s)))}else{for(var d=ku[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Jl(32768),m=new Jl(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},_=new Kl(25e3),C=new Jl(288),I=new Jl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=w(h),M=32767&h,N=m[E];if(g[M]=N,m[E]=M,A<=h){var R=s-h;if((S>7e3||x>24576)&&R>423){u=Su(e,l,0,_,C,I,k,x,T,h-T,u),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==w(h-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,h),q=Math.min(258,R);D<=Z&&--L&&M!=N;){if(e[h+O]==e[h+O-D]){for(var H=0;H<q&&e[h+H]==e[h+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=h-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(M=N)-(N=g[M])+32768&32767}if(P){_[x++]=268435456|ou[O]<<18|su[P];var z=31&ou[O],W=31&su[P];k+=Ql[z]+eu[W],++C[257+z],++I[W],A=h+O,++S}else _[x++]=e[h],++C[e[h]]}}u=Su(e,l,o,_,C,I,k,x,T,h-T,u)}return gu(a,0,i+pu(u)+n)}(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,r,i,!0)},Tu=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Eu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=xu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Au(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=n.length;return function(e,t){var r=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&&Tu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Tu(n,o-8,r.d()),Tu(n,o-4,i),n}var Mu=function(e){var t,r,i,n,o="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=e.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ii(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=n+1)}return r>t&&(o+=e.substring(t,e.length)),o},Nu=!!rn||!!tn,Ru="text/plain",Fu=function(e,t,i){var n;void 0===i&&(i=!0);var[o,s]=e.split("?"),a=r({},t),l=null!==(n=null==s?void 0:s.split("&").map((e=>{var t,[r,n]=e.split("="),o=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],u=Tn(a);return u&&l.push(u),o+"?"+l.join("&")},Ou=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Pu=e=>{var{data:t,compression:r}=e;if(t){if(r===Ul.GZipJS){var i=Eu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Xl(e.length+(e.length>>>1)),n=0,o=function(e){i[n++]=e},s=0;s<r;++s){if(n+5>i.length){var a=new Xl(n+8+(r-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 gu(i,0,n)}(Ou(t)),{mtime:0}),n=new Blob([i],{type:Ru});return{contentType:Ru,body:n,estimatedSize:n.size}}if(r===Ul.Base64){var o=function(e){var t,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!e)return e;e=Mu(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[l++]=s.charAt(t)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<e.length);switch(u=h.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ou(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ou(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Lu=[];tn&&Lu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:o,estimatedSize:s}=null!==(t=Pu(e))&&void 0!==t?t:{},a=new Headers;pn(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(nn){var h=new nn;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),e.timeout)}}tn(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){cn.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{cn.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),rn&&Lu.push({transport:"XHR",method:e=>{var t,r=new rn;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Pu(e))&&void 0!==t?t:{};pn(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Ki&&Ki.sendBeacon&&Lu.push({transport:"sendBeacon",method:e=>{var t=Fu(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Pu(e))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Ki.sendBeacon(t,o)}catch(e){}}});var Du=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Bu(e,t,r){return Ou({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Zu={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Du(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Du(t,e))))),icontains:(e,t)=>t.map($u).some((t=>e.map($u).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map($u).every((t=>e.map($u).every((e=>!t.includes(e)))))},$u=e=>e.toLowerCase();function qu(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ei(n)||ii(n))return!1;var o=[String(n)],s=Zu[i.operator];return!!s&&s(i.values,o)}))}var Hu=dn("[Stylesheet Loader]"),Vu=zi,ju=Qi;function Yu(e){return"$survey_response_"+e}var Gu="#020617",zu={fontFamily:"inherit",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:Ia.Right,widgetType:Ca.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Wu(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 Uu(e){var t;void 0===e&&(e=zu.backgroundColor),"#"===e[0]&&(t=Wu(e)),e.startsWith("rgb")&&(t=e);var r={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()];if(r&&(t=Wu(r)),!t)return Gu;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Gu:"white"}return Gu}function Xu(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Hu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var Ju=(e,t,i)=>{var n=ph(e),o=ju.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=ju.createElement("div");((e,t,i)=>{var n=r({},zu,i),o=e.style,s=![Ia.Center,Ia.Left,Ia.Right].includes(n.position)||t===ka.Widget&&(null==i?void 0:i.widgetType)===Ca.Tab;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Uu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-text-color",Uu(n.ratingButtonColor)),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Uu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",Uu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Uu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackgroundColor)||n.inputBackground;null!=i&&i.inputBackgroundColor||"white"!==n.backgroundColor||(a="#f8f8f8"),o.setProperty("--ph-survey-input-background",a),o.setProperty("--ph-survey-input-text-color",(null==i?void 0:i.inputTextColor)||Uu(a)),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,e.type,e.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Xu(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Ku=(e,t)=>{if(!t)return null;var r=e[Yu(t)];return Ur(r)?[...r]:r},Qu=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=e;o?($a(i),o.capture(Ea.SENT,r({[Ma.SURVEY_NAME]:i.name,[Ma.SURVEY_ID]:i.id,[Ma.SURVEY_ITERATION]:i.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Ma.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:Ku(t,e.id)}))),[Ma.SURVEY_SUBMISSION_ID]:n,[Ma.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,{$set:{[Ba(i,"responded")]:!0}})),s&&(Vu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),fh(i))):Ra.error("[survey sent] event not captured, PostHog instance not found.")},eh=(e,t,i)=>{if(t){if(!i){var n=dh(e);t.capture(Ea.DISMISSED,r({[Ma.SURVEY_NAME]:e.name,[Ma.SURVEY_ID]:e.id,[Ma.SURVEY_ITERATION]:e.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ma.SURVEY_PARTIALLY_COMPLETED]:Object.values((null==n?void 0:n.responses)||{}).filter((e=>!ni(e))).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==n?void 0:n.responses,{[Ma.SURVEY_SUBMISSION_ID]:null==n?void 0:n.surveySubmissionId,[Ma.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:Ku((null==n?void 0:n.responses)||{},e.id)}))),$set:{[Ba(e,"dismissed")]:!0}})),fh(e),$a(e),Vu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ra.error("[survey dismissed] event not captured, PostHog instance not found.")},th=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),rh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,ih=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?rh(e.questions,th(e.questions)):e.questions,nh=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Ta.Always||vh(e)},oh=function(e,t){var r={__c:t="__cC"+_s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Os(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),sh=()=>va(oh),ah=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return Us(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function lh(e){return null!=e?e:"icontains"}function uh(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==Vu||null==(r=Vu.location)?void 0:r.href;if(!n)return!1;var o=[e.conditions.url],s=lh(null==(i=e.conditions)?void 0:i.urlMatchType);return Zu[s](o,[n])}var hh=e=>{var t=""+Da+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Da+e.id+"_"+e.current_iteration),t},ch=(e,t)=>{try{localStorage.setItem(hh(e),JSON.stringify(t))}catch(e){Ra.error("Error setting in-progress survey state in localStorage",e)}},dh=e=>{try{var t=localStorage.getItem(hh(e));if(t)return JSON.parse(t)}catch(e){Ra.error("Error getting in-progress survey state from localStorage",e)}return null},vh=e=>{var t=dh(e);return!ni(null==t?void 0:t.surveySubmissionId)},fh=e=>{try{localStorage.removeItem(hh(e))}catch(e){Ra.error("Error clearing in-progress survey state from localStorage",e)}};function ph(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var gh=0;function mh(e,t,r,i,n,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--gh,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return ps.vnode&&ps.vnode(u),u}var yh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),bh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),wh=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),_h=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),Ch=mh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mh("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"})}),Ih=mh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[mh("title",{id:"close-survey-title",children:"Close survey"}),mh("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"})]}),Sh=mh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[mh("g",{"clip-path":"url(#clip0_2415_6911)",children:[mh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:mh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),mh("g",{mask:"url(#mask0_2415_6911)",children:[mh("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"}),mh("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"}),mh("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"}),mh("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"}),mh("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"}),mh("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"})]})]}),mh("defs",{children:mh("clipPath",{id:"clip0_2415_6911",children:mh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function kh(){return mh("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Sh]})}function xh(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=e,{isPreviewMode:l}=va(oh);return mh("div",{className:"bottom-section",children:[!a&&mh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==zi||zi.open(o)),l?null==s||s():n()},children:t}),!i.whiteLabel&&mh(kh,{})]})}function Ah(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return mh("div",{class:"question-header",children:[mh(t.type===xa.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&ah({component:Ts("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Th(e){var{onClick:t}=e,{isPreviewMode:r}=va(oh);return mh("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ih})}mh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:mh("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"})});var Eh=zi;function Mh(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=e,{isPopup:a}=va(oh);return ha((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return xn(Eh,"keydown",e),()=>{Eh.removeEventListener("keydown",e)}}),[s]),mh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&mh(Th,{onClick:()=>s()}),mh("h3",{className:"thank-you-message-header",children:t}),r&&ah({component:Ts("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&mh(xh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Nh=e=>Ur(e)&&e.every((e=>ti(e)));function Rh(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=e,{isPreviewMode:l}=sh(),u=ca(null),[h,c]=ua((()=>ti(a)?a:""));ha((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var d="surveyQuestion"+s;return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:r,htmlFor:d}),mh("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>{c(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:h})]}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:!h&&!t.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Fh(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=e;return mh(Ms,{children:[mh("div",{className:"question-container",children:mh(Ah,{question:t,forceDisableHtml:r})}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Oh(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=e,l=t.scale,u=10===t.scale?0:1,[h,c]=ua((()=>oi(a)?a:Ur(a)&&a.length>0&&oi(parseInt(a[0]))?parseInt(a[0]):ti(a)&&oi(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=sh(),v=e=>d?s(e):o(e);return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:r}),mh("div",{className:"rating-section",children:[mh("div",{className:"rating-options",children:["emoji"===t.display&&mh("div",{className:"rating-options-emoji",children:(3===t.scale?Dh:Bh).map(((e,r)=>mh("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===h?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;c(e),t.skipSubmitButton&&v(e)},children:e},r)))}),"number"===t.display&&mh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Hh(t.scale).map(((e,r)=>mh(Ph,{displayQuestionIndex:i,active:h===e,appearance:n,num:e,setActiveNumber:e=>{c(e),t.skipSubmitButton&&v(e)}},r)))})]}),mh("div",{className:"rating-text",children:[mh("div",{children:t.lowerBoundLabel}),mh("div",{children:t.upperBoundLabel})]})]})]}),mh(xh,{text:t.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(h)&&!t.optional,appearance:n,onSubmit:()=>o(h),onPreviewSubmit:()=>s(h),skipSubmitButton:t.skipSubmitButton})]})}function Ph(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return mh("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Lh(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=e,u=ca(null),h=da((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=rh(t,th(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[c,d]=ua((()=>((e,t)=>ti(e)||Nh(e)?e:t===xa.SingleChoice?null:[])(l,t.type))),[v,f]=ua((()=>((e,t)=>{if(ti(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Nh(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=sh(),g=t.type===xa.SingleChoice,m=t.type===xa.MultipleChoice,y=t.skipSubmitButton&&g&&!t.hasOpenChoice,b=(e,t)=>{if(t){var i=!v.isSelected;return f((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(g)return d(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(y&&(s(e),p&&a(e)));m&&Ur(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),g&&d(t)},_=e=>{e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!t.optional&&(!!ii(c)||(!(!Ur(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Ur(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return mh(Ms,{children:[mh("div",{className:"question-container",children:[mh(Ah,{question:t,forceDisableHtml:i}),mh("fieldset",{className:"multiple-choice-options limit-height",children:[mh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===e:Ur(c)&&c.includes(e);return mh("label",{className:i?"choice-option-open":"",children:[mh("div",{className:"response-choice",children:[mh("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,i),id:o,"aria-controls":s}),mh("span",{children:i?e+":":e})]}),i&&mh("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:t=>{v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),mh(xh,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Dh=[wh,bh,yh],Bh=[_h,wh,bh,yh,Ch],Zh=[1,2,3,4,5],$h=[1,2,3,4,5,6,7],qh=[0,1,2,3,4,5,6,7,8,9,10];function Hh(e){switch(e){case 5:default:return Zh;case 7:return $h;case 10:return qh}}var Vh=zi,jh=Qi,Yh="ph:show_survey_widget",Gh="PHWidgetSurveyClickListener";function zh(e,t,r){var i,n=e.questions[t],o=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Aa.End:o;if(n.branching.type===Aa.End)return Aa.End;if(n.branching.type===Aa.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Aa.ResponseBased){if(n.type===xa.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Aa.End?Aa.End:o}}else if(n.type===xa.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))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")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Aa.End?Aa.End:o}}return o}return Ra.warn("Falling back to next question index due to unexpected branching type"),o}var Wh=250,Uh=20,Xh=12;class Jh{constructor(e){var t=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePopoverSurvey=e=>{var t;this.B(e.id),this.Z(e);var i=(null==(t=e.appearance)?void 0:t.surveyPopupDelaySeconds)||0,{shadow:n}=Ju(e,this._posthog);if(i<=0)return Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$}),n);var o=setTimeout((()=>{if(this.P.delete(e.id),!uh(e))return this.$(e);Ws(mh(rc,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*i);this.P.set(e.id,o)},this.q=e=>{var{shadow:t,isNewlyCreated:r}=Ju(e,this._posthog);r&&Ws(mh(nc,{posthog:this._posthog,survey:e},e.id),t)},this.H=e=>{this.V(e);var t=this.L.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Gh),this.L.delete(e.id),Ra.info("Removed click listener for survey "+e.id))},this.j=(e,t)=>{var r=jh.querySelector(t),i=this.L.get(e.id);if(r){if(this.q(e),i){if(r===i.element)return;Ra.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.H(e)}if(!r.hasAttribute(Gh)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Ia.NextToTrigger?function(e,t){try{var r=e.getBoundingClientRect(),i=Vh.innerHeight,n=Vh.innerWidth,o=Wh,s=r.left+r.width/2-t/2;s+t>n-Uh&&(s=n-t-Uh),s<Uh&&(s=Uh);var a=Xh,l=i-r.bottom,u=r.top,h=l<o&&u>l;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:zu.zIndex}}catch(e){return Ra.warn("Failed to calculate trigger position:",e),null}}(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||zu.maxWidth)):{};Vh.dispatchEvent(new CustomEvent(Yh,{detail:{surveyId:e.id,position:n}}))};xn(r,"click",n),r.setAttribute(Gh,"true"),this.L.set(e.id,{element:r,listener:n,survey:e}),Ra.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.H(e)},this.renderPopover=e=>{var{shadow:t}=Ju(e,this._posthog);Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$}),t)},this.renderSurvey=(e,t)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this.Y(e),Ws(mh(rc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.G(e)&&t.W(e)&&t.U(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===ka.Popover||e.type===ka.Widget)),i=t.X(r),n=new Set;i.forEach((e=>{if(e.type===ka.Widget){var r,i,o,s;if((null==(r=e.appearance)?void 0:r.widgetType)===Ca.Tab)return void t.q(e);if((null==(i=e.appearance)?void 0:i.widgetType)===Ca.Selector&&null!=(o=e.appearance)&&o.widgetSelector)n.add(e.id),t.j(e,null==(s=e.appearance)?void 0:s.widgetSelector)}ii(t.J)&&e.type===ka.Popover&&t.handlePopoverSurvey(e)})),t.L.forEach((e=>{var{survey:r}=e;n.has(r.id)||t.H(r)}))}),e)},this.Z=e=>{ii(this.J)||Ra.error("Survey "+this.J+" already in focus. Cannot add survey "+e.id+"."),this.J=e.id},this.$=e=>{this.J!==e.id&&Ra.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.B(e.id),this.K(),this.J=null,this.V(e)},this._posthog=e,this.J=null}B(e){var t=this.P.get(e);t&&(clearTimeout(t),this.P.delete(e))}cancelSurvey(e){this.P.has(e)&&(Ra.info("Cancelled pending survey "+e),this.B(e),this.J===e&&(this.J=null))}X(e){return e.sort(((e,t)=>{var r,i,n=vh(e),o=vh(t);if(n&&!o)return-1;if(!n&&o)return 1;var s=e.schedule===Ta.Always,a=t.schedule===Ta.Always;return s&&!a?1:!s&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}Y(e){if(!this.D.has(e.id))try{var t,{params:r,autoSubmit:i}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ei(a)){var l=decodeURIComponent(s),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);t[c]||(t[c]=[]),t[c].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(Vh.location.search);if(0===Object.keys(r).length)return;Ra.info("[Survey Prefill] Detected URL prefill parameters");var n=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],o=Yu(e.id);try{switch(e.type){case xa.SingleChoice:if(!e.choices||0===e.choices.length)return void cn.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=e.choices.length)return void cn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=e.choices[s];break;case xa.MultipleChoice:if(!e.choices||0===e.choices.length)return void cn.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void cn.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&cn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=l;break;case xa.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||u<0||u>h)return void cn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=u;break;default:cn.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){cn.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,r);if(0===Object.keys(n).length)return void Ra.warn("[Survey Prefill] No valid responses after conversion");var o=Ua();ch(e,{surveySubmissionId:o,responses:n,lastQuestionIndex:0}),Ra.info("[Survey Prefill] Stored prefilled responses in localStorage");var s=i&&(null==(t=this._posthog.config.surveys)?void 0:t.autoSubmitIfComplete)&&function(e,t){return e.questions.every((e=>{if(e.optional)return!0;if(e.type===xa.Link||e.type===xa.Open)return!0;if(!e.id)return!1;var r=Yu(e.id);return t.hasOwnProperty(r)}))}(e,n);s&&this.ee(e,n,o),this.D.add(e.id)}catch(e){Ra.error("[Survey Prefill] Error handling URL prefill:",e)}}ee(e,t,r){var i,n,o=null!==(i=null==(n=this._posthog.config.surveys)?void 0:n.autoSubmitDelay)&&void 0!==i?i:800;Ra.info("[Survey Prefill] Auto-submit scheduled"),this.te=setTimeout((()=>{Ra.info("[Survey Prefill] Auto-submitting survey"),Qu({responses:t,survey:e,surveySubmissionId:r,posthog:this._posthog,isSurveyCompleted:!0})}),o)}re(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}G(e){return!e.conditions||uh(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!on)return!1;var n=zl(on);return Zu[lh(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ju||!ju.querySelector(e.conditions.selector))}(e)}ie(e){return nh(e)||this.re(e.internal_targeting_flag_key)||vh(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Fa(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!qa.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.re(e.linked_flag_key,n)?this.re(e.targeting_flag_key)?this.ie(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(Za(e))&&!nh(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}W(e){var t;if(!Oa(e)&&!Pa(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}U(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.re(r)}))}V(e){try{var t=jh.querySelector(ph(e,!0));null!=t&&t.shadowRoot&&Ws(null,t.shadowRoot),null==t||t.remove()}catch(t){Ra.warn("Failed to remove survey "+e.id+" from DOM:",t)}}K(){this.te&&(clearTimeout(this.te),this.te=void 0)}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.J,surveyTimeouts:this.P,handleWidget:this.q,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.j,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.re.bind(this)}}}function Kh(e,t){if(jh&&Vh){var r,i=new Jh(e);if(e.config.disable_surveys_automatic_display)return Ra.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Ra.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ei(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),xn(jh,"visibilitychange",(()=>{jh.hidden?ei(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Qh(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;ha((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,n=t.type===ka.Widget,o=uh(t),s=(null==(e=t.appearance)?void 0:e.widgetType)===Ca.Tab&&n;if(!o)return Ra.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Ra.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};xn(Vh,"popstate",o),xn(Vh,"hashchange",o);var s=Vh.history.pushState,a=Vh.history.replaceState;return Vh.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},Vh.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},()=>{Vh.removeEventListener("popstate",o),Vh.removeEventListener("hashchange",o),Vh.history.pushState=s,Vh.history.replaceState=a}}}),[n,t,r,i])}function ec(e,t,r){if(void 0===t&&(t=Ia.Right),e===ka.ExternalSurvey)return{};switch(t){case Ia.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ia.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ia.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ia.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ia.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ia.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ia.Left:return{left:"30px"};case Ia.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Ia.Right:return{right:e===ka.Widget&&r===Ca.Tab?"60px":"30px"}}}function tc(e){switch(void 0===e&&(e=Sa.Right),e){case Sa.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sa.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sa.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Sa.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function rc(e){var t,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{})}=e,y=ca(null),b=Number.isInteger(d),w=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:C,hidePopupWithViewTransition:I}=function(e,t,r,i,n,o,s){var[a,l]=ua(i||0===r||e.type===ka.ExternalSurvey),[u,h]=ua(!1),c=()=>{var t=()=>{o&&n(e),l(!1)};jh.startViewTransition?jh.startViewTransition((()=>{var e;null==s||null==(e=s.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},d=t=>{t.detail.surveyId===e.id&&c()};return ha((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{uh(e)&&(l(!0),Vh.dispatchEvent(new Event("PHSurveyShown")),t.capture(Ea.SHOWN,{[Ma.SURVEY_NAME]:e.name,[Ma.SURVEY_ID]:e.id,[Ma.SURVEY_ITERATION]:e.current_iteration,[Ma.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(xn(Vh,"PHSurveyClosed",d),xn(Vh,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),Vh.removeEventListener("PHSurveyClosed",d),Vh.removeEventListener("PHSurveySent",n)}}return o(),()=>{Vh.removeEventListener("PHSurveyClosed",d),Vh.removeEventListener("PHSurveySent",n)}}}else Ra.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Qh({survey:e,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,w,b,v,f,y),S=C||d===l.questions.length,k=da((()=>{var e=dh(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{eh(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Ua(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return _?mh(oh.Provider,{value:k,children:mh("div",{className:"ph-survey",style:r({},ec(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?mh(Mh,{header:(null==(o=l.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=l.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||zu,onClose:()=>{I(),m()}}):mh(ic,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function ic(e){var{survey:t,forceDisableHtml:i,posthog:n}=e,[o,s]=ua((()=>{var e=dh(t);return null!=e&&e.responses&&Ra.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:a,onPopupSurveyDismissed:l,isPopup:u,onPreviewSubmit:h,surveySubmissionId:c,isPreviewMode:d}=va(oh),[v,f]=ua((()=>{var e=dh(t);return a||(null==e?void 0:e.lastQuestionIndex)||0})),p=da((()=>ih(t)),[t]);ha((()=>{d&&!ei(a)&&f(a)}),[a,d]);var g=p.at(v);return g?mh("form",{className:"survey-form",name:"surveyForm",children:[u&&mh(Th,{onClick:()=>{l()}}),mh("div",{className:"survey-box",children:oc({question:g,forceDisableHtml:i,displayQuestionIndex:v,appearance:t.appearance||zu,onSubmit:e=>(e=>{var{res:i,displayQuestionIndex:a,questionId:l}=e;if(n)if(l){var u=Yu(l),h=r({},o,{[u]:i});s(h);var d=zh(t,a,i),v=d===Aa.End;v||(f(d),ch(t,{surveySubmissionId:c,responses:h,lastQuestionIndex:d})),(t.enable_partial_responses||v)&&Qu({responses:h,survey:t,surveySubmissionId:c,isSurveyCompleted:v,posthog:n})}else Ra.error("onNextButtonClick called without a questionId.");else Ra.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:v,questionId:g.id}),onPreviewSubmit:h,initialValue:g.id?o[Yu(g.id)]:void 0})})]}):null}function nc(e){var t,r,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=e,[d,v]=ua(!0),[f,p]=ua(!1),[g,m]=ua({}),y=()=>{p(!f)};if(ha((()=>{var e;if(h){if(!c){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&m({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Ra.info("Received show event for feedback button survey "+l.id),m(r.detail.position||{}),y())};return xn(Vh,Yh,t),()=>{Vh.removeEventListener(Yh,t)}}}else Ra.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Qh({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==Ta.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return mh(Ms,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&mh("button",{className:"ph-survey-widget-tab "+((null==(o=l.appearance)?void 0:o.tabPosition)===Sa.Top?"widget-tab-top":""),onClick:y,disabled:c,style:tc(null==(s=l.appearance)?void 0:s.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&mh(rc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var oc=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case xa.Open:return Ts(Rh,r({},u,{question:t,key:t.id}));case xa.Link:return Ts(Fh,r({},u,{question:t,key:t.id}));case xa.Rating:return Ts(Oh,r({},u,{question:t,key:t.id}));case xa.SingleChoice:case xa.MultipleChoice:return Ts(Lh,r({},u,{question:t,key:t.id}));default:return Ra.error("Unsupported question type: "+t.type),null}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.generateSurveys=Kh,sn.extendPostHogWithSurveys=Kh;var sc=dn("[Error tracking]");function ac(){return new Ci([new Li,new Gi,new Bi,new Di,new ji,new Vi,new $i,new Yi],Pi("web:javascript",Ei,Ri))}class lc{constructor(e){var t,r;this.ne=[],this.oe=ac(),this._instance=e,this.ne=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property($n))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],o=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.ne=n,this._instance.persistence&&this._instance.persistence.register({[$n]:this.ne,[qn]:o})}get se(){var e,t=!!this._instance.get_property(qn),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.oe.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ae(t)){if(this.le(t))return void sc.info("Skipping exception capture because a suppression rule matched");if(!this.se&&this.ue(t))return void sc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.he(t))return void sc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}le(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ti(r)&&r.length>0&&e.$exception_types.push(r),ti(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.ne.some((e=>{var r=e.values.map((e=>{var r,i=Zu[e.operator],n=Ur(e.value)?e.value:[e.value],o=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}ue(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}he(e){if(e.length>0){var t,r,i,n,o=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],s=o[o.length-1];return null!==(i=null==s||null==(n=s.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ae(e){return!ni(e)&&Ur(e)}}var uc=dn("[ExceptionAutocapture]"),hc=ac();function cc(e){var{event:t,error:r}=e;return hc.buildFromUnknown(r||t,{mechanism:{handled:!1}})}var dc={wrapOnError:e=>{var t=zi;t||uc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=cc({event:n[0],error:n[4]});return e(s),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=zi;t||uc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,o=cc({event:i});return e(o),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||uc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var o=i.join(" "),s=cc({error:i.find((e=>e instanceof Error)),event:o});return e(s),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.errorWrappingFunctions=dc,sn.posthogErrorWrappingFunctions=dc;var vc=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Ur(e)||e.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}t!==ho&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{};var fc={_patchFetch:(e,r,i)=>Rn(zi,"fetch",(n=>function(){var o=t((function*(t,o){var s=new Request(t,o);return vc(e,r,i,s),n(s)}));return function(e,t){return o.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Rn(zi.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return vc(e,t,r,u),i.call(this,n,u.url,s,a,l)}))};sn.__PosthogExtensions__.tracingHeadersPatchFns=fc,sn.postHogTracingHeadersPatchFns=fc;var pc,gc,mc=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},yc=function(e){if("loading"===document.readyState)return"loading";var t=mc();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"},bc=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},wc=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var i=e,n=i.id?"#"+i.id:bc(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(t||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;e=i.parentNode}}catch(e){}return r},_c=-1,Cc=function(){return _c},Ic=function(e){addEventListener("pageshow",(function(t){t.persisted&&(_c=t.timeStamp,e(t))}),!0)},Sc=function(){var e=mc();return e&&e.activationStart||0},kc=function(e,t){var r=mc(),i="navigate";return Cc()>=0?i="back-forward-cache":r&&(document.prerendering||Sc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.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}},xc=function(e,t,r){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},r||{})),i}}catch(e){}},Ac=function(e,t,r,i){var n,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(n||0))||void 0===n)&&(n=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Tc=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ec=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Mc=function(e){var t=!1;return function(){t||(e(),t=!0)}},Nc=-1,Rc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Fc=function(e){"hidden"===document.visibilityState&&Nc>-1&&(Nc="visibilitychange"===e.type?e.timeStamp:0,Pc())},Oc=function(){addEventListener("visibilitychange",Fc,!0),addEventListener("prerenderingchange",Fc,!0)},Pc=function(){removeEventListener("visibilitychange",Fc,!0),removeEventListener("prerenderingchange",Fc,!0)},Lc=function(){return Nc<0&&(Nc=Rc(),Oc(),Ic((function(){setTimeout((function(){Nc=Rc(),Oc()}),0)}))),{get firstHiddenTime(){return Nc}}},Dc=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Bc=[1800,3e3],Zc=function(e,t){t=t||{},Dc((function(){var r,i=Lc(),n=kc("FCP"),o=xc("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Sc(),0),n.entries.push(e),r(!0)))}))}));o&&(r=Ac(e,n,Bc,t.reportAllChanges),Ic((function(i){n=kc("FCP"),r=Ac(e,n,Bc,t.reportAllChanges),Tc((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},$c=[.1,.25],qc=0,Hc=1/0,Vc=0,jc=function(e){e.forEach((function(e){e.interactionId&&(Hc=Math.min(Hc,e.interactionId),Vc=Math.max(Vc,e.interactionId),qc=Vc?(Vc-Hc)/7+1:0)}))},Yc=function(){return pc?qc:performance.interactionCount||0},Gc=function(){"interactionCount"in performance||pc||(pc=xc("event",jc,{type:"event",buffered:!0,durationThreshold:0}))},zc=[],Wc=new Map,Uc=0,Xc=[],Jc=function(e){if(Xc.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=zc[zc.length-1],r=Wc.get(e.interactionId);if(r||zc.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Wc.set(i.id,i),zc.push(i)}zc.sort((function(e,t){return t.latency-e.latency})),zc.length>10&&zc.splice(10).forEach((function(e){return Wc.delete(e.id)}))}}},Kc=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Mc(e),"hidden"===document.visibilityState?e():(r=t(e),Ec(e)),r},Qc=[200,500],ed=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Dc((function(){var r;Gc();var i,n=kc("INP"),o=function(e){Kc((function(){e.forEach(Jc);var t=function(){var e=Math.min(zc.length-1,Math.floor((Yc()-Uc)/50));return zc[e]}();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,i())}))},s=xc("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});i=Ac(e,n,Qc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ec((function(){o(s.takeRecords()),i(!0)})),Ic((function(){Uc=Yc(),zc.length=0,Wc.clear(),n=kc("INP"),i=Ac(e,n,Qc,t.reportAllChanges)})))})))},td=[],rd=[],id=0,nd=new WeakMap,od=new Map,sd=-1,ad=function(e){td=td.concat(e),ld()},ld=function(){sd<0&&(sd=Kc(ud))},ud=function(){od.size>10&&od.forEach((function(e,t){Wc.has(t)||od.delete(t)}));var e=zc.map((function(e){return nd.get(e.entries[0])})),t=rd.length-50;rd=rd.filter((function(r,i){return i>=t||e.includes(r)}));for(var r=new Set,i=0;i<rd.length;i++){var n=rd[i];hd(n.startTime,n.processingEnd).forEach((function(e){r.add(e)}))}var o=td.length-1-50;td=td.filter((function(e,t){return e.startTime>id&&t>o||r.has(e)})),sd=-1};Xc.push((function(e){e.interactionId&&e.target&&!od.has(e.interactionId)&&od.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;id=Math.max(id,e.processingEnd);for(var i=rd.length-1;i>=0;i--){var n=rd[i];if(Math.abs(r-n.renderTime)<=8){(t=n).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:r,entries:[e]},rd.push(t)),(e.interactionId||"first-input"===e.entryType)&&nd.set(e,t),ld()}));var hd=function(e,t){for(var r,i=[],n=0;r=td[n];n++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},cd=[2500,4e3],dd={},vd={onLCP:function(e,t){!function(e,t){t=t||{},Dc((function(){var r,i=Lc(),n=kc("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Sc(),0),n.entries=[e],r())}))},s=xc("largest-contentful-paint",o);if(s){r=Ac(e,n,cd,t.reportAllChanges);var a=Mc((function(){dd[n.id]||(o(s.takeRecords()),s.disconnect(),dd[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Kc(a)}),{once:!0,capture:!0})})),Ec(a),Ic((function(i){n=kc("LCP"),r=Ac(e,n,cd,t.reportAllChanges),Tc((function(){n.value=performance.now()-i.timeStamp,dd[n.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=mc();if(r){var i=r.activationStart||0,n=e.entries[e.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),l=Math.max(a,o?o.responseEnd-i:0),u=Math.max(l,n.startTime-i);t={element:wc(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(t.url=n.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Zc(Mc((function(){var r,i=kc("CLS",0),n=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,o.push(e)):(n=e.value,o=[e])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=xc("layout-shift",s);a&&(r=Ac(e,i,$c,t.reportAllChanges),Ec((function(){s(a.takeRecords()),r(!0)})),Ic((function(){n=0,i=kc("CLS",0),r=Ac(e,i,$c,t.reportAllChanges),Tc((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var n=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];n&&(r={largestShiftTarget:wc(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:yc(i.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Zc((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:yc(Cc())};if(e.entries.length){var r=mc(),i=e.entries[e.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:yc(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){gc||(gc=xc("long-animation-frame",ad)),ed((function(t){var r=function(e){var t=e.entries[0],r=nd.get(t),i=t.processingStart,n=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=hd(t.startTime,n),a=e.entries.find((function(e){return e.target})),l=a&&a.target||od.get(t.interactionId),u=[t.startTime+t.duration,n].concat(s.map((function(e){return e.startTime+e.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:wc(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:yc(t.startTime)};return Object.assign(e,{attribution:c})}(t);e(r)}),t)}};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.postHogWebVitalsCallbacks=vd,sn.postHogWebVitalsCallbacks=vd;class fd{constructor(e){this.disabled=!1===e;var t=Kr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var pd=dn("[AutoCapture]");function gd(e,t){return t.length>e?t.slice(0,e)+"...":t}function md(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!fo(t));return t}function yd(e,t,r,i){var n=e.tagName.toLowerCase(),o={tag_name:n};So.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=gd(1024,Vo(e)):o.$el_text=gd(1024,Co(e)));var s=wo(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),pn(e.attributes,(function(r){var n;if((!Po(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&Ho(r.value)&&(n=r.name,!ti(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=yo(s).join(" ")),o["attr__"+r.name]=gd(1024,s)}}));for(var a=1,l=1,u=e;u=md(u);)a++,u.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function bd(e,t){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],h=e;h.parentNode&&!po(h,"body");)mo(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(pn(u,(e=>{var t=Oo(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=t&&f&&Ho(f)&&f),Hr(wo(e),"ph-no-capture")&&(p=!0),d.push(yd(e,o,s,a));var r=function(e){if(!Oo(e))return{};var t={};return pn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&Ho(i)&&(t[r]=i)}})),t}(e);gn(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?d[0].$el_text=Vo(e):d[0].$el_text=Co(e)),f){var g,m;d[0].attr__href=f;var y=null==(g=An(f))?void 0:g.host,b=null==zi||null==(m=zi.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:gn({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Yo(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class wd{constructor(e){this.ce=!1,this.de=null,this.ve=!1,this.instance=e,this.rageclicks=new fd(e.config.rageclick),this.fe=null}get pe(){var e,t,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}ge(){if(this.isBrowserSupported()){if(zi&&Qi){var e=e=>{e=e||(null==zi?void 0:zi.event);try{this.me(e)}catch(e){pd.error("Failed to capture event",e)}};if(xn(Qi,"submit",e,{capture:!0}),xn(Qi,"change",e,{capture:!0}),xn(Qi,"click",e,{capture:!0}),this.pe.capture_copied_text){var t=e=>{e=e||(null==zi?void 0:zi.event),this.me(e,Wl)};xn(Qi,"copy",t,{capture:!0}),xn(Qi,"cut",t,{capture:!0})}}}else pd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ce&&(this.ge(),this.ce=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.ve=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Dn]:!!e.autocapture_opt_out}),this.de=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.fe=e}getElementSelectors(e){var t,r=[];return null==(t=this.fe)||t.forEach((t=>{var i=null==Qi?void 0:Qi.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Dn],i=this.de;if(ii(i)&&!si(r)&&!this.instance.ye())return!1;var n=null!==(t=this.de)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}me(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Io(e);if(go(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Mo(i,this.instance.config.rageclick)&&this.me(e,"$rageclick");var n=t===Wl;if(i&&Fo(i,e,this.pe,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=bd(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.pe.element_attribute_ignorelist,elementsChainAsString:this.ve});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),t===Wl){var l,u=_o(null==zi||null==(l=zi.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Xr(null==Qi?void 0:Qi.querySelectorAll)}}var _d={};function Cd(e){return function(e,t){var r=_d[e];if(r)return r;var i=t[e];if(Jr(i)&&!an())return _d[e]=i.bind(t);var n=t.document;if(n&&Xr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(i=s[e]),n.head.removeChild(o)}catch(t){cn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Xr(i)?_d[e]=i.bind(t):i}("MutationObserver",e)}function Id(e,t){return oi(e)&&e>=t}class Sd{be(e){var t,r,i,n,o,s=this.we((null==e?void 0:e.__onCapture)||this._e.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(e,t){this.Ce=[],this.we=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.Ie=e=>{var t=function(e){var t=Io(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ii(t)||this.Se(t)||this.Ce.push(t),this.Ce.length&&ei(this.ke)&&(this.ke=sn.setTimeout((()=>{this.xe()}),1e3))},this.Ae=()=>{var e=Date.now();e%50==0&&this.Ce.forEach((t=>{ei(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Te=()=>{this.Ee=Date.now()},this.instance=e,this.pe=this.be(t),this._onCapture=this.pe.__onCapture}start(e){this.Me(),this.Ne(),this.Re(),this.Fe(e)}Fe(e){if(!this.Oe){var t=Cd(sn);this.Oe=new t((e=>{this.Pe(e)})),this.Oe.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Oe)||e.disconnect(),this.Oe=void 0,sn.removeEventListener("click",this.Ie),sn.removeEventListener("scroll",this.Ae,{capture:!0}),sn.removeEventListener("selectionchange",this.Te)}Pe(e){this.Le=Date.now()}Me(){xn(sn,"click",this.Ie)}Ne(){xn(sn,"scroll",this.Ae,{capture:!0})}Re(){xn(sn,"selectionchange",this.Te)}Se(e){if(!e)return!0;if(!this.pe.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(vo(e.node))return!0;var r=this.Ce.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!po(e.node,"html")&&fo(e.node)&&!So.includes(e.node.tagName.toLowerCase()))}xe(){if(this.Ce.length){clearTimeout(this.ke),this.ke=void 0;var e=this.Ce;for(var t of(this.Ce=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Le&&t.timestamp<=this.Le?this.Le-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ee&&t.timestamp<=this.Ee?this.Ee-t.timestamp:void 0;var i=Id(t.scrollDelayMs,this.pe.scroll_threshold_ms),n=Id(t.selectionChangedDelayMs,this.pe.selection_change_threshold_ms),o=Id(t.mutationDelayMs,this.pe.mutation_threshold_ms),s=Id(t.absoluteDelayMs,1.1*this.pe.mutation_threshold_ms),a=oi(t.scrollDelayMs)&&t.scrollDelayMs<this.pe.scroll_threshold_ms,l=oi(t.mutationDelayMs)&&t.mutationDelayMs<this.pe.mutation_threshold_ms,u=oi(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.pe.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Le,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):t.absoluteDelayMs<this.pe.mutation_threshold_ms&&this.Ce.push(t))}this.Ce.length&&ei(this.ke)&&(this.ke=sn.setTimeout((()=>{this.xe()}),1e3))}}_e(e,t){this.instance.capture("$dead_click",r({},t,bd(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.pe.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)})}}sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Sd(e,t);var kd=dn("[ExternalScriptsLoader]"),xd=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return kd.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Qi?void 0:Qi.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Qi)return r("document not found");var i=Qi.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Qi.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Qi.body.appendChild(i)};null!=Qi&&Qi.body?a():null==Qi||Qi.addEventListener("DOMContentLoaded",a)};sn.__PosthogExtensions__=sn.__PosthogExtensions__||{},sn.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{var i="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(i="/array/"+e.config.token+"/config.js"),"toolbar"===t){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=e.requestRouter.endpointFor("assets",i);xd(e,o,r)},sn.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);xd(e,i,r)};var Ad="";var Td=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ed(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Qi),Ad)return Ad;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Ua();!Ad&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";t.cookie=s+";max-age=3",t.cookie.includes(n)&&(t.cookie=s+";max-age=0",Ad=o)}return Ad}(e);if(!r){var i=(e=>{var t=e.match(Td);return t?t[0]:""})(e);i!==r&&cn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Md={De:()=>!!Qi,Be:function(e){cn.error("cookieStore error: "+e)},Ze:function(e){if(Qi){try{for(var t=e+"=",r=Qi.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},$e:function(e){var t;try{t=JSON.parse(Md.Ze(e))||{}}catch(e){}return t},qe:function(e,t,r,i,n){if(Qi)try{var o="",s="",a=Ed(Qi.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}n&&(s="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&cn.warn("cookieStore warning: large cookie, len="+u.length),Qi.cookie=u,u}catch(e){return}},He:function(e,t){if(null!=Qi&&Qi.cookie)try{Md.qe(e,"",-1,t)}catch(e){return}}},Nd=null,Rd={De:function(){if(!ii(Nd))return Nd;var e=!0;if(ei(zi))e=!1;else try{var t="__mplssupport__";Rd.qe(t,"xyz"),'"xyz"'!==Rd.Ze(t)&&(e=!1),Rd.He(t)}catch(t){e=!1}return e||cn.error("localStorage unsupported; falling back to cookie store"),Nd=e,e},Be:function(e){cn.error("localStorage error: "+e)},Ze:function(e){try{return null==zi?void 0:zi.localStorage.getItem(e)}catch(e){Rd.Be(e)}return null},$e:function(e){try{return JSON.parse(Rd.Ze(e))||{}}catch(e){}return null},qe:function(e,t){try{null==zi||zi.localStorage.setItem(e,JSON.stringify(t))}catch(e){Rd.Be(e)}},He:function(e){try{null==zi||zi.localStorage.removeItem(e)}catch(e){Rd.Be(e)}}},Fd=["distinct_id",Gn,zn,lo,ao],Od=r({},Rd,{$e:function(e){try{var t={};try{t=Md.$e(e)||{}}catch(e){}var r=gn(t,JSON.parse(Rd.Ze(e)||"{}"));return Rd.qe(e,r),r}catch(e){}return null},qe:function(e,t,r,i,n,o){try{Rd.qe(e,t,void 0,void 0,o);var s={};Fd.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Md.qe(e,s,r,i,n,o)}catch(e){Rd.Be(e)}},He:function(e,t){try{null==zi||zi.localStorage.removeItem(e),Md.He(e,t)}catch(e){Rd.Be(e)}}}),Pd={},Ld={De:function(){return!0},Be:function(e){cn.error("memoryStorage error: "+e)},Ze:function(e){return Pd[e]||null},$e:function(e){return Pd[e]||null},qe:function(e,t){Pd[e]=t},He:function(e){delete Pd[e]}},Dd=null,Bd={De:function(){if(!ii(Dd))return Dd;if(Dd=!0,ei(zi))Dd=!1;else try{var e="__support__";Bd.qe(e,"xyz"),'"xyz"'!==Bd.Ze(e)&&(Dd=!1),Bd.He(e)}catch(e){Dd=!1}return Dd},Be:function(e){cn.error("sessionStorage error: ",e)},Ze:function(e){try{return null==zi?void 0:zi.sessionStorage.getItem(e)}catch(e){Bd.Be(e)}return null},$e:function(e){try{return JSON.parse(Bd.Ze(e))||null}catch(e){}return null},qe:function(e,t){try{null==zi||zi.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Bd.Be(e)}},He:function(e){try{null==zi||zi.sessionStorage.removeItem(e)}catch(e){Bd.Be(e)}}},Zd=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class $d{constructor(e){this._instance=e}get pe(){return this._instance.config}get consent(){return this.Ve()?Zd.DENIED:this.je}isOptedOut(){return"always"===this.pe.cookieless_mode||(this.consent===Zd.DENIED||this.consent===Zd.PENDING&&(this.pe.opt_out_capturing_by_default||"on_reject"===this.pe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Zd.DENIED}optInOut(e){this.Ye.qe(this.Ge,e?1:0,this.pe.cookie_expiration,this.pe.cross_subdomain_cookie,this.pe.secure_cookie)}reset(){this.Ye.He(this.Ge,this.pe.cross_subdomain_cookie)}get Ge(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get je(){var e=this.Ye.Ze(this.Ge);return vi(e)?Zd.GRANTED:Hr(fi,e)?Zd.DENIED:Zd.PENDING}get Ye(){if(!this.ze){var e=this.pe.opt_out_capturing_persistence_type;this.ze="localStorage"===e?Rd:Md;var t="localStorage"===e?Md:Rd;t.Ze(this.Ge)&&(this.ze.Ze(this.Ge)||this.optInOut(vi(t.Ze(this.Ge))),t.He(this.Ge,this.pe.cross_subdomain_cookie))}return this.ze}Ve(){return!!this.pe.respect_dnt&&!!kn([null==Ki?void 0:Ki.doNotTrack,null==Ki?void 0:Ki.msDoNotTrack,sn.doNotTrack],(e=>vi(e)))}}var qd=dn("[Dead Clicks]"),Hd=()=>!0,Vd=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Vn)),i=e.instance.config.capture_dead_clicks;return si(i)?i:!!Kr(i)||r};class jd{get lazyLoadedDeadClicksAutocapture(){return this.We}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Vn]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Ue((()=>{this.Xe()}))}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?qd.error("failed to load script",t):e()}))}Xe(){var e;if(Qi){if(!this.We&&null!=(e=sn.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.We=sn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.We.start(Qi),qd.info("starting...")}}else qd.error("`document` not found. Cannot start.")}stop(){this.We&&(this.We.stop(),this.We=void 0,qd.info("stopping..."))}}var Yd=dn("[ExceptionAutocapture]");class Gd{constructor(e){var t,r,i;this.Je=()=>{var e;if(zi&&this.isEnabled&&null!=(e=sn.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=sn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=sn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=sn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ke&&this.pe.capture_unhandled_errors&&(this.Ke=t(this.captureException.bind(this))),!this.Qe&&this.pe.capture_unhandled_rejections&&(this.Qe=r(this.captureException.bind(this))),!this.et&&this.pe.capture_console_errors&&(this.et=i(this.captureException.bind(this)))}catch(e){Yd.error("failed to start",e),this.tt()}}},this._instance=e,this.rt=!(null==(t=this._instance.persistence)||!t.props[Zn]),this.pe=this.it(),this.nt=new gi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,C:Yd}),this.startIfEnabled()}it(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(e)?t=r({},t,e):(ei(e)?this.rt:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.pe.capture_console_errors||this.pe.capture_unhandled_errors||this.pe.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Yd.info("enabled"),this.Ue(this.Je))}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Yd.error("failed to load script",t);e()}))}tt(){var e,t,r;null==(e=this.Ke)||e.call(this),this.Ke=void 0,null==(t=this.Qe)||t.call(this),this.Qe=void 0,null==(r=this.et)||r.call(this),this.et=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.rt=!!t||!1,this.pe=this.it(),this._instance.persistence&&this._instance.persistence.register({[Zn]:this.rt}),this.startIfEnabled()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.nt.consumeRateLimit(i)?Yd.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class zd{constructor(e){var t;this._instance=e,this.ot=(null==zi||null==(t=zi.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.st&&this.st(),this.st=void 0,cn.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(zi&&zi.history){var r=this;null!=(e=zi.history.pushState)&&e.__posthog_wrapped__||Rn(zi.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r.lt("pushState")})),null!=(t=zi.history.replaceState)&&t.__posthog_wrapped__||Rn(zi.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r.lt("replaceState")})),this.ut()}}lt(e){try{var t,r=null==zi||null==(t=zi.location)?void 0:t.pathname;if(!r)return;r!==this.ot&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ot=r}catch(t){cn.error("Error capturing "+e+" pageview",t)}}ut(){if(!this.st){var e=()=>{this.lt("popstate")};xn(zi,"popstate",e),this.st=()=>{zi&&zi.removeEventListener("popstate",e)}}}}var Wd=dn("[SegmentIntegration]");function Ud(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Ua();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(ro,"identified")),t()},n=r.user();"then"in n&&Xr(n.then)?n.then((e=>i(e))):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Wd.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Wd.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Wd.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);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()}))}))}var Xd="posthog-js";function Jd(e,t){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,c,d;if(!("*"===s||s.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=t.exception)?void 0:l.values)||[],p=f.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||t.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:t.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(g),t}}class Kd{constructor(e,t,r,i,n,o){this.name=Xd,this.setupOnce=function(s){s(Jd(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var Qd=null!=zi&&zi.location?Nn(zi.location.hash,"__posthog")||Nn(location.hash,"state"):null,ev="_postHogToolbarParams",tv=dn("[Toolbar]"),rv=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(rv||{});class iv{constructor(e){this.instance=e}ht(e){sn.ph_toolbar_state=e}ct(){var e;return null!==(e=sn.ph_toolbar_state)&&void 0!==e?e:rv.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),!zi||!Qi)return!1;e=null!=e?e:zi.location,r=null!=r?r:zi.history;try{if(!t){try{zi.localStorage.setItem("test","test"),zi.localStorage.removeItem("test")}catch(e){return!1}t=null==zi?void 0:zi.localStorage}var i,n=Qd||Nn(e.hash,"__posthog")||Nn(e.hash,"state"),o=n?bn((()=>JSON.parse(atob(decodeURIComponent(n)))))||bn((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(ev)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}dt(e){var t=sn.ph_load_toolbar||sn.ph_load_editor;!ni(t)&&Xr(t)?t(e,this.instance):tv.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Qi||!Qi.getElementById(uo));if(!zi||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(zi.localStorage.setItem(ev,JSON.stringify(r({},n,{source:void 0}))),this.ct()===rv.LOADED)this.dt(n);else if(this.ct()===rv.UNINITIALIZED){var o;this.ht(rv.LOADING),null==(o=sn.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return tv.error("[Toolbar] Failed to load",e),void this.ht(rv.UNINITIALIZED);this.ht(rv.LOADED),this.dt(n)})),xn(zi,"turbolinks:load",(()=>{this.ht(rv.UNINITIALIZED),this.loadToolbar(n)}))}return!0}vt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}var nv=dn("[TracingHeaders]");class ov{constructor(e){this.ft=void 0,this.gt=void 0,this.Je=()=>{var e,t;ei(this.ft)&&(null==(e=sn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ei(this.gt)&&(null==(t=sn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return nv.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.Ue(this.Je):(null==(e=this.ft)||e.call(this),null==(t=this.gt)||t.call(this),this.ft=void 0,this.gt=void 0)}}var sv="https?://(.*)",av=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lv=mn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],av),uv="<masked>",hv=["li_fat_id"];function cv(e,t,r){if(!Qi)return{};var i,n=t?mn([],av,r||[]):[],o=dv(Mn(Qi.URL,n,uv),e),s=(i={},pn(hv,(function(e){var t=Md.Ze(e);i[e]=t||null})),i);return gn(s,o)}function dv(e,t){var r=lv.concat(t||[]),i={};return pn(r,(function(t){var r=En(e,t);i[t]=r||null})),i}function vv(e){var t=function(e){return e?0===e.search(sv+"google.([^/?]*)")?"google":0===e.search(sv+"bing.com")?"bing":0===e.search(sv+"yahoo.com")?"yahoo":0===e.search(sv+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!ii(t)){i.$search_engine=t;var n=Qi?En(Qi.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function fv(){return navigator.language||navigator.userLanguage}function pv(){return(null==Qi?void 0:Qi.referrer)||"$direct"}function gv(e,t){var r=e?mn([],av,t||[]):[],i=null==en?void 0:en.href.substring(0,1e3);return{r:pv().substring(0,1e3),u:i?Mn(i,r,uv):void 0}}function mv(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=An(r))?void 0:t.host};if(i){n.$current_url=i;var o=An(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=dv(i);gn(n,s)}if(r){var a=vv(r);gn(n,a)}return n}function yv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function bv(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function wv(e,t){if(!on)return{};var r,i=e?mn([],av,t||[]):[],[n,o]=function(e){for(var t=0;t<Yl.length;t++){var[r,i]=Yl[t],n=r.exec(e),o=n&&(Xr(i)?i(n,e):i);if(o)return o}return["",""]}(on);return gn(_n({$os:n,$os_version:o,$browser:Hl(on,navigator.vendor),$device:Gl(on),$device_type:zl(on),$timezone:yv(),$timezone_offset:bv()}),{$current_url:Mn(null==en?void 0:en.href,i,uv),$host:null==en?void 0:en.host,$pathname:null==en?void 0:en.pathname,$raw_user_agent:on.length>1e3?on.substring(0,997)+"...":on,$browser_version:jl(on,navigator.vendor),$browser_language:fv(),$browser_language_prefix:(r=fv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==zi?void 0:zi.screen.height,$screen_width:null==zi?void 0:zi.screen.width,$viewport_height:null==zi?void 0:zi.innerHeight,$viewport_width:null==zi?void 0:zi.innerWidth,$lib:"web",$lib_version:un.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var _v=dn("[Web Vitals]"),Cv=9e5;class Iv{constructor(e){var t;this.yt=!1,this.ce=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.bt=()=>{clearTimeout(this.wt),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._t=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ei(i))_v.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Ct();if(!ei(n))if(ni(null==e?void 0:e.name)||ni(null==e?void 0:e.value))_v.error("Invalid metric received",e);else if(this.It&&e.value>=this.It)_v.error("Ignoring metric with value >= "+this.It,e);else this.F.url!==n&&(this.bt(),this.wt=setTimeout(this.bt,this.flushToCaptureTimeoutMs)),ei(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=ei(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.F.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.bt()}},this.Je=()=>{var e,t,r,i,n=sn.__PosthogExtensions__;ei(n)||ei(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._t.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._t.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._t.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._t.bind(this)),this.ce=!0):_v.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.yt=!(null==(t=this._instance.persistence)||!t.props[Hn]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=Kr(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(r)?(null==(t=this._instance.persistence)?void 0:t.props[jn])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get It(){var e=Kr(this._instance.config.capture_performance)&&oi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Cv;return 0<e&&e<=6e4?Cv:e}get isEnabled(){var e=null==en?void 0:en.protocol;if("http:"!==e&&"https:"!==e)return _v.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:si(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return si(t)?t:this.yt}startIfEnabled(){this.isEnabled&&!this.ce&&(_v.info("enabled, starting..."),this.Ue(this.Je))}onRemoteConfig(e){var t=Kr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Kr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Hn]:t}),this._instance.persistence.register({[jn]:r})),this.yt=t,this.startIfEnabled()}Ue(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(t=>{t?_v.error("failed to load script",t):e()}))}Ct(){var e=zi?zi.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?mn([],av,r||[]):[];return Mn(e,i,uv)}_v.error("Could not determine current URL")}}var Sv=dn("[Heatmaps]");function kv(e){return Kr(e)&&"clientX"in e&&"clientY"in e&&oi(e.clientX)&&oi(e.clientY)}class xv{constructor(e){var t;this.yt=!1,this.ce=!1,this.St=null,this.instance=e,this.yt=!(null==(t=this.instance.persistence)||!t.props[Bn]),this.rageclicks=new fd(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Kr(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 ei(this.instance.config.capture_heatmaps)?ei(this.instance.config.enable_heatmaps)?this.yt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ce)return;Sv.info("starting..."),this.kt(),this.xt()}else{var e;clearInterval(null!==(e=this.St)&&void 0!==e?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bn]:t}),this.yt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.F;return this.F=void 0,e}Tt(e){this.Ie(e.originalEvent,"deadclick")}xt(){this.St&&clearInterval(this.St),this.St=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Qi)?setInterval(this.Et.bind(this),this.flushIntervalMilliseconds):null}kt(){zi&&Qi&&(this.Mt=this.Et.bind(this),xn(zi,"beforeunload",this.Mt),this.Nt=e=>this.Ie(e||(null==zi?void 0:zi.event)),xn(Qi,"click",this.Nt,{capture:!0}),this.Rt=e=>this.Ft(e||(null==zi?void 0:zi.event)),xn(Qi,"mousemove",this.Rt,{capture:!0}),this.Ot=new jd(this.instance,Hd,this.Tt.bind(this)),this.Ot.startIfEnabled(),this.Pt=this.xt.bind(this),xn(Qi,"visibilitychange",this.Pt),this.ce=!0)}At(){var e;zi&&Qi&&(this.Mt&&zi.removeEventListener("beforeunload",this.Mt),this.Nt&&Qi.removeEventListener("click",this.Nt,{capture:!0}),this.Rt&&Qi.removeEventListener("mousemove",this.Rt,{capture:!0}),this.Pt&&Qi.removeEventListener("visibilitychange",this.Pt),clearTimeout(this.Lt),null==(e=this.Ot)||e.stop(),this.ce=!1)}Dt(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var i=e;i&&fo(i)&&!po(i,"body");){if(i===r)return!1;if(Hr(t,null==zi?void 0:zi.getComputedStyle(i).position))return!0;i=xo(i)}return!1}(Io(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Ie(e,t){var i;if(void 0===t&&(t="click"),!vo(e.target)&&kv(e)){var n=this.Dt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Bt(r({},n,{type:"rageclick"})),this.Bt(n)}}Ft(e){!vo(e.target)&&kv(e)&&(clearTimeout(this.Lt),this.Lt=setTimeout((()=>{this.Bt(this.Dt(e,"mousemove"))}),500))}Bt(e){if(zi){var t=zi.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?mn([],av,i||[]):[],o=Mn(t,n,uv);this.F=this.F||{},this.F[o]||(this.F[o]=[]),this.F[o].push(e)}}Et(){this.F&&!Qr(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Av{constructor(e){this._instance=e}doPageView(e,t){var r,i=this.Zt(e,t);return this.$t={pathname:null!==(r=null==zi?void 0:zi.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.Zt(e,null==(t=this.$t)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.$t)?void 0:e.pageViewId}}Zt(e,t){var r=this.$t;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(ei(o)||ei(s)||ei(a)||ei(l)||ei(u)||ei(h))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=o<=1?1:pi(s/o,0,1,cn),d=o<=1?1:pi(a/o,0,1,cn),v=l<=1?1:pi(u/l,0,1,cn),f=l<=1?1:pi(h/l,0,1,cn);i=gn(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Tv=dn("[FeatureFlags]"),Ev=dn("[FeatureFlags]",{debugEnabled:!0}),Mv="$active_feature_flags",Nv="$override_feature_flags",Rv="$feature_flag_payloads",Fv="$override_feature_flag_payloads",Ov="$feature_flag_request_id",Pv="$feature_flag_evaluated_at",Lv=e=>{var t={};for(var[r,i]of yn(e||{}))i&&(t[r]=i);return t},Dv=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):Tv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Bv=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Zv{constructor(e){this.qt=!1,this.Ht=!1,this.Vt=!1,this.jt=!1,this.Yt=!1,this.Gt=!1,this.zt=!1,this._instance=e,this.featureFlagEventHandlers=[]}Wt(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Tv.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t})):[]}Ut(){return this.Wt().length>0}flags(){if(this._instance.config.__preview_remote_config)this.Gt=!0;else{var e=!this.Xt&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Jt({disableFlags:e})}}get hasLoadedFlags(){return this.Ht}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Xn),t=this._instance.get_property(Nv),i=this._instance.get_property(Fv);if(!i&&!t)return e||{};var n=gn({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var s of o){var a,l,u=n[s],h=null==t?void 0:t[s],c=ei(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=ei(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[s],f=r({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});if(c!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v)f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[s]=f}return this.qt||(Tv.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.qt=!0),n}getFlagVariants(){var e=this._instance.get_property(Wn),t=this._instance.get_property(Nv);if(!t)return e||{};for(var r=gn({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this.qt||(Tv.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.qt=!0),r}getFlagPayloads(){var e=this._instance.get_property(Rv),t=this._instance.get_property(Fv);if(!t)return e||{};for(var r=gn({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this.qt||(Tv.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.qt=!0),r}reloadFeatureFlags(){this.jt||this._instance.config.advanced_disable_feature_flags||this.Xt||(this.Xt=setTimeout((()=>{this.Jt()}),5))}Kt(){clearTimeout(this.Xt),this.Xt=void 0}ensureFlagsLoaded(){this.Ht||this.Vt||this.Xt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.jt=e}Jt(e){var t;if(this.Kt(),!this._instance.ye())if(this.Vt)this.Yt=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Jn)||{}),group_properties:this._instance.get_property(Kn)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.Ut()&&(i.evaluation_environments=this.Wt());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);n&&(i.timezone=yv()),this.Vt=!0,this._instance.Qt({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,n=!0;(200===e.statusCode&&(this.Yt||(this.$anon_distinct_id=void 0),n=!1),this.Vt=!1,this.Gt)||(this.Gt=!0,this._instance.er(null!==(r=e.json)&&void 0!==r?r:{}));if(!i.disable_flags||this.Yt)if(this.zt=!n,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Bv.FeatureFlags))Tv.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var o;if(!i.disable_flags)this.receivedFeatureFlags(null!==(o=e.json)&&void 0!==o?o:{},n);this.Yt&&(this.Yt=!1,this.Jt())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.Ht||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,n=this._instance.get_property(Ov)||void 0,o=this._instance.get_property(Pv)||void 0,s=this._instance.get_property(to)||{};if((t.send_event||!("send_event"in t))&&(!(e in s)||!s[e].includes(i))){var a,l,u,h,c,d,v,f,p;Ur(s[e])?s[e].push(i):s[e]=[i],null==(a=this._instance.persistence)||a.register({[to]:s});var g=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:o,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.zt};ei(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),ei(null==g?void 0:g.original_variant)&&ei(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ei(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return r}Tv.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Ut()&&(i.evaluation_environments=this.Wt()),this._instance.Qt({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.Ht||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ei(r)?void 0:!!r}Tv.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){this.Ht=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=Dv(e),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var h=e.requestId,c=e.evaluatedAt;if(Ur(l)){Tv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;v<l.length;v++)d[l[v]]=!0;t&&t.register({[Mv]:l,[Wn]:d})}else{var f=l,p=u,g=a;e.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),t&&t.register(r({[Mv]:Object.keys(Lv(f)),[Wn]:f||{},[Rv]:p||{},[Xn]:g||{}},h?{[Ov]:h}:{},c?{[Pv]:c}:{}))}}}(e,this._instance.persistence,i,n,o),this.tr(t)}}override(e,t){void 0===t&&(t=!1),Tv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Tv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Nv),this._instance.persistence.unregister(Fv),this.tr(),Ev.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this.qt=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Nv),Ev.info("Flag overrides cleared");else if(r.flags){if(Ur(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Nv]:i})}else this._instance.persistence.register({[Nv]:r.flags});Ev.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Fv),Ev.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Fv]:r.payloads}),Ev.info("Payload overrides set",{payloads:r.payloads}))),void this.tr()}this.tr()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ht){var{flags:t,flagVariants:r}=this.rr();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,o=(this._instance.get_property(Un)||[]).find((t=>t.flagKey===e)),s={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this._instance.persistence)||n.register({[Mv]:Object.keys(Lv(l)),[Wn]:l}),this.tr()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Un),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Un),null==(i=this._instance.persistence)||i.register({[Un]:n}),e(n)}}})}rr(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}tr(e){var{flags:t,flagVariants:r}=this.rr();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Jn)||{};this._instance.register({[Jn]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Jn)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Kn)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Kn]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Kn)||{};this._instance.register({[Kn]:r({},t,{[e]:{}})})}else this._instance.unregister(Kn)}reset(){this.Ht=!1,this.Vt=!1,this.jt=!1,this.Yt=!1,this.Gt=!1,this.zt=!1,this.$anon_distinct_id=void 0,this.Kt(),this.qt=!1}}var $v=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class qv{constructor(e,t){this.pe=e,this.props={},this.ir=!1,this.nr=(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.Ye=this.sr(e),this.load(),e.debug&&cn.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.ar}sr(e){-1===$v.indexOf(e.persistence.toLowerCase())&&(cn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Rd.De()?Rd:"localstorage+cookie"===t&&Od.De()?Od:"sessionstorage"===t&&Bd.De()?Bd:"memory"===t?Ld:"cookie"===t?Md:Od.De()?Od:Md}properties(){var e={};return pn(this.props,(function(t,r){if(r===Wn&&Kr(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else s=r,a=!1,(ii(o=co)?a:Ji&&o.indexOf===Ji?-1!=o.indexOf(s):(pn(o,(function(e){if(a||(a=e===s))return vn})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.ar){var e=this.Ye.$e(this.nr);e&&(this.props=gn({},e))}}save(){this.ar||this.Ye.qe(this.nr,this.props,this.lr,this.ur,this.hr,this.pe.debug)}remove(){this.Ye.He(this.nr,!1),this.Ye.He(this.nr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Kr(e)){ei(t)&&(t="None"),this.lr=ei(r)?this.cr:r;var i=!1;if(pn(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Kr(e)){this.lr=ei(t)?this.cr:t;var r=!1;if(pn(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.ir){var e=cv(this.pe.custom_campaign_params,this.pe.mask_personal_data_properties,this.pe.custom_personal_data_properties);Qr(_n(e))||this.register(e),this.ir=!0}}update_search_keyword(){var e;this.register((e=null==Qi?void 0:Qi.referrer)?vv(e):{})}update_referrer_info(){var e;this.register_once({$referrer:pv(),$referring_domain:null!=Qi&&Qi.referrer&&(null==(e=An(Qi.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[so]||this.register_once({[ao]:gv(this.pe.mask_personal_data_properties,this.pe.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pn([so,oo],(t=>{var r=this.props[t];r&&pn(r,(function(t,r){e["$initial_"+jr(r)]=t}))}));var t,r,i=this.props[ao];if(i){var n=(t=mv(i),r={},pn(t,(function(e,t){r["$initial_"+jr(t)]=e})),r);gn(e,n)}return e}safe_merge(e){return pn(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this.cr=this.lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.sr(e),n=this.props;this.clear(),this.Ye=i,this.props=n,this.save()}}set_disabled(e){this.ar=e,this.ar?this.remove():this.save()}set_cross_subdomain(e){e!==this.ur&&(this.ur=e,this.remove(),this.save())}set_secure(e){e!==this.hr&&(this.hr=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ln]||{};r[e]=t,this.props[Ln]=r,this.save()}remove_event_timer(e){var t=(this.props[Ln]||{})[e];return ei(t)||(delete this.props[Ln][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Hv{constructor(){this.dr={},this.dr={}}on(e,t){return this.dr[e]||(this.dr[e]=[]),this.dr[e].push(t),()=>{this.dr[e]=this.dr[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.dr[e]||[])r(t);for(var i of this.dr["*"]||[])i(e,t)}}function Vv(e,t,r){if(ni(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class jv{constructor(e){this.vr=new Hv,this.pr=(e,t)=>this.gr(e,t)&&this.mr(e,t)&&this.yr(e,t)&&this.br(e,t),this.gr=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.wr=new Set,this._r=new Set}init(){var e;if(!ei(null==(e=this._instance)?void 0:e.Cr)){var t;null==(t=this._instance)||t.Cr(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ei(null==(t=this._instance)?void 0:t.Cr)&&(e.forEach((e=>{var t,r;null==(t=this._r)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.wr)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.wr.has(e)||this.wr.has(null==t?void 0:t.event))&&this._r&&(null==(r=this._r)?void 0:r.size)>0&&this._r.forEach((e=>{this.Ir(t,e)&&this.vr.emit("actionCaptured",e.name)}))}Sr(e){this.onAction("actionCaptured",(t=>e(t)))}Ir(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.pr(e,r))return!0;return!1}onAction(e,t){return this.vr.on(e,t)}mr(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Vv(i,t.url,t.url_matching||"contains"))return!1}return!0}yr(e,t){return!!this.kr(e,t)&&(!!this.Ar(e,t)&&!!this.Tr(e,t))}kr(e,t){var r;if(null==t||!t.href)return!0;var i=this.Er(e);if(i.length>0)return i.some((e=>Vv(e.href,t.href,t.href_matching||"exact")));var n,o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!o&&Vv((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}Ar(e,t){var r;if(null==t||!t.text)return!0;var i=this.Er(e);if(i.length>0)return i.some((e=>Vv(e.text,t.text,t.text_matching||"exact")||Vv(e.$el_text,t.text,t.text_matching||"exact")));var n,o,s,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!ni(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),o=t.text,s=t.text_matching||"exact",n.some((e=>Vv(e,o,s))))}Tr(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var o=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch(e){return!1}return!1}Er(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}br(e,t){return null==t||!t.properties||0===t.properties.length||qu(t.properties.reduce(((e,t)=>{var r=Ur(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class Yv{constructor(e){this._instance=e,this.Mr=new Map,this.Nr=new Map,this.Rr=new Map}Fr(e,t){return!!e&&qu(e.propertyFilters,null==t?void 0:t.properties)}Or(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}Pr(e,t,r){var i,n=(r===_a.Activation?this.Mr:this.Nr).get(e),o=[];return null==(i=this._instance)||i.getSurveys((e=>{o=e.filter((e=>null==n?void 0:n.includes(e.id)))})),o.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Fr(o,t)}))}register(e){var t;ei(null==(t=this._instance)?void 0:t.Cr)||(this.Lr(e),this.Dr(e))}Dr(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==t.length){if(null==this.Br){this.Br=new jv(this._instance),this.Br.init();this.Br.Sr((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,i,n,o;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Br)||n.register(e.conditions.actions.values),null==(o=e.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((t=>{if(t&&t.name){var r=this.Rr.get(t.name);r&&r.push(e.id),this.Rr.set(t.name,r||[e.id])}})))}))}}Lr(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t.Cr(((e,t)=>{this.onEvent(e,t)})),this.Mr=this.Or(e,_a.Activation),this.Nr=this.Or(e,_a.Cancellation)}}onEvent(e,t){var r,i=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[eo])||[];if(Ea.SHOWN===e&&t&&i.length>0){var n;Ra.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:i});var o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var s=i.indexOf(o);s>=0&&(i.splice(s,1),this.Zr(i))}}else{if(this.Nr.has(e)){var a=this.Pr(e,t,_a.Cancellation);a.length>0&&(Ra.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:a.map((e=>e.id))}),a.forEach((e=>{var t,r=i.indexOf(e.id);r>=0&&i.splice(r,1),null==(t=this._instance)||t.cancelPendingSurvey(e.id)})),this.Zr(i))}if(this.Mr.has(e)){Ra.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Mr.get(e)});var l=this.Pr(e,t,_a.Activation);this.Zr(i.concat(l.map((e=>e.id))||[]))}}}onAction(e){var t,r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[eo])||[];this.Rr.has(e)&&this.Zr(r.concat(this.Rr.get(e)||[]))}Zr(e){var t;Ra.info("updating activated surveys",{activatedSurveys:e}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[eo]:[...new Set(e)]})}getSurveys(){var e,t=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[eo];return t||[]}getEventToSurveys(){return this.Mr}$r(){return this.Br}}class Gv{constructor(e){this.qr=void 0,this._surveyManager=null,this.Hr=!1,this.Vr=!1,this.jr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ni(t))return Ra.warn("Flags not loaded yet. Not loading surveys.");var r=Ur(t);this.qr=r?t.length>0:t,Ra.info("flags response received, isSurveysEnabled: "+this.qr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(La)||null!=r&&r.startsWith(Da))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.Vr)Ra.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ra.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ra.info("Not loading surveys in cookieless mode without consent.");else{var e=null==sn?void 0:sn.__PosthogExtensions__;if(e){if(!ei(this.qr)||this._instance.config.advanced_enable_surveys){var t=this.qr||this._instance.config.advanced_enable_surveys;this.Vr=!0;try{var r=e.generateSurveys;if(r)return void this.Yr(r,t);var i=e.loadExternalDependency;if(!i)return void this.Gr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.Gr("Could not load surveys script",r):this.Yr(e.generateSurveys,t)}))}catch(e){throw this.Gr("Error initializing surveys",e),e}finally{this.Vr=!1}}}else Ra.error("PostHog Extensions not found.")}}Yr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Yv(this._instance),Ra.info("Surveys loaded successfully"),this.zr({isLoaded:!0})}Gr(e,t){Ra.error(e,t),this.zr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.jr.push(e),this._surveyManager&&this.zr({isLoaded:!0}),()=>{this.jr=this.jr.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Ra.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(Qn);if(r&&!t)return e(r,{isLoaded:!0});if(this.Hr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Hr=!0,this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var r;this.Hr=!1;var i=t.statusCode;if(200!==i||!t.json){var n="Surveys API could not be loaded, status: "+i;return Ra.error(n),e([],{isLoaded:!1,error:n})}var o,s=t.json.surveys||[],a=s.filter((e=>Fa(e)&&(Oa(e)||Pa(e))));a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a));return null==(r=this._instance.persistence)||r.register({[Qn]:s}),e(s,{isLoaded:!0})}})}catch(e){throw this.Hr=!1,e}}zr(e){for(var t of this.jr)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Ra.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ra.warn("init was not called")}Wr(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Ur(e){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.Wr(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ni(this._surveyManager))return Ra.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.Ur(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ni(this._surveyManager)?(Ra.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var o=this.Ur(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var r;if(ni(this._surveyManager))Ra.warn("init was not called");else{var i="string"==typeof e?this.Wr(e):e;if(null!=i&&i.id)if(qa.includes(i.type)){var n=null==Qi?void 0:Qi.querySelector(t);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(Ra.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Ra.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,n),Ra.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);Ra.warn("Survey element not found")}else Ra.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ra.warn("Survey not found")}}displaySurvey(e,t){var i;if(ni(this._surveyManager))Ra.warn("init was not called");else{var n=this.Wr(e);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void Ra.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==Na.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,t.selector)}else Ra.warn("Survey not found")}}cancelPendingSurvey(e){ni(this._surveyManager)?Ra.warn("init was not called"):this._surveyManager.cancelSurvey(e)}}var zv=dn("[RateLimiter]");class Wv{constructor(e){var t,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{zv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void zv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=e.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=(new Date).getTime(),o=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(no))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:n};o.tokens+=(n-o.last)/1e3*this.captureEventsPerSecond,o.last=n,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||e||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||e||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==(i=this.instance.persistence)||i.set_property(no,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Uv=dn("[RemoteConfig]");class Xv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=sn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Xr(e){var t,r;null!=(t=sn.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Uv.error("PostHog Extensions not found. Cannot load remote config."),e())}Jr(e){this._instance.Qt({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Uv.info("Using preloaded remote config",this.remoteConfig),void this.er(this.remoteConfig);if(this._instance.ye())return void Uv.warn("Remote config is disabled. Falling back to local config.");this.Xr((e=>{if(!e)return Uv.info("No config found after loading remote JS config. Falling back to JSON."),void this.Jr((e=>{this.er(e)}));this.er(e)}))}catch(e){Uv.error("Error loading remote config",e)}}er(e){e?this._instance.config.__preview_remote_config?(this._instance.er(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Uv.info("__preview_remote_config is disabled. Logging config instead",e):Uv.error("Failed to fetch remote config from PostHog.")}}var Jv=3e3;class Kv{constructor(e,t){this.Kr=!0,this.Qr=[],this.ei=pi((null==t?void 0:t.flush_interval_ms)||Jv,250,5e3,cn.createLogger("flush interval"),Jv),this.ti=e}enqueue(e){this.Qr.push(e),this.ri||this.ii()}unload(){this.ni();var e=this.Qr.length>0?this.oi():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.ti(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Kr=!1,this.ii()}ii(){var e=this;this.Kr||(this.ri=setTimeout((()=>{if(this.ni(),this.Qr.length>0){var t=this.oi(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Ur(r.data)&&pn(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.ti(r)};for(var i in t)r()}}),this.ei))}ni(){clearTimeout(this.ri),this.ri=void 0}oi(){var e={};return pn(this.Qr,(t=>{var i,n=t,o=(n?n.batchKey:null)||n.url;ei(e[o])&&(e[o]=r({},n,{data:[]})),null==(i=e[o].data)||i.push(n.data)})),this.Qr=[],e}}var Qv=["retriesPerformedSoFar"];class ef{constructor(e){this.si=!1,this.ai=3e3,this.Qr=[],this._instance=e,this.Qr=[],this.li=!0,!ei(zi)&&"onLine"in zi.navigator&&(this.li=zi.navigator.onLine,this.ui=()=>{this.li=!0,this.Et()},this.hi=()=>{this.li=!1},xn(zi,"online",this.ui),xn(zi,"offline",this.hi))}get length(){return this.Qr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,Qv);oi(t)&&t>0&&(n.url=Fu(n.url,{retry_count:t})),this._instance.Qt(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.ci(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}ci(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this.Qr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cn.warn(n),this.si||(this.si=!0,this.di())}di(){if(this.vi&&clearTimeout(this.vi),0===this.Qr.length)return this.si=!1,void(this.vi=void 0);this.vi=setTimeout((()=>{this.li&&this.Qr.length>0&&this.Et(),this.di()}),this.ai)}Et(){var e=Date.now(),t=[],r=this.Qr.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this.Qr=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.vi&&(clearTimeout(this.vi),this.vi=void 0),this.si=!1,ei(zi)||(this.ui&&(zi.removeEventListener("online",this.ui),this.ui=void 0),this.hi&&(zi.removeEventListener("offline",this.hi),this.hi=void 0)),this.Qr))try{this._instance.Qt(r({},e,{transport:"sendBeacon"}))}catch(e){cn.error(e)}this.Qr=[]}}class tf{constructor(e){this.fi=()=>{var e,t,r,i;this.pi||(this.pi={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.pi.lastScrollY=Math.ceil(o),this.pi.maxScrollY=Math.max(o,null!==(e=this.pi.maxScrollY)&&void 0!==e?e:0),this.pi.maxScrollHeight=Math.max(s,null!==(t=this.pi.maxScrollHeight)&&void 0!==t?t:0),this.pi.lastContentY=a,this.pi.maxContentY=Math.max(a,null!==(r=this.pi.maxContentY)&&void 0!==r?r:0),this.pi.maxContentHeight=Math.max(l,null!==(i=this.pi.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this.pi}resetContext(){var e=this.pi;return setTimeout(this.fi,0),e}startMeasuringScrollPosition(){xn(zi,"scroll",this.fi,{capture:!0}),xn(zi,"scrollend",this.fi,{capture:!0}),xn(zi,"resize",this.fi)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==zi?void 0:zi.document.documentElement;var e=Ur(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==zi?void 0:zi.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return zi&&(zi.scrollY||zi.pageYOffset||zi.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return zi&&(zi.scrollX||zi.pageXOffset||zi.document.documentElement.scrollLeft)||0}}var rf=e=>gv(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class nf{constructor(e,t,r,i){this.gi=e=>{var t=this.mi();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.yi(this._instance)};this.bi.register({[io]:r})}},this._instance=e,this.wi=t,this.bi=r,this.yi=i||rf,this.wi.onSessionId(this.gi)}mi(){return this.bi.props[io]}getSetOnceProps(){var e,t=null==(e=this.mi())?void 0:e.props;return t?"r"in t?mv(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return pn(_n(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+jr(r)]=t})),e}}var of=dn("[SessionId]");class sf{on(e,t){return this.Ci.on(e,t)}constructor(e,t,r){var i;if(this.Ii=[],this.Si=void 0,this.Ci=new Hv,this.ki=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.pe=e.config,this.bi=e.persistence,this.xi=void 0,this.Ai=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ti=t||Ua,this.Ei=r||Ua;var n=this.pe.persistence_name||this.pe.token,o=this.pe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pi(o,60,36e3,of.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Mi(),this.Ni="ph_"+n+"_window_id",this.Ri="ph_"+n+"_primary_window_exists",this.Fi()){var s=Bd.$e(this.Ni),a=Bd.$e(this.Ri);s&&!a?this.xi=s:Bd.He(this.Ni),Bd.qe(this.Ri,!0)}if(null!=(i=this.pe.bootstrap)&&i.sessionID)try{var l=(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.pe.bootstrap.sessionID);this.Oi(this.pe.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){of.error("Invalid sessionID in bootstrap",e)}this.Pi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ei(this.Ii)&&(this.Ii=[]),this.Ii.push(e),this.Ai&&e(this.Ai,this.xi),()=>{this.Ii=this.Ii.filter((t=>t!==e))}}Fi(){return"memory"!==this.pe.persistence&&!this.bi.ar&&Bd.De()}Li(e){e!==this.xi&&(this.xi=e,this.Fi()&&Bd.qe(this.Ni,e))}Di(){return this.xi?this.xi:this.Fi()?Bd.$e(this.Ni):null}Oi(e,t,r){e===this.Ai&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Ai=e,this.bi.register({[Gn]:[t,e,r]}))}Bi(){var e=this.bi.props[Gn];return Ur(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Oi(null,null,null)}destroy(){clearTimeout(this.Zi),this.Zi=void 0,this.Si&&zi&&(zi.removeEventListener("beforeunload",this.Si,{capture:!1}),this.Si=void 0),this.Ii=[]}Pi(){this.Si=()=>{this.Fi()&&Bd.He(this.Ri)},xn(zi,"beforeunload",this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.pe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,o]=this.Bi(),s=this.Di(),a=oi(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,h=!u&&!e&&this.ki(r,i);u||h||a?(n=this.Ti(),s=this.Ei(),of.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.Ei(),l=!0);var c=0===i||!e||a?r:i,d=0===o?(new Date).getTime():o;return this.Li(s),this.Oi(n,c,d),e||this.Mi(),l&&this.Ii.forEach((e=>e(n,s,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}Mi(){clearTimeout(this.Zi),this.Zi=setTimeout((()=>{var[e]=this.Bi();if(this.ki((new Date).getTime(),e)){var t=this.Ai;this.resetSessionId(),this.Ci.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var af=["$set_once","$set"],lf=dn("[SiteApps]");class uf{constructor(e){this._instance=e,this.$i=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qi(e,t){if(t){var r=this.globalsForEvent(t);this.$i.push(r),this.$i.length>1e3&&(this.$i=this.$i.slice(10))}}get siteAppLoaders(){var e;return null==(e=sn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Cr(this.qi.bind(this));this.Hi=()=>{e(),this.$i=[],this.Hi=void 0}}}globalsForEvent(e){var t,n,o,s,a,l,u;if(!e)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,af),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this.$i.length&&(lf.info("Processing "+this.$i.length+" events for site app with id "+e.id),this.$i.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this.Hi)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,lf.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:e=>{n(e)}});o&&(t.processEvent=o),i=!0}catch(t){lf.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){lf.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Vi(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ji(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){lf.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Vi(),void this._instance.on("eventCaptured",(e=>this.ji(e)))):void lf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Hi)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var o=function(e){var t;sn["__$$ph_site_app_"+e]=n._instance,null==(t=sn.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return lf.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:s,url:a}of e.siteApps)o(s)}else lf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var hf=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&$r(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>$r(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},cf=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),df="i.posthog.com";class vf{constructor(e){this.Yi={},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 flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+df,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Yi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Yi[this.apiHost]=cf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Yi[this.apiHost]=cf.EU:this.Yi[this.apiHost]=cf.CUSTOM),this.Yi[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===cf.CUSTOM)return this.apiHost+t;var r=df+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var ff={icontains:(e,t)=>!!zi&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!zi&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!zi&&Du(t.href,e),not_regex:(e,t)=>!!zi&&!Du(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class pf{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{pf.Gi("retrieved web experiments from the server"),t.zi=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t.zi)pf.Gi("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zi)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ti(i)&&e.variants[i]&&t.Wi(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var o=e.variants[n];pf.Ui(o)&&t.Wi(e.name,n,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())pf.Gi("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.zi))return this.zi=new Map,this.loadIfEnabled(),void this.previewWebExperiment();pf.Gi("applying feature flags",e),e.forEach((e=>{var t;if(this.zi&&null!=(t=this.zi)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zi)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Wi(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=pf.getWindowLocation();if(null!=e&&e.search){var t=En(null==e?void 0:e.search,"__experiment_id"),r=En(null==e?void 0:e.search,"__experiment_variant");t&&r&&(pf.Gi("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Xi(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance.Qt({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}Xi(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(pf.Gi("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Wi(i[0].name,t,i[0].variants[t].transforms))}static Ui(e){return!ni(e.conditions)&&(pf.Ji(e)&&pf.Ki(e))}static Ji(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,o=pf.getWindowLocation();return!!o&&(null==(r=e.conditions)||!r.url||ff[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==zi?void 0:zi.location}static Ki(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.utm))return!0;var r=cv();if(r.utm_source){var i,n,o,s,a,l,u,h,c=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Gi(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];cn.info("[WebExperiments] "+e,r)}Wi(e,t,r){this._is_bot()?pf.Gi("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;pf.Gi("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):pf.Gi("Control variants leave the page unmodified.")}_is_bot(){return Ki&&this._instance?hf(Ki,this._instance.config.custom_blocked_useragents):void 0}}var gf=dn("[PostHog ExternalIntegrations]"),mf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class yf{constructor(e){this._instance=e}Ue(e,t){var r;null==(r=sn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return gf.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,o;(!i||null!=(r=sn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.Ue(mf[t],(()=>{var r;null==(r=sn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=sn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(o=sn.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[t])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var bf="[SessionRecording]",wf=dn(bf);class _f{get started(){var e;return!(null==(e=this.Qi)||!e.isStarted)}get status(){return this.Qi?this.Qi.status:this.en&&!this.tn?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.en=!1,this.rn=void 0,this._instance=e,!this._instance.sessionManager)throw wf.error("started without valid sessionManager"),new Error(bf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(bf+' cannot be used with cookieless_mode="always"')}get tn(){var e,t=!(null==(e=this._instance.get_property(Yn))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return zi&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.tn||null==(t=this.Qi)||!t.isStarted){var r=!ei(Object.assign)&&!ei(Array.from);this.tn&&r?(this.nn(e),wf.info("starting")):this.stopRecording()}}nn(e){var t,r,i;this.tn&&(null!=sn&&null!=(t=sn.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=sn.__PosthogExtensions__)&&r.initSessionRecording?this.sn(e):null==(i=sn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.an,(t=>{if(t)return wf.error("could not load recorder",t);this.sn(e)})))}stopRecording(){var e,t;null==(e=this.rn)||e.call(this),this.rn=void 0,null==(t=this.Qi)||t.stop()}ln(){var e;null==(e=this._instance.persistence)||e.unregister(zn)}un(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,o=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.ln();var s=null==t?void 0:t.minimumDurationMilliseconds;n.register({[Yn]:r({enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ei(s)?null:s,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};o(),null==(t=this.rn)||t.call(this),this.rn=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.un(e),this.en=!0,this.startIfEnabledOrStop()):this.en=!0:wf.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.Qi)&&r.log?this.Qi.log(e,t):wf.warn("log called before recorder was ready")}get an(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Yn);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}sn(e){var t,r;if(null==(t=sn.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Qi||(this.Qi=null==(r=sn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Qi._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Qi.start(e)}onRRwebEmit(e){var t;null==(t=this.Qi)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Qi||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this.Qi)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Qi||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this.Qi)||e.overrideSampling()}overrideTrigger(e){var t,r;this.Qi||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this.Qi)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Qi)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.Qi)||!r.tryAddCustomEvent(e,t))}}var Cf={},If=()=>{},Sf="posthog",kf=!Nu&&-1===(null==on?void 0:on.indexOf("MSIE"))&&-1===(null==on?void 0:on.indexOf("Mozilla")),xf=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Sn(null==Qi?void 0:Qi.location),persistence:"localStorage+cookie",persistence_name:"",loaded:If,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:en&&ti(null==en?void 0:en.search)&&-1!==en.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==zi||null==(t=zi.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;cn.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Jv},error_tracking:{},_onCapture:If,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},Af=e=>{var t={};ei(e.process_person)||(t.person_profiles=e.process_person),ei(e.xhr_headers)||(t.request_headers=e.xhr_headers),ei(e.cookie_name)||(t.persistence_name=e.cookie_name),ei(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ei(e.store_google)||(t.save_campaign_params=e.store_google),ei(e.verbose)||(t.debug=e.verbose);var r=gn({},t,e);return Ur(e.property_blacklist)&&(ei(e.property_denylist)?r.property_denylist=e.property_blacklist:Ur(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:cn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Tf{constructor(){this.__forceAllowLocalhost=!1}get hn(){return this.__forceAllowLocalhost}set hn(e){cn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ef{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new Tf,this.cn=!1,this.version=un.LIB_VERSION,this.dn=new Hv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xf(),this.SentryIntegration=Kd,this.sentryIntegration=e=>function(e,t){var r=Jd(e,t);return{name:Xd,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.vn=!1,this.fn=null,this.pn=null,this.gn=null,this.featureFlags=new Zv(this),this.toolbar=new iv(this),this.scrollManager=new tf(this),this.pageViewManager=new Av(this),this.surveys=new Gv(this),this.experiments=new pf(this),this.exceptions=new lc(this),this.rateLimiter=new Wv(this),this.requestRouter=new vf(this),this.consent=new $d(this),this.externalIntegrations=new yf(this),this.people={set:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>cn.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Sf){var i,n=null!==(i=Cf[r])&&void 0!==i?i:new Ef;return n._init(e,t,r),Cf[r]=n,Cf[Sf][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ei(e)||ri(e))return cn.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.mn(t.debug),this.yn=t,this.bn=[],t.person_profiles&&(this.pn=t.person_profiles),this.set_config(gn({},xf(t.defaults),Af(t),{name:i,token:e})),this.config.on_xhr_error&&cn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ul.GZipJS;var o=this.wn();this.persistence=new qv(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new qv(r({},this.config,{persistence:"sessionStorage"}),o);var s=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._n=new Kv((e=>this.Cn(e)),this.config.request_queue_config),this.In=new ef(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new sf(this),this.sessionPropsManager=new nf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Sn(l)}),0)):(cn.info("Initializing extensions synchronously"),this.Sn(l)),un.DEBUG=un.DEBUG||this.config.debug,un.DEBUG&&cn.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(Ua()),d=null!=(u=t.bootstrap)&&u.isIdentifiedID?c:t.bootstrap.distinctID;this.persistence.set_property(ro,null!=(h=t.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.kn()){var v,f,p=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),g=Object.keys((null==(f=t.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((e=>p[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ho,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Ua());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ro,"anonymous")}return xn(zi,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Ud(this,(()=>this.xn())):this.xn(),Xr(this.config._onCapture)&&this.config._onCapture!==If&&(cn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&cn.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Sn(e){var t=performance.now();this.historyAutocapture=new zd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new ov(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new uf(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new _f(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new wd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new xv(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Iv(this)})),r.push((()=>{this.exceptionObserver=new Gd(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new jd(this,Vd),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.An){var e=this.An;this.An=void 0,this.er(e)}})),this.Tn(r,t)}Tn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Tn(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){cn.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&cn.info("PostHog extensions initialized ("+i+"ms)")}er(e){var t,r,i,n,o,s,a,l;if(!Qi||!Qi.body)return cn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.er(e)}),500);this.config.__preview_deferred_init_extensions&&(this.An=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Hr(e.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hr(e.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.pn?this.pn:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}xn(){try{this.config.loaded(this)}catch(e){cn.critical("`loaded` function failed",e)}this.En(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Mn()}),1),new Xv(this).load(),this.featureFlags.flags()}En(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._n)||e.enable()))}_dom_loaded(){this.is_capturing()&&fn(this.__request_queue,(e=>this.Cn(e))),this.__request_queue=[],this.En()}_handle_unload(){var e,t;this.config.request_batching?(this.Nn()&&this.capture("$pageleave"),null==(e=this._n)||e.unload(),null==(t=this.In)||t.unload()):this.Nn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Qt(e){this.__loaded&&(kf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Fu(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,o=r({},e);o.timeout=o.timeout||6e4,o.url=Fu(o.url,{_:(new Date).getTime().toString(),ver:un.LIB_VERSION,compression:o.compression});var s=null!==(t=o.transport)&&void 0!==t?t:"fetch",a=Lu.filter((e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport))),l=null!==(i=null==(n=kn(a,(e=>e.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(o)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}Cn(e){this.In?this.In.retriableRequest(e):this.Qt(e)}_execute_array(e){var t,r=[],i=[],n=[];fn(e,(e=>{e&&(t=e[0],Ur(t)?n.push(e):Xr(e)?e.call(this):Ur(e)&&"alias"===t?r.push(e):Ur(e)&&-1!==t.indexOf("capture")&&Xr(this[t])?n.push(e):i.push(e))}));var o=function(e,t){fn(e,(function(e){if(Ur(e[0])){var r=t;pn(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(r,this),o(i,this),o(n,this)}kn(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._n){if(this.is_capturing())if(!ei(e)&&ti(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=t&&t.$current_url&&!ti(null==t?void 0:t.$current_url)&&(cn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(null==i?void 0:i.timestamp)||a,u=Ua(),h={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c=this.Rn(null==i?void 0:i.$set_once);if(c&&(h.$set_once=c),(h=Cn(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ei(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),e===Ea.DISMISSED||e===Ea.SENT){var d=null==t?void 0:t[Ma.SURVEY_ID],v=null==t?void 0:t[Ma.SURVEY_ITERATION];$a({id:d,current_iteration:v}),h.$set=r({},h.$set,{[Ba({id:d,current_iteration:v},e===Ea.SENT?"responded":"dismissed")]:!0})}var f=r({},h.properties.$set,h.$set);if(Qr(f)||this.setPersonPropertiesForFlags(f),!ni(this.config.before_send)){var p=this.Fn(h);if(!p)return;h=p}this.dn.emit("eventCaptured",h);var g={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Cn(g):this._n.enqueue(g),h}cn.critical("This capture call is ignored due to client rate limiting.")}}else cn.error("No event name provided to posthog.capture")}else cn.uninitializedWarning("posthog.capture")}Cr(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var s=o?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ti(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&cn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=wv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&gn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.In)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===cf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||o?"$pageleave"!==e||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gn(a,u),"$pageview"===e&&Qi&&(a.title=Qi.title),!ei(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}on&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=gn({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ur(this.config.property_denylist)?pn(this.config.property_denylist,(function(e){delete a[e]})):cn.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&&(cn.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,e));var g=this.On();return a.$process_person_profile=g,g&&!o&&this.Pn("_calculate_event_properties"),a}Rn(e){var t;if(!this.persistence||!this.On())return e;if(this.cn)return e;var r=this.persistence.get_initial_props(),i=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),n=gn({},r,i||{},e||{}),o=this.config.sanitize_properties;return o&&(cn.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),this.cn=!0,Qr(n)?void 0:n}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ln(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,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.dn.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Ha),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return cn.uninitializedWarning("posthog.identify");if(oi(e)&&(e=e.toString(),cn.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()))cn.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.');else if(e!==ho){if(this.Pn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Pn)&&(this.unregister(Pn),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(ro)||"anonymous");e!==n&&s?(this.persistence.set_property(ro,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.gn=Bu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(to))}}else cn.critical('The string "'+ho+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else cn.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Pn("posthog.setPersonProperties")){var i=Bu(this.get_distinct_id(),e,t);this.gn!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.gn=i):cn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Pn("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}}else cn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Pn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(cn.info("reset"),!this.__loaded)return cn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(ro,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.gn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ho,$device_id:null},"");else{var s=this.config.get_device_id(Ua());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}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.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,o=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(e,t){return e===this.get_property(On)?(cn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Pn("posthog.alias")?(ei(t)&&(t=this.get_distinct_id()),e!==t?(this.Ln(Pn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(cn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Kr(e)){var i,n,o,s,a;gn(this.config,Af(e));var l=this.wn();null==(i=this.persistence)||i.update_config(this.config,t,l),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new qv(r({},this.config,{persistence:"sessionStorage"}),l);var u=this.mn(this.config.debug);si(u)&&(this.config.debug=u),si(this.config.debug)&&(this.config.debug?(un.DEBUG=!0,Rd.De()&&Rd.qe("ph_debug","true"),cn.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(un.DEBUG=!1,Rd.De()&&Rd.He("ph_debug"))),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(s=this.heatmaps)||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Dn(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={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(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||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)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Sf;return t!==Sf&&(t=Sf+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(ro))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(ro))}On(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Pn])&&(null==(t=this.persistence)||null==(t=t.props)||!t[lo]))}Nn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.On()||this.Pn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Pn(e){return"never"===this.config.person_profiles?(cn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ln(lo,!0),!0)}wn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Dn(){var e,t,r,i,n=this.wn();(null==(e=this.persistence)?void 0:e.ar)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t.ar)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){if("always"!==this.config.cookieless_mode){var t,r;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=new sf(this),this.persistence&&(this.sessionPropsManager=new nf(this,this.sessionManager,this.persistence)),this.sessionRecording=new _f(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Dn(),this.En(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ei(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(r=null==e?void 0:e.captureEventName)&&void 0!==r?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Mn()}else cn.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Dn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ho,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.Mn())):cn.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Zd.GRANTED?"granted":e===Zd.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Dn()}_is_bot(){return Ki?hf(Ki,this.config.custom_blocked_useragents):void 0}Mn(){Qi&&("visible"===Qi.visibilityState?this.vn||(this.vn=!0,this.capture("$pageview",{title:Qi.title},{send_instantly:!0}),this.fn&&(Qi.removeEventListener("visibilitychange",this.fn),this.fn=null)):this.fn||(this.fn=this.Mn.bind(this),xn(Qi,"visibilitychange",this.fn)))}debug(e){!1===e?(null==zi||zi.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==zi||zi.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)`."),this.set_config({debug:!0}))}ye(){var e,t,r,i,n,o,s,a=this.yn||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cn.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=cn,o=(t="advanced_disable_flags")in(e=a)&&!ei(e[t]),s=r in e&&!ei(e[r]),o?e[t]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}Fn(e){if(ni(this.config.before_send))return e;var t=Ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),ni(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return li(e.event)?cn.warn(n+". This can cause unexpected behavior."):cn.info(n),null}r.properties&&!Qr(r.properties)||cn.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager.$t)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}mn(e){var t=si(e)&&!e,r=Rd.De()&&"true"===Rd.Ze("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=wn(e.prototype[t[r]])}(Ef,["identify"]);var Mf,Nf;Mf=Cf[Sf]=new Ef,(Nf=sn.posthog)&&pn(Nf._i,(function(e){if(e&&Ur(e)){var t=Mf.init(e[0],e[1],e[2]),r=Nf[e[2]]||Nf;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),sn.posthog=Mf,function(){function e(){e.done||(e.done=!0,kf=!1,pn(Cf,(function(e){e._dom_loaded()})))}null!=Qi&&Qi.addEventListener?"complete"===Qi.readyState?e():xn(Qi,"DOMContentLoaded",e,{capture:!1}):zi&&cn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|