posthog-js 1.316.0 → 1.317.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +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/element-inference.d.ts +21 -0
- package/dist/element-inference.js +2 -0
- package/dist/element-inference.js.map +1 -0
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +12 -0
- package/dist/module.full.d.ts +12 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +12 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +12 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.d.ts +12 -0
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/entrypoints/element-inference.es.d.ts +1 -0
- package/dist/src/entrypoints/product-tours.d.ts +2 -0
- package/dist/src/extensions/product-tours/element-inference.d.ts +30 -0
- package/dist/src/extensions/product-tours/index.d.ts +2 -0
- package/dist/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
- package/dist/src/extensions/surveys.d.ts +2 -2
- package/dist/src/posthog-product-tours-types.d.ts +7 -0
- package/dist/src/utils/survey-branching.d.ts +11 -0
- package/dist/src/utils/survey-url-prefill.d.ts +7 -5
- package/dist/surveys-preview.d.ts +18 -1
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/lib/package.json +5 -1
- package/lib/src/entrypoints/element-inference.es.d.ts +1 -0
- package/lib/src/entrypoints/element-inference.es.js +8 -0
- package/lib/src/entrypoints/element-inference.es.js.map +1 -0
- package/lib/src/entrypoints/product-tours.d.ts +2 -0
- package/lib/src/entrypoints/product-tours.js +5 -0
- package/lib/src/entrypoints/product-tours.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltip.js +5 -2
- package/lib/src/extensions/product-tours/components/ProductTourTooltip.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js.map +1 -1
- package/lib/src/extensions/product-tours/element-inference.d.ts +30 -0
- package/lib/src/extensions/product-tours/element-inference.js +296 -0
- package/lib/src/extensions/product-tours/element-inference.js.map +1 -0
- package/lib/src/extensions/product-tours/index.d.ts +2 -0
- package/lib/src/extensions/product-tours/index.js +4 -1
- package/lib/src/extensions/product-tours/index.js.map +1 -1
- package/lib/src/extensions/product-tours/preview.js +1 -1
- package/lib/src/extensions/product-tours/preview.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
- package/lib/src/extensions/product-tours/product-tours-utils.js +12 -0
- package/lib/src/extensions/product-tours/product-tours-utils.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.js +15 -31
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/lib/src/extensions/surveys.d.ts +2 -2
- package/lib/src/extensions/surveys.js +5 -94
- package/lib/src/extensions/surveys.js.map +1 -1
- package/lib/src/posthog-product-tours-types.d.ts +7 -0
- package/lib/src/posthog-product-tours-types.js.map +1 -1
- package/lib/src/utils/survey-branching.d.ts +11 -0
- package/lib/src/utils/survey-branching.js +106 -0
- package/lib/src/utils/survey-branching.js.map +1 -0
- package/lib/src/utils/survey-url-prefill.d.ts +7 -5
- package/lib/src/utils/survey-url-prefill.js +30 -18
- package/lib/src/utils/survey-url-prefill.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -3
package/dist/module.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e,r,i,n,o,s){try{var a=t[o](s),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,l,"next",e)}function l(e){t(s,n,o,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=Object.defineProperty,u=(t,e,r)=>((t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(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(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function _(t){return t.nodeType===t.ELEMENT_NODE}function w(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.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(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function M(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){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(t,e){return(t||"").replace(R,((t,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return t;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=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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(t,e){return e&&""!==e.trim()?U(t,e):e}function W(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?z(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=e.length);){var o=i(j);if(","===o.slice(-1))o=z(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=z(t,o);for(var a=!1;;){var l=e.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(", ")}(t,i):"style"===r?L(i,U(t)):"object"===e&&"data"===r?z(t,i):i:z(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(_(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){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}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){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}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},_=t.attributes.length,w=0;w<_;w++){var C=t.attributes[w];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);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&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=I(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:M(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.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=t,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(t){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: "+t)}"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=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:z}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{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 t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,l=b.textContent(t),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){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}=e,{needsMask:E}=e,{preserveWhiteSpace:M=!0}=e;E||(E=Q(t,s,a,void 0===E));var R,F=tt(t,{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(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.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(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);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(t))){var Z=rt(B,D);Z&&O.childNodes.push(Z)}var q=null;if(_(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=rt(j,D);Y&&(C(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&w(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,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(t,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(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{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});e&&k(t,e)}}),x),O}let it=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?st[t]=u:r}catch(t){return r}}var lt={};function ut(t,e,r){var i,n=t+"."+String(r);if(lt[n])return lt[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lt[n]=s,s.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,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=e-(l-n),h=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),u))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var _t=Date.now;function wt(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===H}function At(t,e){if(w(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Vt,i=t=>{for(var e=t,r=H;r===H;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=w(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=rt(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:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:s,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Wt(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Ut(this.droppedSet,s)||Wt(this.removes,s,this.mirror)?Ut(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(vt.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(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.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((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.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(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.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(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.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(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=w(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(r,i)]?zt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!w(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Yt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 zt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>zt(t,e)))}function Wt(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(i)&&(l=Zt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,i))})),Jt((()=>{u.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=wt(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.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(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){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}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;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=mt(Jt((t=>{var r=Date.now()-o;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],o=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=_t()),l.push({x:r,y:i,id:n.getId(e),timeOffset:_t()-o}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),u=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=M(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:e,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};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((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),o.media||500))),l=[ft("play",a(qt.Play),s),ft("pause",a(qt.Pause),s),ft("seeked",a(qt.Seeked),s),ft("volumechange",a(qt.VolumeChange),s),ft("ratechange",a(qt.RateChange),s)];return Jt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";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:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),t.apply(e,o)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{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((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var l,[u,h,c]=s;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=se(null==(l=e.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:oe(e.parentRule)}),t.apply(e,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,s)=>{var a,[u]=s;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(we(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:we(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var _e=(t,e,r)=>t.map((t=>be(t,e,r))),we=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){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(!kt(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(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 t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var h=t.apply(this,l);if(ye(h,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=_e(l,o,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));s.push(l)}catch(i){var u=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Me(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,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(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),l=new Map,u=new Me;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:$t["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/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.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 kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=_e(a,e,this);t(this.canvas,{type:$t["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:$t["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,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:_={},mousemoveWait:w,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Be.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(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=_t(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(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===Lt.FullSnapshot)L=s,Z=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:_});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:_,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:W},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){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:_,keepIframeSrcFn:w=(()=>!1)}=e||{};return rt(t,{doc:t,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:_,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:_,recordCanvas:I,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Mt(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},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:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:_,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ve=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},We={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],r=e.prototype,i=t in ze?ze[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in We?We[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){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(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ar[t]=u:r}catch(t){return r}}var ur={};function hr(t,e,r){var i,n=t+"."+String(r);if(ur[n])return ur[n].call(e);var o=lr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=lr(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},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:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function _r(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||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 t(e,r){var i,n,o=null==(n=null==(i=e.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=t(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 t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.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(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||_r(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[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 e){var h=e[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:_r,throttle:function(t,e,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=e-(l-n),h=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.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([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).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(t){return t.stack.split("\n").filter((function(t){return!t.match(Mr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.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(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.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(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var l=e[a];Array.isArray(l)?s[a]=Rr(l.length?l[0]:null):s[a]=l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}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(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?wr.patch(e,r,(e=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:h,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),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(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return Zr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},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(t,e){return-1!==t.indexOf(e)}var Vr=function(t){return t.trim()},jr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Gr=Object.prototype,zr=Gr.hasOwnProperty,Wr=Gr.toString,Ur=Yr||function(t){return"[object Array]"===Wr.call(t)},Xr=t=>"function"==typeof t,Jr=t=>Xr(t)&&-1!==t.toString().indexOf("[native code]"),Kr=t=>t===Object(t)&&!Ur(t),Qr=t=>{if(Kr(t)){for(var e in t)if(zr.call(t,e))return!1;return!0}return!1},ti=t=>void 0===t,ei=t=>"[object String]"==Wr.call(t),ri=t=>ei(t)&&0===t.trim().length,ii=t=>null===t,ni=t=>ti(t)||ii(t),oi=t=>"[object Number]"==Wr.call(t),si=t=>"[object Boolean]"===Wr.call(t),ai=t=>t instanceof FormData,li=t=>Hr(qr,t);function ui(t){return null===t||"object"!=typeof t}function hi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function ci(t){return!ti(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var di=[!0,"true",1,"1","yes"],vi=t=>Hr(di,t),fi=[!1,"false",0,"0","no"];function pi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),oi(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),pi(n||r,e,r,i))}class gi{constructor(t){this.o={},this.h=t.h,this.m=pi(t.bucketSize,0,100,t.C),this.I=pi(t.refillRate,0,this.m,t.C),this.S=pi(t.refillInterval,0,864e5,t.C)}k(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.S);if(i>0){var n=i*this.I;t.tokens=Math.min(t.tokens+n,this.m),t.lastAccess=t.lastAccess+i*this.S}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),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==(e=this.h)||e.call(this,t)),0===n.tokens)}stop(){this.o={}}}var mi="Mobile",yi="iOS",bi="Android",_i="Tablet",wi=bi+" "+_i,Ci="iPad",Ii="Apple",Si=Ii+" Watch",ki="Safari",xi="BlackBerry",Ai="Samsung",Ti=Ai+"Browser",Ei=Ai+" Internet",Mi="Chrome",Ni=Mi+" OS",Ri=Mi+" "+yi,Fi="Internet Explorer",Oi=Fi+" "+mi,Pi="Opera",Li=Pi+" Mini",Di="Edge",Bi="Microsoft "+Di,Zi="Firefox",$i=Zi+" "+yi,qi="Nintendo",Hi="PlayStation",Vi="Xbox",ji=bi+" "+mi,Yi=mi+" "+ki,Gi="Windows",zi=Gi+" Phone",Wi="Nokia",Ui="Ouya",Xi="Generic",Ji=Xi+" "+mi.toLowerCase(),Ki=Xi+" "+_i.toLowerCase(),Qi="Konqueror",tn="(\\d+(\\.\\d+)?)",en=new RegExp("Version/"+tn),rn=new RegExp(Vi,"i"),nn=new RegExp(Hi+" \\w+","i"),on=new RegExp(qi+" \\w+","i"),sn=new RegExp(xi+"|PlayBook|BB10","i"),an={"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 ln,un,hn,cn=(t,e)=>e&&Hr(e,Ii)||function(t){return Hr(t,ki)&&!Hr(t,Mi)&&!Hr(t,bi)}(t),dn=function(t,e){return e=e||"",Hr(t," OPR/")&&Hr(t,"Mini")?Li:Hr(t," OPR/")?Pi:sn.test(t)?xi:Hr(t,"IE"+mi)||Hr(t,"WPDesktop")?Oi:Hr(t,Ti)?Ei:Hr(t,Di)||Hr(t,"Edg/")?Bi:Hr(t,"FBIOS")?"Facebook "+mi:Hr(t,"UCWEB")||Hr(t,"UCBrowser")?"UC Browser":Hr(t,"CriOS")?Ri:Hr(t,"CrMo")||Hr(t,Mi)?Mi:Hr(t,bi)&&Hr(t,ki)?ji:Hr(t,"FxiOS")?$i:Hr(t.toLowerCase(),Qi.toLowerCase())?Qi:cn(t,e)?Hr(t,mi)?Yi:ki:Hr(t,Zi)?Zi:Hr(t,"MSIE")||Hr(t,"Trident/")?Fi:Hr(t,"Gecko")?Zi:""},vn={[Oi]:[new RegExp("rv:"+tn)],[Bi]:[new RegExp(Di+"?\\/"+tn)],[Mi]:[new RegExp("("+Mi+"|CrMo)\\/"+tn)],[Ri]:[new RegExp("CriOS\\/"+tn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+tn)],[ki]:[en],[Yi]:[en],[Pi]:[new RegExp("(Opera|OPR)\\/"+tn)],[Zi]:[new RegExp(Zi+"\\/"+tn)],[$i]:[new RegExp("FxiOS\\/"+tn)],[Qi]:[new RegExp("Konqueror[:/]?"+tn,"i")],[xi]:[new RegExp(xi+" "+tn),en],[ji]:[new RegExp("android\\s"+tn,"i")],[Ei]:[new RegExp(Ti+"\\/"+tn)],[Fi]:[new RegExp("(rv:|MSIE )"+tn)],Mozilla:[new RegExp("rv:"+tn)]},fn=function(t,e){var r=dn(t,e),i=vn[r];if(ti(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},pn=[[new RegExp(Vi+"; "+Vi+" (.*?)[);]","i"),t=>[Vi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(Hi,"i"),[Hi,""]],[sn,[xi,""]],[new RegExp(Gi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zi,""];if(new RegExp(mi).test(e)&&!/IEMobile\b/.test(e))return[Gi+" "+mi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=an[i]||"";return/arm/i.test(e)&&(n="RT"),[Gi,n]}return[Gi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[yi,e.join(".")]}return[yi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ti(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+bi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+bi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[bi,e.join(".")]}return[bi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ni,""]],[/Linux|debian/i,["Linux",""]]],gn=function(t){return on.test(t)?qi:nn.test(t)?Hi:rn.test(t)?Vi:new RegExp(Ui,"i").test(t)?Ui:new RegExp("("+zi+"|WPDesktop)","i").test(t)?zi:/iPad/.test(t)?Ci:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Si:sn.test(t)?xi:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wi,"i").test(t)?Wi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(mi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?bi:wi:new RegExp("(pda|"+mi+")","i").test(t)?Ji:new RegExp(_i,"i").test(t)&&!new RegExp(_i+" pc","i").test(t)?Ki:""},mn=function(t){var e=gn(t);return e===Ci||e===wi||"Kobo"===e||"Kindle Fire"===e||e===Ki?_i:e===qi||e===Vi||e===Hi||e===Ui?"Console":e===Si?"Wearable":e?mi:"Desktop"},yn=t=>t instanceof Error;function bn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return hn&&r.length===un||(un=r.length,hn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,ln[i]=[l,u];break}}return r}),{})),hn}}class _n{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ur(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bn(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var wn="?";function Cn(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?wn:r,in_app:!0};return ti(i)||(o.lineno=i),ti(n)||(o.colno=n),o}var In=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:wn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Sn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=(t,e)=>{var r=Sn.exec(t);if(r){var[,i,n,o]=r;return Cn(e,i,wn,+n,+o)}var s=kn.exec(t);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=xn.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,u]=In(s[1]||wn,s[2]);return Cn(e,u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,En=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mn=(t,e)=>{var r=Tn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=En.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]||wn;return[o,n]=In(o,n),Cn(e,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Nn=/\(error: (.*)\)/,Rn=50;function Fn(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var o=[],s=e.split("\n"),a=n;a<s.length;a++){var l=s[a];if(!(l.length>1024)){var u=Nn.test(l)?l.replace(Nn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,t);if(c){o.push(c);break}}if(o.length>=Rn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Rn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||wn});var i}))}(o)}}("web:javascript",An,Mn)}class On{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ei(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return hi(t,"DOMException")}isDOMError(t){return hi(t,"DOMError")}}class Pn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Ln{constructor(){}match(t){return hi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Dn);return i&&(e=i[1],r=i[2]),[e,r]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var r=Object.keys(t);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>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return ci(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return ei(t)&&!ri(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(yn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return ci(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$n(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vn{match(t){return ui(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class jn{match(t){return hi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return ui(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(ui(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yn="undefined"!=typeof window?window:void 0,Gn="undefined"!=typeof globalThis?globalThis:Yn;"undefined"==typeof self&&(Gn.self=Gn),"undefined"==typeof File&&(Gn.File=function(){});var zn=Array.prototype,Wn=zn.forEach,Un=zn.indexOf,Xn=null==Gn?void 0:Gn.navigator,Jn=null==Gn?void 0:Gn.document,Kn=null==Gn?void 0:Gn.location,Qn=null==Gn?void 0:Gn.fetch,to=null!=Gn&&Gn.XMLHttpRequest&&"withCredentials"in new Gn.XMLHttpRequest?Gn.XMLHttpRequest:void 0,eo=null==Gn?void 0:Gn.AbortController,ro=null==Xn?void 0:Xn.userAgent,io=null!=Yn?Yn:{},no=()=>!!Yn.Zone,oo=t=>t instanceof Document,so={DEBUG:!1,LIB_VERSION:"1.316.0"},ao=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={A:function(e){if(Yn&&(so.DEBUG||io.POSTHOG_DEBUG||r)&&!ti(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(t,...o)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>ao(t+" "+e,r)};return i},lo=ao("[PostHog.js]"),uo=lo.createLogger,ho={};function co(t,e,r){if(Ur(t))if(Wn&&t.forEach===Wn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===ho)return}function vo(t,e,r){if(!ni(t)){if(Ur(t))return co(t,e,r);if(ai(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===ho)return}else for(var n in t)if(zr.call(t,n)&&e.call(r,t[n],n)===ho)return}}var fo=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return co(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},po=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return co(r,(function(e){co(e,(function(e){t.push(e)}))})),t};function go(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var mo=function(t){try{return t()}catch(t){return}},yo=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){lo.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),lo.critical(t)}}},bo=function(t){var e={};return vo(t,(function(t,r){(ei(t)&&t.length>0||oi(t))&&(e[r]=t)})),e};function _o(t,e){return r=t,i=t=>ei(t)&&!ii(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Ur(e)?(o=[],co(e,(e=>{o.push(t(e))}))):(o={},vo(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var wo=["herokuapp.com","vercel.app","netlify.app"];function Co(t){var e=null==t?void 0:t.hostname;if(!ei(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of wo)if(r===i)return!1;return!0}function Io(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function So(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var ko=t=>{var e=null==Jn?void 0:Jn.createElement("a");return ti(e)?null:(e.href=t,e)},xo=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vo(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ao=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Ur(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){lo.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},To=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.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)&&(e.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},Eo=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Mo(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function No(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Ro="$people_distinct_id",Fo="__alias",Oo="__timers",Po="$autocapture_disabled_server_side",Lo="$heatmaps_enabled_server_side",Do="$exception_capture_enabled_server_side",Bo="$error_tracking_suppression_rules",Zo="$error_tracking_capture_extension_exceptions",$o="$web_vitals_enabled_server_side",qo="$dead_clicks_enabled_server_side",Ho="$product_tours_enabled_server_side",Vo="$web_vitals_allowed_metrics",jo="$session_recording_remote_config",Yo="$sesid",Go="$session_is_sampled",zo="$enabled_feature_flags",Wo="$early_access_features",Uo="$feature_flag_details",Xo="$stored_person_properties",Jo="$stored_group_properties",Ko="$surveys",Qo="$flag_call_reported",ts="$user_state",es="$client_session_props",rs="$capture_rate_limit",is="$initial_campaign_params",ns="$initial_referrer_info",os="$initial_person_info",ss="$epp",as="__POSTHOG_TOOLBAR__",ls="$posthog_cookieless",us=[Ro,Fo,"__cmpns",Oo,"$session_recording_enabled_server_side",Lo,Yo,zo,Bo,ts,Wo,Uo,Jo,Xo,Ko,Qo,es,rs,is,ns,ss,os,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function hs(t){return t instanceof Element&&(t.id===as||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function cs(t){return!!t&&1===t.nodeType}function ds(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function vs(t){return!!t&&3===t.nodeType}function fs(t){return!!t&&11===t.nodeType}function ps(t){return t?Vr(t).split(/\s+/):[]}function gs(t){var e=null==Yn?void 0:Yn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ms(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ps(e)}function ys(t){return ni(t)?null:Vr(t).split(/(\s+)/).filter((t=>Zs(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function bs(t){var e="";return Ns(t)&&!Rs(t)&&t.childNodes&&t.childNodes.length&&vo(t.childNodes,(function(t){var r;vs(t)&&t.textContent&&(e+=null!==(r=ys(t.textContent))&&void 0!==r?r:"")})),Vr(e)}function _s(t){return ti(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ws=["a","button","form","input","select","textarea","label"];function Cs(t,e){if(ti(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Is(t){var e=t.parentNode;return!(!e||!cs(e))&&e}var Ss=["next","previous","prev",">","<"],ks=10;var xs=[".ph-no-rageclick",".ph-no-capture"];function As(t,e){if(!Yn||Ts(t))return!1;var r,i,n;si(e)?(r=!!e&&xs,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:xs,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Es(t,!1);return!function(t,e){if(!1===t||ti(t))return!1;var r;if(!0===t)r=Ss;else{if(!Ur(t))return!1;if(t.length>ks)return lo.error("[PostHog] content_ignorelist array cannot exceed "+ks+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,o.map((t=>{var e;return{safeText:bs(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Cs(o,r)}var Ts=t=>!t||ds(t,"html")||!cs(t),Es=(t,e)=>{if(!Yn||Ts(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!ds(n,"body");)if(fs(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=Is(n);if(!o)break;if(e||ws.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Yn.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Ms(t,e,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!Yn||Ts(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!gs(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&gs(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Es(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ti(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!Cs(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ws.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ns(t){for(var e=t;e.parentNode&&!ds(e,"body");e=e.parentNode){var r=ms(e);if(Hr(r,"ph-sensitive")||Hr(r,"ph-no-capture"))return!1}if(Hr(ms(t),"ph-include"))return!0;var i=t.type||"";if(ei(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ei(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 Rs(t){return!!(ds(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ds(t,"select")||ds(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fs="(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})",Os=new RegExp("^(?:"+Fs+")$"),Ps=new RegExp(Fs),Ls="\\d{3}-?\\d{2}-?\\d{4}",Ds=new RegExp("^("+Ls+")$"),Bs=new RegExp("("+Ls+")");function Zs(t,e){if(void 0===e&&(e=!0),ni(t))return!1;if(ei(t)){if(t=Vr(t),(e?Os:Ps).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Ds:Bs).test(t))return!1}return!0}function $s(t){var e=bs(t);return Zs(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&vo(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=bs(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){lo.error("[AutoCapture]",t)}})),e}function Hs(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return go(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Vs(e.toString())]=Vs(r.toString())})),n+=":",n+=go(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:js(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return go(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Vs(t){return t.replace(/"|\\"/g,'\\"')}function js(t){var e=t.attr__class;return e?Ur(e)?e:ps(e):void 0}var Ys={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,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"]},Gs=uo("[Recorder]"),zs=t=>"navigation"===t.entryType,Ws=t=>"resource"===t.entryType;function Us(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>zs(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ra({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>zs(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ra({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Xs(t,e){return!!e&&(si(e)||e[t])}function Js(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(si(r))return!0;if(Ur(r))return o(r);var s=r[e];return si(s)?s:o(s)}function Ks(t,e,r,i,n,o){return Qs.apply(this,arguments)}function Qs(){return Qs=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return Gs.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ws(t)&&t.initiatorType===e&&(ti(i)||t.startTime>=i)&&(ti(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Ks(t,e,r,i,n,o+1))})),Qs.apply(this,arguments)}function ta(t){var{body:e,options:r,url:i}=t;if(ni(e))return null;var{hostname:n,isHostDenied:o}=No(i,r);if(o)return n+" is in deny list";if(ei(e))return e;if(oo(e))return e.textContent;if(ai(e))return xo(e);if(Kr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ea=t=>!ii(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ra(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:ti(a)?void 0:Math.round(a),endTime:ti(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ea(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ia=["video/","audio/"];function na(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function oa(){return oa=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=No(i,r);return o?Promise.resolve(n+" is in deny list"):na(e)})),oa.apply(this,arguments)}function sa(){return sa=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=ia.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=No(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return ii(n)?na(e):Promise.resolve(n)})),sa.apply(this,arguments)}function aa(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xs("request",i.recordHeaders),o=Xs("response",i.recordHeaders),s=Mo(r,"fetch",(s=>function(){var a=e((function*(e,a){var l,u,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Js({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return oa.apply(this,arguments)}({r:c,options:i,url:e})),u=r.performance.now(),l=yield s(c),h=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Js({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return sa.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Ks(r,"fetch",c.url,u,h).then((e=>{var r,i=ra({entry:e,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var la=null;function ua(t,e,i){if(!("performance"in e))return()=>{};if(la)return Gs.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Ys,i):Ys,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Us(o,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),o=Mo(e.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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Js({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ta({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Js({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ta({body:v.response,options:r,url:a})),Ks(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ra({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),l,u,h)}));return()=>{o()}}(o,e,n),l=aa(o,e,n)),la=()=>{s(),a(),l(),la=null}}var ha=t=>({name:"rrweb/network@1",observer:ua,options:t});io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ha},io.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},io.rrweb={record:Ze,version:"v2"},io.rrwebConsoleRecord={getRecordConsolePlugin:Br},io.getRecordNetworkPlugin=ha;var ca,da,va,fa,pa,ga,ma,ya,ba={},_a=[],wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ca=Array.isArray;function Ia(t,e){for(var r in e)t[r]=e[r];return t}function Sa(t){var e=t.parentNode;e&&e.removeChild(t)}function ka(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?ca.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return xa(t,s,i,n,null)}function xa(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++va:n,__i:-1,__u:0};return null==n&&null!=da.vnode&&da.vnode(o),o}function Aa(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function Ea(t,e){if(null==e)return t.__?Ea(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ea(t):null}function Ma(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ma(t)}}function Na(t){(!t.__d&&(t.__d=!0)&&fa.push(t)&&!Ra.__r++||pa!==da.debounceRendering)&&((pa=da.debounceRendering)||ga)(Ra)}function Ra(){var t,e,r,i,n,o,s,a,l;for(fa.sort(ma);t=fa.shift();)t.__d&&(e=fa.length,i=void 0,o=(n=(r=t).__v).__e,a=[],l=[],(s=r.__P)&&((i=Ia({},n)).__v=n.__v+1,da.vnode&&da.vnode(i),$a(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?Ea(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,qa(a,i,l),i.__e!=o&&Ma(i)),fa.length>e&&fa.sort(ma));Ra.__r=0}function Fa(t,e,r,i,n,o,s,a,l,u,h){var c,d,v,f,p,g=i&&i.__k||_a,m=e.length;for(r.__d=l,function(t,e,r){var i,n,o,s,a,l=e.length,u=r.length,h=u,c=0;for(t.__k=[],i=0;i<l;i++)null!=(n=t.__k[i]=null==(n=e[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?xa(null,n,null,null,n):Ca(n)?xa(Aa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?xa(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Pa(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==t.__d&&(t.__d=Ea(o)),Va(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==t.__d&&(t.__d=Ea(o)),Va(o,o))}(r,e,g),l=r.__d,c=0;c<m;c++)null!=(v=r.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ba:g[v.__i]||ba,v.__i=c,$a(t,v,d,n,o,s,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ha(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=Oa(v,l,t):"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 Oa(t,e,r){var i,n;if("function"==typeof t.type){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=Oa(i[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Pa(t,e,r,i){var n=t.key,o=t.type,s=r-1,a=r+1,l=e[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<e.length;){if(s>=0){if((l=e[s])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function La(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||wa.test(e)?r:r+"px"}function Da(t,e,r,i,n){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||La(t.style,e,"");if(r)for(e in r)i&&r[e]===i[e]||La(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=Date.now(),t.addEventListener(e,o?Za:Ba,o)):t.removeEventListener(e,o?Za:Ba,o);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function Ba(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(da.event?da.event(t):t)}function Za(t){return this.l[t.type+!0](da.event?da.event(t):t)}function $a(t,e,r,i,n,o,s,a,l,u){var h,c,d,v,f,p,g,m,y,b,_,$,w,C,I,S=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(h=da.__b)&&h(e);t:if("function"==typeof S)try{if(m=e.props,y=(h=S.contextType)&&i[h.__c],b=h?y?y.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:("prototype"in S&&S.prototype.render?e.__c=c=new S(m,b):(e.__c=c=new Ta(m,b),c.constructor=S,c.render=ja),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=Ia({},c.__s)),Ia(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,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)||e.__v===r.__v)){for(e.__v!==r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[],c.__h.length&&s.push(c);break t}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=t,c.__e=!1,$=da.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(e),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,$&&$(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(i=Ia(Ia({},i),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Fa(t,Ca(I=null!=h&&h.type===Aa&&null==h.key?h.props.children:h)?I:[I],e,r,i,n,o,s,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(t){e.__v=null,l||null!=o?(e.__e=a,e.__u|=l?160:32,o[o.indexOf(a)]=null):(e.__e=r.__e,e.__k=r.__k),da.__e(t,e,r)}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=function(t,e,r,i,n,o,s,a,l){var u,h,c,d,v,f,p,g=r.props,m=e.props,y=e.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)){t=v,o[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=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&&t.data===m||(t.data=m);else{if(o=o&&ca.call(t.childNodes),g=r.props||ba,!a&&null!=o)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||Da(t,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||Da(t,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Fa(t,Ca(d)?d:[d],e,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&Ea(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&Sa(o[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Da(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Da(t,u,p,g[u],!1))}return t}(r.__e,e,r,i,n,o,s,l,u);(h=da.diffed)&&h(e)}function qa(t,e,r){e.__d=void 0;for(var i=0;i<r.length;i++)Ha(r[i],r[++i],r[++i]);da.__c&&da.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){da.__e(t,e.__v)}}))}function Ha(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){da.__e(t,r)}}function Va(t,e,r){var i,n;if(da.unmount&&da.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Ha(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){da.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Va(i[n],e,r||"function"!=typeof t.type);r||null==t.__e||Sa(t.__e),t.__=t.__e=t.__d=void 0}function ja(t,e,r){return this.constructor(t,r)}function Ya(t,e,r){var i,n,o;da.__&&da.__(t,e),i=!1?null:e.__k,n=[],o=[],$a(e,t=e.__k=ka(Aa,null,[t]),i||ba,ba,void 0!==e.ownerSVGElement,i?null:e.firstChild?ca.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),qa(n,t,o)}function Ga(t,e,r){var i,n,o,s,a=Ia({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&void 0!==s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?ca.call(arguments,2):r),xa(t.type,a,i||t.key,n||t.ref,null)}ca=_a.slice,da={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},va=0,Ta.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ia({},this.state),"function"==typeof t&&(t=t(Ia({},r),this.props)),t&&Ia(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Na(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Na(this))},Ta.prototype.render=Aa,fa=[],ga="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ma=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ya=0;var za,Wa,Ua,Xa,Ja=0,Ka=[],Qa=[],tl=da.__b,el=da.__r,rl=da.diffed,il=da.__c,nl=da.unmount;function ol(t,e){da.__h&&da.__h(Wa,t,Ja||e),Ja=0;var r=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Qa}),r.__[t]}function sl(t){return Ja=1,function(t,e,r){var i=ol(za++,2);if(i.t=t,!i.__c&&(i.__=[ml(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Wa,!Wa.u)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&i.__c.props===t)&&(!o||o.call(this,t,e,r))};Wa.u=!0;var o=Wa.shouldComponentUpdate,s=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Wa.shouldComponentUpdate=n}return i.__N||i.__}(ml,t)}function al(t,e){var r=ol(za++,3);!da.__s&&gl(r.__H,e)&&(r.__=t,r.i=e,Wa.__H.__h.push(r))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var r=ol(za++,7);return gl(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function hl(t){var e=Wa.context[t.__c],r=ol(za++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Wa)),e.props.value):t.__}function cl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fl),t.__H.__h.forEach(pl),t.__H.__h=[]}catch(e){t.__H.__h=[],da.__e(e,t.__v)}}da.__b=function(t){Wa=null,tl&&tl(t)},da.__r=function(t){el&&el(t),za=0;var e=(Wa=t.__c).__H;e&&(Ua===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Qa,t.__N=t.i=void 0}))):(e.__h.forEach(fl),e.__h.forEach(pl),e.__h=[],za=0)),Ua=Wa},da.diffed=function(t){rl&&rl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===da.requestAnimationFrame||((Xa=da.requestAnimationFrame)||vl)(cl)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Qa&&(t.__=t.__V),t.i=void 0,t.__V=Qa}))),Ua=Wa=null},da.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],da.__e(r,t.__v)}})),il&&il(t,e)},da.unmount=function(t){nl&&nl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{fl(t)}catch(t){e=t}})),r.__H=void 0,e&&da.__e(e,r.__v))};var dl="function"==typeof requestAnimationFrame;function vl(t){var e,r=function(){clearTimeout(i),dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,100);dl&&(e=requestAnimationFrame(r))}function fl(t){var e=Wa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Wa=e}function pl(t){var e=Wa;t.__c=t.__(),Wa=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),bl=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),_l=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),wl=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Cl=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Il=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Sl=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),kl=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),xl=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Al=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Tl=function(t){return t.Popover="popover",t.Inline="inline",t}({}),El=uo("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Nl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Rl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Fl="seenSurvey_",Ol="inProgressSurvey_",Pl=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},Ll=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Dl=t=>Ll(Fl,t),Bl=t=>{localStorage.getItem(Dl(t))||localStorage.setItem(Dl(t),"true")},Zl=[Cl.Popover,Cl.Widget,Cl.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return oi(t)&&isFinite(t)&&Math.floor(t)===t});var ql="0123456789abcdef";class Hl{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,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 Hl(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+ql.charAt(this.bytes[e]>>>4)+ql.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Hl(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Vl{constructor(){this.T=0,this.M=0,this.N=new Gl}generate(){var t=this.generateOrAbort();if(ti(t)){this.T=0;var e=this.generateOrAbort();if(ti(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.T)this.T=t,this.R();else{if(!(t+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return Hl.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 jl,Yl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!ti(Yn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Gl{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(Yl(this.F),this.O=0),this.F[this.O++]}}var zl=()=>Wl().toString(),Wl=()=>(jl||(jl=new Vl)).generate(),Ul=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Xl=["fatal","error","warning","log","info","debug"],Jl=Uint8Array,Kl=Uint16Array,Ql=Uint32Array,tu=new Jl([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 Jl([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]),ru=new Jl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iu=function(t,e){for(var r=new Kl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Ql(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]},nu=iu(tu,2),ou=nu[0],su=nu[1];ou[28]=258,su[258]=28;for(var au=iu(eu,0)[1],lu=new Kl(32768),uu=0;uu<32768;++uu){var hu=(43690&uu)>>>1|(21845&uu)<<1;hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4,lu[uu]=((65280&hu)>>>8|(255&hu)<<8)>>>1}var cu=function(t,e,r){for(var i=t.length,n=0,o=new Kl(e);n<i;++n)++o[t[n]-1];var s,a=new Kl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new Kl(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[lu[c]>>>l]=u}else for(s=new Kl(i),n=0;n<i;++n)s[n]=lu[a[t[n]-1]++]>>>15-t[n];return s},du=new Jl(288);for(uu=0;uu<144;++uu)du[uu]=8;for(uu=144;uu<256;++uu)du[uu]=9;for(uu=256;uu<280;++uu)du[uu]=7;for(uu=280;uu<288;++uu)du[uu]=8;var vu=new Jl(32);for(uu=0;uu<32;++uu)vu[uu]=5;var fu=cu(du,9,0),pu=cu(vu,5,0),gu=function(t){return(t/8>>0)+(7&t&&1)},mu=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Kl?Kl:t instanceof Ql?Ql:Jl)(r-e);return i.set(t.subarray(e,r)),i},yu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},bu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},_u=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new Jl(0),0];if(1==n){var s=new Jl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.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 Kl(d+1),f=wu(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=o[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new Jl(v),f]},wu=function(t,e,r){return-1==t.s?Math.max(wu(t.l,e,r+1),wu(t.r,e,r+1)):e[t.s]=r},Cu=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Kl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++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=t[a]}return[r.subarray(0,i),e]},Iu=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Su=function(t,e,r){var i=r.length,n=gu(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},ku=function(t,e,r,i,n,o,s,a,l,u,h){yu(e,h++,r),++n[256];for(var c=_u(n,15),d=c[0],v=c[1],f=_u(o,15),p=f[0],g=f[1],m=Cu(d),y=m[0],b=m[1],_=Cu(p),w=_[0],C=_[1],I=new Kl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<w.length;++S)I[31&w[S]]++;for(var k=_u(I,7),x=k[0],A=k[1],T=19;T>4&&!x[ru[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Iu(n,du)+Iu(o,vu)+s,P=Iu(n,d)+Iu(o,p)+s+14+3*T+Iu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Su(e,h,t.subarray(l,l+u));if(yu(e,h,1+(P<O)),h+=2,P<O){E=cu(d,v,0),M=d,N=cu(p,g,0),R=p;var L=cu(x,A,0);yu(e,h,b-257),yu(e,h+5,C-1),yu(e,h+10,T-4),h+=14;for(S=0;S<T;++S)yu(e,h+3*S,x[ru[S]]);h+=3*T;for(var D=[y,w],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];yu(e,h,L[q]),h+=x[q],q>15&&(yu(e,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=fu,M=du,N=pu,R=vu;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;bu(e,h,E[q+257]),h+=M[q+257],q>7&&(yu(e,h,i[S]>>>23&31),h+=tu[q]);var H=31&i[S];bu(e,h,N[H]),h+=R[H],H>3&&(bu(e,h,i[S]>>>5&8191),h+=eu[H])}else bu(e,h,E[i[S]]),h+=M[i[S]];return bu(e,h,E[256]),h+M[256]},xu=new Ql([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Au=function(){for(var t=new Ql(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Tu=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new Jl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?u=Su(l,u,t.subarray(h,c)):(l[h]=o,u=Su(l,u,t.subarray(h,s)))}else{for(var d=xu[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Kl(32768),m=new Kl(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ql(25e3),C=new Kl(288),I=new Kl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=_(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=ku(t,l,0,w,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==_(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(t[h+O]==t[h+O-D]){for(var H=0;H<q&&t[h+H]==t[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){w[x++]=268435456|su[O]<<18|au[P];var z=31&su[O],W=31&au[P];k+=tu[z]+eu[W],++C[257+z],++I[W],A=h+O,++S}else w[x++]=t[h],++C[t[h]]}}u=ku(t,l,o,w,C,I,k,x,T,h-T,u)}return mu(a,0,i+gu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Eu=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Mu(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Au[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Tu(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Eu(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Eu(n,o-8,r.d()),Eu(n,o-4,i),n}var Nu=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.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>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Ru=!!to||!!Qn,Fu="text/plain",Ou=function(t,e,i){var n;void 0===i&&(i=!0);var[o,s]=t.split("?"),a=r({},e),l=null!==(n=null==s?void 0:s.split("&").map((t=>{var e,[r,n]=t.split("="),o=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],u=xo(a);return u&&l.push(u),o+"?"+l.join("&")},Pu=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Lu=t=>{var{data:e,compression:r}=t;if(e){if(r===Ul.GZipJS){var i=Mu(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Jl(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new Jl(n+8+(r-s<<1));a.set(i),i=a}var l=t.charCodeAt(s);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&t.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 mu(i,0,n)}(Pu(e)),{mtime:0}),n=new Blob([i],{type:Fu});return{contentType:Fu,body:n,estimatedSize:n.size}}if(r===Ul.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=Nu(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[l++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Pu(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Pu(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Pu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Du=[];Qn&&Du.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=Lu(t))&&void 0!==e?e:{},a=new Headers;vo(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(eo){var h=new eo;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Qn(l,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){lo.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{lo.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),to&&Du.push({transport:"XHR",method:t=>{var e,r=new to;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Lu(t))&&void 0!==e?e:{};vo(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Xn&&Xn.sendBeacon&&Du.push({transport:"sendBeacon",method:t=>{var e=Ou(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Lu(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Xn.sendBeacon(e,o)}catch(t){}}});var Bu=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Zu(t,e,r){return Pu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var $u={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Bu(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Bu(e,t))))),icontains:(t,e)=>e.map(qu).some((e=>t.map(qu).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(qu).every((e=>t.map(qu).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},qu=t=>t.toLowerCase();function Hu(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ti(n)||ii(n))return!1;var o=[String(n)],s=$u[i.operator];return!!s&&s(i.values,o)}))}var Vu=uo("[Stylesheet Loader]"),ju=Yn,Yu=Jn;function Gu(t){return"$survey_response_"+t}var zu="#020617",Wu={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:_l.Right,widgetType:bl.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:zu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Uu(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Xu(t){var e;void 0===t&&(t=Wu.backgroundColor),"#"===t[0]&&(e=Uu(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Uu(r)),!e)return zu;var i=e.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?zu:"white"}return zu}function Ju(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Vu.error("prepare_external_dependency_stylesheet returned null"),null)})(Yu,':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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Ku=(t,e,i)=>{var n=bh(t),o=Yu.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Yu.createElement("div");((t,e,i)=>{var n=r({},Wu,i),o=t.style,s=![_l.Center,_l.Left,_l.Right].includes(n.position)||e===Cl.Widget&&(null==i?void 0:i.widgetType)===bl.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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)||Xu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Xu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Xu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Xu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),o.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Xu(l);o.setProperty("--ph-survey-input-text-color",u),o.setProperty("--ph-survey-rating-text-color",u),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,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Ju(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Yu.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Qu=(t,e)=>{if(!e)return null;var r=t[Gu(e)];return Ur(r)?[...r]:r},th=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=t;o?(Bl(i),o.capture(xl.SENT,r({[Al.SURVEY_NAME]:i.name,[Al.SURVEY_ID]:i.id,[Al.SURVEY_ITERATION]:i.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Al.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:Qu(e,t.id)}))),[Al.SURVEY_SUBMISSION_ID]:n,[Al.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,{$set:{[Pl(i,"responded")]:!0}})),s&&(ju.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),yh(i))):El.error("[survey sent] event not captured, PostHog instance not found.")},eh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!ni(t))).length>0,rh=(t,e,i)=>r({[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Al.SURVEY_PARTIALLY_COMPLETED]:eh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Al.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Al.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Qu((null==e?void 0:e.responses)||{},t.id)})))}),ih=(t,e,i)=>{if(e){if(!i){var n=gh(t);e.capture(xl.DISMISSED,r({},rh(t,n,e),{$set:{[Pl(t,"dismissed")]:!0}})),yh(t),Bl(t),ju.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else El.error("[survey dismissed] event not captured, PostHog instance not found.")},nh=(t,e)=>{if(e){var r=(t=>Ll("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=gh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(xl.ABANDONED,rh(t,i,e),{transport:"sendBeacon"})}}else El.error("[survey abandoned] event not captured, PostHog instance not found.")},oh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),sh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ah=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,oh(t.questions)):t.questions,lh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===kl.Always||mh(t)},uh=function(t,e){var r={__c:e="__cC"+ya++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i;return this.getChildContext||(r=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Na(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),hh=()=>hl(uh),ch=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return Ga(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function dh(t){return null!=t?t:"icontains"}function vh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==ju||null==(r=ju.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=dh(null==(i=t.conditions)?void 0:i.urlMatchType);return $u[s](o,[n])}var fh=t=>{var e=""+Ol+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ol+t.id+"_"+t.current_iteration),e},ph=(t,e)=>{try{localStorage.setItem(fh(t),JSON.stringify(e))}catch(t){El.error("Error setting in-progress survey state in localStorage",t)}},gh=t=>{try{var e=localStorage.getItem(fh(t));if(e)return JSON.parse(e)}catch(t){El.error("Error getting in-progress survey state from localStorage",t)}return null},mh=t=>{var e=gh(t);return!ni(null==e?void 0:e.surveySubmissionId)},yh=t=>{try{localStorage.removeItem(fh(t))}catch(t){El.error("Error clearing in-progress survey state from localStorage",t)}};function bh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}var _h=0;function wh(t,e,r,i,n,o){var s,a,l={};for(a in e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--_h,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return da.vnode&&da.vnode(u),u}var Ch=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Ih=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Sh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),kh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),xh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Ah=wh("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:[wh("title",{id:"close-survey-title",children:"Close survey"}),wh("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"})]}),Th=wh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wh("g",{"clip-path":"url(#clip0_2415_6911)",children:[wh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wh("g",{mask:"url(#mask0_2415_6911)",children:[wh("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"}),wh("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"}),wh("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"}),wh("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"}),wh("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"}),wh("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"})]})]}),wh("defs",{children:wh("clipPath",{id:"clip0_2415_6911",children:wh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Eh(){return wh("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Th]})}function Mh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:l}=hl(uh);return wh("div",{className:"bottom-section",children:[!a&&wh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Yn||Yn.open(o)),l?null==s||s():n()},children:e}),!i.whiteLabel&&wh(Eh,{})]})}function Nh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return wh("div",{class:"question-header",children:[wh(e.type===Il.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&ch({component:ka("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Rh(t){var{onClick:e}=t,{isPreviewMode:r}=hl(uh);return wh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Ah})}wh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wh("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 Fh=Yn;function Oh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=hl(uh);return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return So(Fh,"keydown",t),()=>{Fh.removeEventListener("keydown",t)}}),[s]),wh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&wh(Rh,{onClick:()=>s()}),wh("h3",{className:"thank-you-message-header",children:e}),r&&ch({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&wh(Mh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Ph=t=>Ur(t)&&t.every((t=>ei(t)));function Lh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:l}=hh(),u=ll(null),[h,c]=sl((()=>ei(a)?a:""));al((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+s;return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:r,htmlFor:d}),wh("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Dh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return wh(Aa,{children:[wh("div",{className:"question-container",children:wh(Nh,{question:e,forceDisableHtml:r})}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Bh(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[h,c]=sl((()=>oi(a)?a:Ur(a)&&a.length>0&&oi(parseInt(a[0]))?parseInt(a[0]):ei(a)&&oi(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=hh(),v=t=>d?s(t):o(t);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:r}),wh("div",{className:"rating-section",children:[wh("div",{className:"rating-options",children:["emoji"===e.display&&wh("div",{className:"rating-options-emoji",children:(3===e.scale?qh:Hh).map(((t,r)=>wh("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 t=r+1;c(t),e.skipSubmitButton&&v(t)},children:t},r)))}),"number"===e.display&&wh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Gh(e.scale).map(((t,r)=>wh(Zh,{displayQuestionIndex:i,active:h===t,appearance:n,num:t,setActiveNumber:t=>{c(t),e.skipSubmitButton&&v(t)}},r)))})]}),wh("div",{className:"rating-text",children:[wh("div",{children:e.lowerBoundLabel}),wh("div",{children:e.upperBoundLabel})]})]})]}),wh(Mh,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(h)&&!e.optional,appearance:n,onSubmit:()=>o(h),onPreviewSubmit:()=>s(h),skipSubmitButton:e.skipSubmitButton})]})}function Zh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return wh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function $h(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u=ll(null),h=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=sh(e,oh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=sl((()=>((t,e)=>ei(t)||Ph(t)?t:e===Il.SingleChoice?null:[])(l,e.type))),[v,f]=sl((()=>((t,e)=>{if(ei(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Ph(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=hh(),g=e.type===Il.SingleChoice,m=e.type===Il.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Ur(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.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 wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:i}),wh("fieldset",{className:"multiple-choice-options limit-height",children:[wh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===t:Ur(c)&&c.includes(t);return wh("label",{className:i?"choice-option-open":"",children:[wh("div",{className:"response-choice",children:[wh("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),wh("span",{children:i?t+":":t})]}),i&&wh("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:w,onInput:_,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var qh=[Sh,Ih,Ch],Hh=[kh,Sh,Ih,Ch,xh],Vh=[1,2,3,4,5],jh=[1,2,3,4,5,6,7],Yh=[0,1,2,3,4,5,6,7,8,9,10];function Gh(t){switch(t){case 5:default:return Vh;case 7:return jh;case 10:return Yh}}var zh=Yn,Wh=Jn,Uh="ph:show_survey_widget",Xh="PHWidgetSurveyClickListener";function Jh(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Sl.End:o;if(n.branching.type===Sl.End)return Sl.End;if(n.branching.type===Sl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Sl.ResponseBased){if(n.type===Il.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===Sl.End?Sl.End:o}}else if(n.type===Il.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=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===Sl.End?Sl.End:o}}return o}return El.warn("Falling back to next question index due to unexpected branching type"),o}var Kh=250,Qh=20,tc=12;class ec{constructor(t){var e=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Ko);if(t)for(var e of t)mh(e)&&nh(e,this._posthog)},this.handlePopoverSurvey=t=>{var e;this.B(t.id),this.Z(t);var i=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Ku(t,this._posthog);if(i<=0)return Ya(wh(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),n);var o=setTimeout((()=>{if(this.P.delete(t.id),!vh(t))return this.$(t);Ya(wh(sc,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*i);this.P.set(t.id,o)},this.q=t=>{var{shadow:e,isNewlyCreated:r}=Ku(t,this._posthog);r&&Ya(wh(lc,{posthog:this._posthog,survey:t},t.id),e)},this.H=t=>{this.V(t);var e=this.L.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Xh),this.L.delete(t.id),El.info("Removed click listener for survey "+t.id))},this.j=(t,e)=>{var r=Wh.querySelector(e),i=this.L.get(t.id);if(r){if(this.q(t),i){if(r===i.element)return;El.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.H(t)}if(!r.hasAttribute(Xh)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===_l.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=zh.innerHeight,n=zh.innerWidth,o=Kh,s=r.left+r.width/2-e/2;s+e>n-Qh&&(s=n-e-Qh),s<Qh&&(s=Qh);var a=tc,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:Wu.zIndex}}catch(t){return El.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Wu.maxWidth)):{};zh.dispatchEvent(new CustomEvent(Uh,{detail:{surveyId:t.id,position:n}}))};So(r,"click",n),r.setAttribute(Xh,"true"),this.L.set(t.id,{element:r,listener:n,survey:t}),El.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.H(t)},this.renderPopover=t=>{var{shadow:e}=Ku(t,this._posthog);Ya(wh(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),e)},this.renderSurvey=(t,e)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this.Y(t),Ya(wh(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.W(t)&&e.U(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Cl.Popover||t.type===Cl.Widget)),i=e.X(r),n=new Set;i.forEach((t=>{if(t.type===Cl.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Tab)return void e.q(t);if((null==(i=t.appearance)?void 0:i.widgetType)===bl.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.j(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ii(e.J)&&t.type===Cl.Popover&&e.handlePopoverSurvey(t)})),e.L.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.H(r)}))}),t)},this.Z=t=>{ii(this.J)||El.error("Survey "+this.J+" already in focus. Cannot add survey "+t.id+"."),this.J=t.id},this.$=t=>{this.J!==t.id&&El.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.B(t.id),this.J=null,this.V(t)},this._posthog=t,this.J=null}B(t){var e=this.P.get(t);e&&(clearTimeout(e),this.P.delete(t))}cancelSurvey(t){this.P.has(t)&&(El.info("Cancelled pending survey "+t),this.B(t),this.J===t&&(this.J=null))}X(t){return t.sort(((t,e)=>{var r,i,n=mh(t),o=mh(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===kl.Always,a=e.schedule===kl.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}Y(t){if(!this.D.has(t.id))try{var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ti(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);e[c]||(e[c]=[]),e[c].push(u)}}else r=!0}}return{params:e,autoSubmit:r}}(zh.location.search);if(0===Object.keys(e).length)return;El.info("[Survey Prefill] Detected URL prefill parameters");var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],o=Gu(t.id);try{switch(t.type){case Il.SingleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=t.choices.length)return void lo.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[s];break;case Il.MultipleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void lo.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];l.length<a.length&&lo.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=l;break;case Il.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||u<0||u>h)return void lo.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=u;break;default:lo.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){lo.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return void El.warn("[Survey Prefill] No valid responses after conversion");var i=zl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:s}=function(t,e,r){for(var i=0,n={},o=0;o<t.length&&e.includes(o);o++){var s=t[o];if(!(s&&"skipSubmitButton"in s&&s.skipSubmitButton))break;if(i=o+1,s.id){var a=Gu(s.id);ti(r[a])||(n[a]=r[a])}}return{startQuestionIndex:i,skippedResponses:n}}(t.questions,n,r),a=o>=t.questions.length;ph(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?t.questions.length-1:o}),El.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(s).length>0&&t.enable_partial_responses||a)&&th({responses:a?r:s,survey:t,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this.D.add(t.id)}catch(t){El.error("[Survey Prefill] Error handling URL prefill:",t)}}K(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}G(t){return!t.conditions||vh(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!ro)return!1;var n=mn(ro);return $u[dh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Yu||!Yu.querySelector(t.conditions.selector))}(t)}tt(t){return lh(t)||this.K(t.internal_targeting_flag_key)||mh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Ml(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Zl.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.K(t.linked_flag_key,n)?this.K(t.targeting_flag_key)?this.tt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Dl(t))&&!lh(t))(t)?(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(t){var e;if(!Nl(t)&&!Rl(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.K(r)}))}V(t){try{var e=Wh.querySelector(bh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){El.warn("Failed to remove survey "+t.id+" from DOM:",e)}}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.K.bind(this)}}}function rc(t,e){if(Wh&&zh){var r,i=new ec(t);if(t.config.disable_surveys_automatic_display)return El.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return El.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ti(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),So(Wh,"visibilitychange",(()=>{Wh.hidden?ti(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function ic(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;al((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===Cl.Widget,o=vh(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&n;if(!o)return El.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(El.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};So(zh,"popstate",o),So(zh,"hashchange",o);var s=zh.history.pushState,a=zh.history.replaceState;return zh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},zh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{zh.removeEventListener("popstate",o),zh.removeEventListener("hashchange",o),zh.history.pushState=s,zh.history.replaceState=a}}}),[n,e,r,i])}function nc(t,e,r){if(void 0===e&&(e=_l.Right),t===Cl.ExternalSurvey)return{};switch(e){case _l.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case _l.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case _l.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case _l.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case _l.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case _l.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case _l.Left:return{left:"30px"};case _l.Center:return{left:"50%",transform:"translateX(-50%)"};default:case _l.Right:return{right:t===Cl.Widget&&r===bl.Tab?"60px":"30px"}}}function oc(t){switch(void 0===t&&(t=wl.Right),t){case wl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case wl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case wl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case wl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function sc(t){var e,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=(()=>{})}=t,y=ll(null),b=Number.isInteger(d),_=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:w,isSurveySent:C,hidePopupWithViewTransition:I}=function(t,e,r,i,n,o,s){var[a,l]=sl(i||0===r||t.type===Cl.ExternalSurvey),[u,h]=sl(!1),c=()=>{var e=()=>{o&&n(t),l(!1)};Wh.startViewTransition?Wh.startViewTransition((()=>{var t;null==s||null==(t=s.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return al((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{vh(t)&&(l(!0),zh.dispatchEvent(new Event("PHSurveyShown")),e.capture(xl.SHOWN,{[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(So(zh,"PHSurveyClosed",d),So(zh,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),zh.removeEventListener("PHSurveyClosed",d),zh.removeEventListener("PHSurveySent",n)}}return o(),()=>{zh.removeEventListener("PHSurveyClosed",d),zh.removeEventListener("PHSurveySent",n)}}}else El.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ic({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,_,b,v,f,y),S=C||d===l.questions.length,k=ul((()=>{var t=gh(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{ih(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||zl(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return w?wh(uh.Provider,{value:k,children:wh("div",{className:"ph-survey",style:r({},nc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?wh(Oh,{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||Wu,onClose:()=>{I(),m()}}):wh(ac,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function ac(t){var e,{survey:i,forceDisableHtml:n,posthog:o}=t,[s,a]=sl((()=>{var t=gh(i);return null!=t&&t.responses&&El.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v}=hl(uh),[f,p]=sl((()=>{var t=gh(i);return l||(null==t?void 0:t.lastQuestionIndex)||0})),g=ul((()=>ah(i)),[i]);al((()=>{v&&!ti(l)&&p(l)}),[l,v]);var m=g.at(f);return m?wh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&wh(Rh,{onClick:()=>{u()}}),wh("div",{className:"survey-box",children:uc({question:m,forceDisableHtml:n,displayQuestionIndex:f,appearance:i.appearance||Wu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(o)if(l){var u=Gu(l),h=r({},s,{[u]:e});a(h);var c=Jh(i,n,e),v=c===Sl.End;v||(p(c),ph(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&th({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:o})}else El.error("onNextButtonClick called without a questionId.");else El.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:f,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?s[Gu(m.id)]:void 0})})]}):null}function lc(t){var e,r,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=sl(!0),[f,p]=sl(!1),[g,m]=sl({}),y=()=>{p(!f)};if(al((()=>{var t;if(h){if(!c){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(El.info("Received show event for feedback button survey "+l.id),m(r.detail.position||{}),y())};return So(zh,Uh,e),()=>{zh.removeEventListener(Uh,e)}}}else El.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),ic({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==kl.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return wh(Aa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&wh("button",{className:"ph-survey-widget-tab "+((null==(o=l.appearance)?void 0:o.tabPosition)===wl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:oc(null==(s=l.appearance)?void 0:s.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&wh(sc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var uc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case Il.Open:return ka(Lh,r({},u,{question:e,key:e.id}));case Il.Link:return ka(Dh,r({},u,{question:e,key:e.id}));case Il.Rating:return ka(Bh,r({},u,{question:e,key:e.id}));case Il.SingleChoice:case Il.MultipleChoice:return ka($h,r({},u,{question:e,key:e.id}));default:return El.error("Unsupported question type: "+e.type),null}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.generateSurveys=rc,io.extendPostHogWithSurveys=rc;var hc=uo("[Error tracking]");function cc(){return new _n([new On,new jn,new Ln,new Pn,new Hn,new qn,new Bn,new Vn],Fn())}class dc{constructor(t){var e,r;this.et=[],this.rt=cc(),this._instance=t,this.et=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Bo))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.et=n,this._instance.persistence&&this._instance.persistence.register({[Bo]:this.et,[Zo]:o})}get it(){var t,e=!!this._instance.get_property(Zo),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.rt.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.nt(e)){if(this.ot(e))return void hc.info("Skipping exception capture because a suppression rule matched");if(!this.it&&this.st(e))return void hc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ut(e))return void hc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ot(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ei(r)&&r.length>0&&t.$exception_types.push(r),ei(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.et.some((t=>{var r=t.values.map((t=>{var r,i=$u[t.operator],n=Ur(t.value)?t.value:[t.value],o=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}st(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ut(t){if(t.length>0){var e,r,i,n,o=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],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}nt(t){return!ni(t)&&Ur(t)}}var vc=uo("[ExceptionAutocapture]"),fc=cc(),pc={wrapOnError:t=>{var e=Yn;e||vc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n[4],a=n[0],l=fc.buildFromUnknown(s||a,{mechanism:{handled:!1}});return t(l),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Yn;e||vc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=fc.buildFromUnknown(i,{mechanism:{handled:!1}});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||vc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=i.find((t=>t instanceof Error)),a=fc.buildFromUnknown(s||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.errorWrappingFunctions=pc,io.posthogErrorWrappingFunctions=pc;var gc=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Ur(t)||t.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)}e!==ls&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};io.__PosthogExtensions__=io.__PosthogExtensions__||{};var mc={_patchFetch:(t,r,i)=>Mo(Yn,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return gc(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Mo(Yn.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return gc(t,e,r,u),i.call(this,n,u.url,s,a,l)}))};io.__PosthogExtensions__.tracingHeadersPatchFns=mc,io.postHogTracingHeadersPatchFns=mc;var yc,bc,_c=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},wc=function(t){if("loading"===document.readyState)return"loading";var e=_c();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},Cc=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Ic=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:Cc(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>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},Sc=-1,kc=function(){return Sc},xc=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Sc=e.timeStamp,t(e))}),!0)},Ac=function(){var t=_c();return t&&t.activationStart||0},Tc=function(t,e){var r=_c(),i="navigate";return kc()>=0?i="back-forward-cache":r&&(document.prerendering||Ac()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Ec=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},Mc=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},Nc=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Rc=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Fc=function(t){var e=!1;return function(){e||(t(),e=!0)}},Oc=-1,Pc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Lc=function(t){"hidden"===document.visibilityState&&Oc>-1&&(Oc="visibilitychange"===t.type?t.timeStamp:0,Bc())},Dc=function(){addEventListener("visibilitychange",Lc,!0),addEventListener("prerenderingchange",Lc,!0)},Bc=function(){removeEventListener("visibilitychange",Lc,!0),removeEventListener("prerenderingchange",Lc,!0)},Zc=function(){return Oc<0&&(Oc=Pc(),Dc(),xc((function(){setTimeout((function(){Oc=Pc(),Dc()}),0)}))),{get firstHiddenTime(){return Oc}}},$c=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},qc=[1800,3e3],Hc=function(t,e){e=e||{},$c((function(){var r,i=Zc(),n=Tc("FCP"),o=Ec("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Ac(),0),n.entries.push(t),r(!0)))}))}));o&&(r=Mc(t,n,qc,e.reportAllChanges),xc((function(i){n=Tc("FCP"),r=Mc(t,n,qc,e.reportAllChanges),Nc((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Vc=[.1,.25],jc=0,Yc=1/0,Gc=0,zc=function(t){t.forEach((function(t){t.interactionId&&(Yc=Math.min(Yc,t.interactionId),Gc=Math.max(Gc,t.interactionId),jc=Gc?(Gc-Yc)/7+1:0)}))},Wc=function(){return yc?jc:performance.interactionCount||0},Uc=function(){"interactionCount"in performance||yc||(yc=Ec("event",zc,{type:"event",buffered:!0,durationThreshold:0}))},Xc=[],Jc=new Map,Kc=0,Qc=[],td=function(t){if(Qc.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Xc[Xc.length-1],r=Jc.get(t.interactionId);if(r||Xc.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Jc.set(i.id,i),Xc.push(i)}Xc.sort((function(t,e){return e.latency-t.latency})),Xc.length>10&&Xc.splice(10).forEach((function(t){return Jc.delete(t.id)}))}}},ed=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=Fc(t),"hidden"===document.visibilityState?t():(r=e(t),Rc(t)),r},rd=[200,500],id=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},$c((function(){var r;Uc();var i,n=Tc("INP"),o=function(t){ed((function(){t.forEach(td);var e=function(){var t=Math.min(Xc.length-1,Math.floor((Wc()-Kc)/50));return Xc[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=Ec("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=Mc(t,n,rd,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Rc((function(){o(s.takeRecords()),i(!0)})),xc((function(){Kc=Wc(),Xc.length=0,Jc.clear(),n=Tc("INP"),i=Mc(t,n,rd,e.reportAllChanges)})))})))},nd=[],od=[],sd=0,ad=new WeakMap,ld=new Map,ud=-1,hd=function(t){nd=nd.concat(t),cd()},cd=function(){ud<0&&(ud=ed(dd))},dd=function(){ld.size>10&&ld.forEach((function(t,e){Jc.has(e)||ld.delete(e)}));var t=Xc.map((function(t){return ad.get(t.entries[0])})),e=od.length-50;od=od.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<od.length;i++){var n=od[i];vd(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=nd.length-1-50;nd=nd.filter((function(t,e){return t.startTime>sd&&e>o||r.has(t)})),ud=-1};Qc.push((function(t){t.interactionId&&t.target&&!ld.has(t.interactionId)&&ld.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;sd=Math.max(sd,t.processingEnd);for(var i=od.length-1;i>=0;i--){var n=od[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},od.push(e)),(t.interactionId||"first-input"===t.entryType)&&ad.set(t,e),cd()}));var vd=function(t,e){for(var r,i=[],n=0;r=nd[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},fd=[2500,4e3],pd={},gd={onLCP:function(t,e){!function(t,e){e=e||{},$c((function(){var r,i=Zc(),n=Tc("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Ac(),0),n.entries=[t],r())}))},s=Ec("largest-contentful-paint",o);if(s){r=Mc(t,n,fd,e.reportAllChanges);var a=Fc((function(){pd[n.id]||(o(s.takeRecords()),s.disconnect(),pd[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return ed(a)}),{once:!0,capture:!0})})),Rc(a),xc((function(i){n=Tc("LCP"),r=Mc(t,n,fd,e.reportAllChanges),Nc((function(){n.value=performance.now()-i.timeStamp,pd[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=_c();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.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);e={element:Ic(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Hc(Fc((function(){var r,i=Tc("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=Ec("layout-shift",s);a&&(r=Mc(t,i,Vc,e.reportAllChanges),Rc((function(){s(a.takeRecords()),r(!0)})),xc((function(){n=0,i=Tc("CLS",0),r=Mc(t,i,Vc,e.reportAllChanges),Nc((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:Ic(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:wc(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Hc((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:wc(kc())};if(t.entries.length){var r=_c(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:wc(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){bc||(bc=Ec("long-animation-frame",hd)),id((function(e){var r=function(t){var e=t.entries[0],r=ad.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=vd(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||ld.get(e.interactionId),u=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:Ic(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:wc(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(r)}),e)}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.postHogWebVitalsCallbacks=gd,io.postHogWebVitalsCallbacks=gd;class md{constructor(t){this.disabled=!1===t;var e=Kr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var yd="$copy_autocapture",bd=uo("[AutoCapture]");function _d(t,e){return e.length>t?e.slice(0,t)+"...":e}function wd(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!cs(e));return e}function Cd(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};ws.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=_d(1024,$s(t)):o.$el_text=_d(1024,bs(t)));var s=ms(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),vo(t.attributes,(function(r){var n;if((!Rs(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Zs(r.value)&&(n=r.name,!ei(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=ps(s).join(" ")),o["attr__"+r.name]=_d(1024,s)}}));for(var a=1,l=1,u=t;u=wd(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function Id(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],h=t;h.parentNode&&!ds(h,"body");)fs(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(vo(u,(t=>{var e=Ns(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zs(f)&&f),Hr(ms(t),"ph-no-capture")&&(p=!0),d.push(Cd(t,o,s,a));var r=function(t){if(!Ns(t))return{};var e={};return vo(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zs(i)&&(e[r]=i)}})),e}(t);fo(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$s(t):d[0].$el_text=bs(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=ko(f))?void 0:g.host,b=null==Yn||null==(m=Yn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:fo({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Hs(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 Sd{constructor(t){this.ht=!1,this.ct=null,this.dt=!1,this.instance=t,this.rageclicks=new md(t.config.rageclick),this.vt=null}get ft(){var t,e,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}yt(){if(this.isBrowserSupported()){if(Yn&&Jn){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.bt(t)}catch(t){bd.error("Failed to capture event",t)}};if(So(Jn,"submit",t,{capture:!0}),So(Jn,"change",t,{capture:!0}),So(Jn,"click",t,{capture:!0}),this.ft.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event),this.bt(t,yd)};So(Jn,"copy",e,{capture:!0}),So(Jn,"cut",e,{capture:!0})}}}else bd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ht&&(this.yt(),this.ht=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.dt=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Po]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.vt=t}getElementSelectors(t){var e,r=[];return null==(e=this.vt)||e.forEach((e=>{var i=null==Jn?void 0:Jn.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Po],i=this.ct;if(ii(i)&&!si(r)&&!this.instance._t())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}bt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_s(t);if(vs(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&As(i,this.instance.config.rageclick)&&this.bt(t,"$rageclick");var n=e===yd;if(i&&Ms(i,t,this.ft,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Id(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:this.dt});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===yd){var l,u=ys(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Xr(null==Jn?void 0:Jn.querySelectorAll)}}var kd={};function xd(t){return function(t,e){var r=kd[t];if(r)return r;var i=e[t];if(Jr(i)&&!no())return kd[t]=i.bind(e);var n=e.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[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){lo.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Xr(i)?kd[t]=i.bind(e):i}("MutationObserver",t)}function Ad(t,e){return oi(t)&&t>=e}class Td{wt(t){var e,r,i,n,o,s=this.Ct((null==t?void 0:t.__onCapture)||this.It.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(t,e){this.St=[],this.Ct=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.kt=t=>{var e=function(t){var e=_s(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ii(e)||this.xt(e)||this.St.push(e),this.St.length&&ti(this.At)&&(this.At=io.setTimeout((()=>{this.Tt()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.St.forEach((e=>{ti(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Mt=()=>{this.Nt=Date.now()},this.instance=t,this.ft=this.wt(e),this._onCapture=this.ft.__onCapture}start(t){this.Rt(),this.Ft(),this.Ot(),this.Pt(t)}Pt(t){if(!this.Lt){var e=xd(io);this.Lt=new e((t=>{this.Dt(t)})),this.Lt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Lt)||t.disconnect(),this.Lt=void 0,io.removeEventListener("click",this.kt),io.removeEventListener("scroll",this.Et,{capture:!0}),io.removeEventListener("selectionchange",this.Mt)}Dt(t){this.Bt=Date.now()}Rt(){So(io,"click",this.kt)}Ft(){So(io,"scroll",this.Et,{capture:!0})}Ot(){So(io,"selectionchange",this.Mt)}xt(t){if(!t)return!0;if(!this.ft.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(hs(t.node))return!0;var r=this.St.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!ds(t.node,"html")&&cs(t.node)&&!ws.includes(t.node.tagName.toLowerCase()))}Tt(){if(this.St.length){clearTimeout(this.At),this.At=void 0;var t=this.St;for(var e of(this.St=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Bt&&e.timestamp<=this.Bt?this.Bt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&e.timestamp<=this.Nt?this.Nt-e.timestamp:void 0;var i=Ad(e.scrollDelayMs,this.ft.scroll_threshold_ms),n=Ad(e.selectionChangedDelayMs,this.ft.selection_change_threshold_ms),o=Ad(e.mutationDelayMs,this.ft.mutation_threshold_ms),s=Ad(e.absoluteDelayMs,1.1*this.ft.mutation_threshold_ms),a=oi(e.scrollDelayMs)&&e.scrollDelayMs<this.ft.scroll_threshold_ms,l=oi(e.mutationDelayMs)&&e.mutationDelayMs<this.ft.mutation_threshold_ms,u=oi(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.ft.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.ft.mutation_threshold_ms&&this.St.push(e))}this.St.length&&ti(this.At)&&(this.At=io.setTimeout((()=>{this.Tt()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,Id(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Td(t,e);var Ed=uo("[ExternalScriptsLoader]"),Md=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Ed.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Jn?void 0:Jn.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Jn)return r("document not found");var i=Jn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Jn.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Jn.body.appendChild(i)};null!=Jn&&Jn.body?a():null==Jn||Jn.addEventListener("DOMContentLoaded",a)};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);Md(t,o,r)},io.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Md(t,i,r)};var Nd="";var Rd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Fd(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Jn),Nd)return Nd;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+zl();!Nd&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",Nd=o)}return Nd}(t);if(!r){var i=(t=>{var e=t.match(Rd);return e?e[0]:""})(t);i!==r&&lo.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Od={Zt:()=>!!Jn,$t:function(t){lo.error("cookieStore error: "+t)},qt:function(t){if(Jn){try{for(var e=t+"=",r=Jn.cookie.split(";").filter((t=>t.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(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ht:function(t){var e;try{e=JSON.parse(Od.qt(t))||{}}catch(t){}return e},Vt:function(t,e,r,i,n){if(Jn)try{var o="",s="",a=Fd(Jn.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=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&lo.warn("cookieStore warning: large cookie, len="+u.length),Jn.cookie=u,u}catch(t){return}},jt:function(t,e){if(null!=Jn&&Jn.cookie)try{Od.Vt(t,"",-1,e)}catch(t){return}}},Pd=null,Ld={Zt:function(){if(!ii(Pd))return Pd;var t=!0;if(ti(Yn))t=!1;else try{var e="__mplssupport__";Ld.Vt(e,"xyz"),'"xyz"'!==Ld.qt(e)&&(t=!1),Ld.jt(e)}catch(e){t=!1}return t||lo.error("localStorage unsupported; falling back to cookie store"),Pd=t,t},$t:function(t){lo.error("localStorage error: "+t)},qt:function(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Ld.$t(t)}return null},Ht:function(t){try{return JSON.parse(Ld.qt(t))||{}}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Ld.$t(t)}},jt:function(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Ld.$t(t)}}},Dd=["$device_id","distinct_id",Yo,Go,ss,os],Bd={},Zd={Zt:function(){return!0},$t:function(t){lo.error("memoryStorage error: "+t)},qt:function(t){return Bd[t]||null},Ht:function(t){return Bd[t]||null},Vt:function(t,e){Bd[t]=e},jt:function(t){delete Bd[t]}},$d=null,qd={Zt:function(){if(!ii($d))return $d;if($d=!0,ti(Yn))$d=!1;else try{var t="__support__";qd.Vt(t,"xyz"),'"xyz"'!==qd.qt(t)&&($d=!1),qd.jt(t)}catch(t){$d=!1}return $d},$t:function(t){lo.error("sessionStorage error: ",t)},qt:function(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){qd.$t(t)}return null},Ht:function(t){try{return JSON.parse(qd.qt(t))||null}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){qd.$t(t)}},jt:function(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){qd.$t(t)}}},Hd=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Vd{constructor(t){this._instance=t}get ft(){return this._instance.config}get consent(){return this.Yt()?Hd.DENIED:this.Gt}isOptedOut(){return"always"===this.ft.cookieless_mode||(this.consent===Hd.DENIED||this.consent===Hd.PENDING&&(this.ft.opt_out_capturing_by_default||"on_reject"===this.ft.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Hd.DENIED}optInOut(t){this.zt.Vt(this.Wt,t?1:0,this.ft.cookie_expiration,this.ft.cross_subdomain_cookie,this.ft.secure_cookie)}reset(){this.zt.jt(this.Wt,this.ft.cross_subdomain_cookie)}get Wt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get Gt(){var t=this.zt.qt(this.Wt);return vi(t)?Hd.GRANTED:Hr(fi,t)?Hd.DENIED:Hd.PENDING}get zt(){if(!this.Ut){var t=this.ft.opt_out_capturing_persistence_type;this.Ut="localStorage"===t?Ld:Od;var e="localStorage"===t?Od:Ld;e.qt(this.Wt)&&(this.Ut.qt(this.Wt)||this.optInOut(vi(e.qt(this.Wt))),e.jt(this.Wt,this.ft.cross_subdomain_cookie))}return this.Ut}Yt(){return!!this.ft.respect_dnt&&!!Io([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,io.doNotTrack],(t=>vi(t)))}}var jd=uo("[Dead Clicks]"),Yd=()=>!0,Gd=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qo)),i=t.instance.config.capture_dead_clicks;return si(i)?i:!!Kr(i)||r};class zd{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qo]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Jt((()=>{this.Kt()}))}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?jd.error("failed to load script",e):t()}))}Kt(){var t;if(Jn){if(!this.Xt&&null!=(t=io.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.Xt=io.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(Jn),jd.info("starting...")}}else jd.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,jd.info("stopping..."))}}var Wd=uo("[ExceptionAutocapture]");class Ud{constructor(t){var e,r,i;this.Qt=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=io.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=io.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=io.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=io.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.te&&this.ft.capture_unhandled_errors&&(this.te=e(this.captureException.bind(this))),!this.ee&&this.ft.capture_unhandled_rejections&&(this.ee=r(this.captureException.bind(this))),!this.re&&this.ft.capture_console_errors&&(this.re=i(this.captureException.bind(this)))}catch(t){Wd.error("failed to start",t),this.ie()}}},this._instance=t,this.ne=!(null==(e=this._instance.persistence)||!e.props[Do]),this.oe=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:Wd}),this.ft=this.se(),this.startIfEnabledOrStop()}se(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(t)?e=r({},e,t):(ti(t)?this.ne:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.ft.capture_console_errors||this.ft.capture_unhandled_errors||this.ft.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Wd.info("enabled"),this.ie(),this.Jt(this.Qt)):this.ie()}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Wd.error("failed to load script",e);t()}))}ie(){var t,e,r;null==(t=this.te)||t.call(this),this.te=void 0,null==(e=this.ee)||e.call(this),this.ee=void 0,null==(r=this.re)||r.call(this),this.re=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.ne=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Do]:this.ne}),this.ft=this.se(),this.startIfEnabledOrStop()}onConfigChange(){this.ft=this.se()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(i)?Wd.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Xd{constructor(t){var e;this._instance=t,this.ae=(null==Yn||null==(e=Yn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(lo.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.le&&this.le(),this.le=void 0,lo.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yn&&Yn.history){var r=this;null!=(t=Yn.history.pushState)&&t.__posthog_wrapped__||Mo(Yn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.ue("pushState")})),null!=(e=Yn.history.replaceState)&&e.__posthog_wrapped__||Mo(Yn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.ue("replaceState")})),this.he()}}ue(t){try{var e,r=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!r)return;r!==this.ae&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ae=r}catch(e){lo.error("Error capturing "+t+" pageview",e)}}he(){if(!this.le){var t=()=>{this.ue("popstate")};So(Yn,"popstate",t),this.le=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}}var Jd=uo("[SegmentIntegration]");function Kd(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||zl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(ts,"identified")),e()},n=r.user();"then"in n&&Xr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Jd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Jd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Jd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var Qd="posthog-js";function tv(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class ev{constructor(t,e,r,i,n,o){this.name=Qd,this.setupOnce=function(s){s(tv(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var rv=null!=Yn&&Yn.location?Eo(Yn.location.hash,"__posthog")||Eo(location.hash,"state"):null,iv="_postHogToolbarParams",nv=uo("[Toolbar]"),ov=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(ov||{});class sv{constructor(t){this.instance=t}ce(t){io.ph_toolbar_state=t}de(){var t;return null!==(t=io.ph_toolbar_state)&&void 0!==t?t:ov.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Yn||!Jn)return!1;t=null!=t?t:Yn.location,r=null!=r?r:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var i,n=rv||Eo(t.hash,"__posthog")||Eo(t.hash,"state"),o=n?mo((()=>JSON.parse(atob(decodeURIComponent(n)))))||mo((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(iv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}ve(t){var e=io.ph_load_toolbar||io.ph_load_editor;!ni(e)&&Xr(e)?e(t,this.instance):nv.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Jn||!Jn.getElementById(as));if(!Yn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(iv,JSON.stringify(r({},n,{source:void 0}))),this.de()===ov.LOADED)this.ve(n);else if(this.de()===ov.UNINITIALIZED){var o;this.ce(ov.LOADING),null==(o=io.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return nv.error("[Toolbar] Failed to load",t),void this.ce(ov.UNINITIALIZED);this.ce(ov.LOADED),this.ve(n)})),So(Yn,"turbolinks:load",(()=>{this.ce(ov.UNINITIALIZED),this.loadToolbar(n)}))}return!0}fe(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var av=uo("[TracingHeaders]");class lv{constructor(t){this.pe=void 0,this.ge=void 0,this.Qt=()=>{var t,e;ti(this.pe)&&(null==(t=io.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ti(this.ge)&&(null==(e=io.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return av.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Jt(this.Qt):(null==(t=this.pe)||t.call(this),null==(e=this.ge)||e.call(this),this.pe=void 0,this.ge=void 0)}}var uv="https?://(.*)",hv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cv=po(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],hv),dv="<masked>",vv=["li_fat_id"];function fv(t,e,r){if(!Jn)return{};var i,n=e?po([],hv,r||[]):[],o=pv(To(Jn.URL,n,dv),t),s=(i={},vo(vv,(function(t){var e=Od.qt(t);i[t]=e||null})),i);return fo(s,o)}function pv(t,e){var r=cv.concat(e||[]),i={};return vo(r,(function(e){var r=Ao(t,e);i[e]=r||null})),i}function gv(t){var e=function(t){return t?0===t.search(uv+"google.([^/?]*)")?"google":0===t.search(uv+"bing.com")?"bing":0===t.search(uv+"yahoo.com")?"yahoo":0===t.search(uv+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ii(e)){i.$search_engine=e;var n=Jn?Ao(Jn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function mv(){return navigator.language||navigator.userLanguage}function yv(){return(null==Jn?void 0:Jn.referrer)||"$direct"}function bv(t,e){var r=t?po([],hv,e||[]):[],i=null==Kn?void 0:Kn.href.substring(0,1e3);return{r:yv().substring(0,1e3),u:i?To(i,r,dv):void 0}}function _v(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=ko(r))?void 0:e.host};if(i){n.$current_url=i;var o=ko(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=pv(i);fo(n,s)}if(r){var a=gv(r);fo(n,a)}return n}function wv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Cv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Iv(t,e){if(!ro)return{};var r,i=t?po([],hv,e||[]):[],[n,o]=function(t){for(var e=0;e<pn.length;e++){var[r,i]=pn[e],n=r.exec(t),o=n&&(Xr(i)?i(n,t):i);if(o)return o}return["",""]}(ro);return fo(bo({$os:n,$os_version:o,$browser:dn(ro,navigator.vendor),$device:gn(ro),$device_type:mn(ro),$timezone:wv(),$timezone_offset:Cv()}),{$current_url:To(null==Kn?void 0:Kn.href,i,dv),$host:null==Kn?void 0:Kn.host,$pathname:null==Kn?void 0:Kn.pathname,$raw_user_agent:ro.length>1e3?ro.substring(0,997)+"...":ro,$browser_version:fn(ro,navigator.vendor),$browser_language:mv(),$browser_language_prefix:(r=mv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:"web",$lib_version:so.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Sv=uo("[Web Vitals]"),kv=9e5;class xv{constructor(t){var e;this.me=!1,this.ht=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ye=()=>{clearTimeout(this.be),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._e=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ti(i))Sv.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.we();if(!ti(n))if(ni(null==t?void 0:t.name)||ni(null==t?void 0:t.value))Sv.error("Invalid metric received",t);else if(this.Ce&&t.value>=this.Ce)Sv.error("Ignoring metric with value >= "+this.Ce,t);else this.F.url!==n&&(this.ye(),this.be=setTimeout(this.ye,this.flushToCaptureTimeoutMs)),ti(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=ti(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.F.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.ye()}},this.Qt=()=>{var t,e,r,i,n=io.__PosthogExtensions__;ti(n)||ti(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this._e.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this._e.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._e.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._e.bind(this)),this.ht=!0):Sv.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.me=!(null==(e=this._instance.persistence)||!e.props[$o]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Kr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return ti(r)?(null==(e=this._instance.persistence)?void 0:e.props[Vo])||["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 Ce(){var t=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:kv;return 0<t&&t<=6e4?kv:t}get isEnabled(){var t=null==Kn?void 0:Kn.protocol;if("http:"!==t&&"https:"!==t)return Sv.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=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(e)?e:this.me}startIfEnabled(){this.isEnabled&&!this.ht&&(Sv.info("enabled, starting..."),this.Jt(this.Qt))}onRemoteConfig(t){var e=Kr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Kr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$o]:e}),this._instance.persistence.register({[Vo]:r})),this.me=e,this.startIfEnabled()}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Sv.error("failed to load script",e):t()}))}we(){var t=Yn?Yn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?po([],hv,r||[]):[];return To(t,i,dv)}Sv.error("Could not determine current URL")}}var Av=uo("[Heatmaps]");function Tv(t){return Kr(t)&&"clientX"in t&&"clientY"in t&&oi(t.clientX)&&oi(t.clientY)}class Ev{constructor(t){var e;this.me=!1,this.ht=!1,this.Ie=null,this.instance=t,this.me=!(null==(e=this.instance.persistence)||!e.props[Lo]),this.rageclicks=new md(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Kr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return ti(this.instance.config.capture_heatmaps)?ti(this.instance.config.enable_heatmaps)?this.me:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ht)return;Av.info("starting..."),this.Se(),this.ke()}else{var t;clearInterval(null!==(t=this.Ie)&&void 0!==t?t:void 0),this.xe(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Lo]:e}),this.me=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.F;return this.F=void 0,t}Ae(t){this.kt(t.originalEvent,"deadclick")}ke(){this.Ie&&clearInterval(this.Ie),this.Ie=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Jn)?setInterval(this.Te.bind(this),this.flushIntervalMilliseconds):null}Se(){Yn&&Jn&&(this.Ee=this.Te.bind(this),So(Yn,"beforeunload",this.Ee),this.Me=t=>this.kt(t||(null==Yn?void 0:Yn.event)),So(Jn,"click",this.Me,{capture:!0}),this.Ne=t=>this.Re(t||(null==Yn?void 0:Yn.event)),So(Jn,"mousemove",this.Ne,{capture:!0}),this.Fe=new zd(this.instance,Yd,this.Ae.bind(this)),this.Fe.startIfEnabled(),this.Oe=this.ke.bind(this),So(Jn,"visibilitychange",this.Oe),this.ht=!0)}xe(){var t;Yn&&Jn&&(this.Ee&&Yn.removeEventListener("beforeunload",this.Ee),this.Me&&Jn.removeEventListener("click",this.Me,{capture:!0}),this.Ne&&Jn.removeEventListener("mousemove",this.Ne,{capture:!0}),this.Oe&&Jn.removeEventListener("visibilitychange",this.Oe),clearTimeout(this.Pe),null==(t=this.Fe)||t.stop(),this.ht=!1)}Le(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&cs(i)&&!ds(i,"body");){if(i===r)return!1;if(Hr(e,null==Yn?void 0:Yn.getComputedStyle(i).position))return!0;i=Is(i)}return!1}(_s(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}kt(t,e){var i;if(void 0===e&&(e="click"),!hs(t.target)&&Tv(t)){var n=this.Le(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.De(r({},n,{type:"rageclick"})),this.De(n)}}Re(t){!hs(t.target)&&Tv(t)&&(clearTimeout(this.Pe),this.Pe=setTimeout((()=>{this.De(this.Le(t,"mousemove"))}),500))}De(t){if(Yn){var e=Yn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?po([],hv,i||[]):[],o=To(e,n,dv);this.F=this.F||{},this.F[o]||(this.F[o]=[]),this.F[o].push(t)}}Te(){this.F&&!Qr(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Mv{constructor(t){this.Be=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(lo.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Ze=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.$e()}$e(){var t;this.qe=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Be)}destroy(){var t;null==(t=this.qe)||t.call(this),this.qe=void 0}doPageView(t,e){var r,i=this.He(t,e);return this.Ze={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.He(t,null==(e=this.Ze)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ze)?void 0:t.pageViewId}}He(t,e){var r=this.Ze;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$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(!(ti(o)||ti(s)||ti(a)||ti(l)||ti(u)||ti(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,lo),d=o<=1?1:pi(a/o,0,1,lo),v=l<=1?1:pi(u/l,0,1,lo),f=l<=1?1:pi(h/l,0,1,lo);i=fo(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=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Nv=uo("[FeatureFlags]"),Rv=uo("[FeatureFlags]",{debugEnabled:!0}),Fv="$active_feature_flags",Ov="$override_feature_flags",Pv="$feature_flag_payloads",Lv="$override_feature_flag_payloads",Dv="$feature_flag_request_id",Bv="$feature_flag_evaluated_at",Zv=t=>{var e={};for(var[r,i]of go(t||{}))i&&(e[r]=i);return e},$v=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Nv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},qv=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Hv{constructor(t){this.Ve=!1,this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this._instance=t,this.featureFlagEventHandlers=[]}Xe(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Nv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}Je(){return this.Xe().length>0}flags(){if(this._instance.config.__preview_remote_config)this.We=!0;else{var t=!this.Ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Qe({disableFlags:t})}}get hasLoadedFlags(){return this.je}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Uo),e=this._instance.get_property(Ov),i=this._instance.get_property(Lv);if(!i&&!e)return t||{};var n=fo({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,l,u=n[s],h=null==e?void 0:e[s],c=ti(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=ti(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.Ve||(Nv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Ve=!0),n}getFlagVariants(){var t=this._instance.get_property(zo),e=this._instance.get_property(Ov);if(!e)return t||{};for(var r=fo({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Ve||(Nv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Ve=!0),r}getFlagPayloads(){var t=this._instance.get_property(Pv),e=this._instance.get_property(Lv);if(!e)return t||{};for(var r=fo({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Ve||(Nv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Ve=!0),r}reloadFeatureFlags(){this.Ge||this._instance.config.advanced_disable_feature_flags||this.Ke||(this.Ke=setTimeout((()=>{this.Qe()}),5))}tr(){clearTimeout(this.Ke),this.Ke=void 0}ensureFlagsLoaded(){this.je||this.Ye||this.Ke||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ge=t}Qe(t){var e;if(this.tr(),!this._instance._t())if(this.Ye)this.ze=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Xo)||{}),group_properties:this._instance.get_property(Jo)};ii(n)||ti(n)||(o.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.Je()&&(o.evaluation_environments=this.Xe());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);s&&(o.timezone=wv()),this.Ye=!0,this._instance._send_request({method:"POST",url:u,data:o,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i=!0;(200===t.statusCode&&(this.ze||(this.$anon_distinct_id=void 0),i=!1),this.Ye=!1,this.We)||(this.We=!0,this._instance.er(null!==(r=t.json)&&void 0!==r?r:{}));if(!o.disable_flags||this.ze)if(this.Ue=!i,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(qv.FeatureFlags))Nv.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 n;if(!o.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},i);this.ze&&(this.ze=!1,this.Qe())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(Dv)||void 0,o=this._instance.get_property(Bv)||void 0,s=this._instance.get_property(Qo)||{};if((e.send_event||!("send_event"in e))&&(!(t in s)||!s[t].includes(i))){var a,l,u,h,c,d,v,f,p;Ur(s[t])?s[t].push(i):s[t]=[i],null==(a=this._instance.persistence)||a.register({[Qo]:s});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||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[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.Ue};ti(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),ti(null==g?void 0:g.original_variant)&&ti(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ti(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}Nv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Je()&&(i.evaluation_environments=this.Xe()),this._instance._send_request({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;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ti(r)?void 0:!!r}Nv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.je=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=$v(t),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(Ur(l)){Nv.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;e&&e.register({[Fv]:l,[zo]:d})}else{var f=l,p=u,g=a;t.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),e&&e.register(r({[Fv]:Object.keys(Zv(f)),[zo]:f||{},[Pv]:p||{},[Uo]:g||{}},h?{[Dv]:h}:{},c?{[Bv]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.rr(e)}}override(t,e){void 0===e&&(e=!1),Nv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Nv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Ov),this._instance.persistence.unregister(Lv),this.rr(),Rv.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.Ve=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Ov),Rv.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({[Ov]:i})}else this._instance.persistence.register({[Ov]:r.flags});Rv.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Lv),Rv.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lv]:r.payloads}),Rv.info("Payload overrides set",{payloads:r.payloads}))),void this.rr()}this.rr()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.je){var{flags:e,flagVariants:r}=this.ir();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wo)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$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(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Fv]:Object.keys(Zv(l)),[zo]:l}),this.rr()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wo),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wo),null==(i=this._instance.persistence)||i.register({[Wo]:n}),t(n)}}})}ir(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}rr(t){var{flags:e,flagVariants:r}=this.ir();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Xo)||{};this._instance.register({[Xo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Xo)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Jo)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Jo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Jo)||{};this._instance.register({[Jo]:r({},e,{[t]:{}})})}else this._instance.unregister(Jo)}reset(){this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this.$anon_distinct_id=void 0,this.tr(),this.Ve=!1}}var Vv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class jv{constructor(t,e){this.ft=t,this.props={},this.nr=!1,this.sr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.zt=this.ar(t),this.load(),t.debug&&lo.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.lr}ar(t){-1===Vv.indexOf(t.persistence.toLowerCase())&&(lo.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Dd,...t];return r({},Ld,{Ht:function(t){try{var e={};try{e=Od.Ht(t)||{}}catch(t){}var r=fo(e,JSON.parse(Ld.qt(t)||"{}"));return Ld.Vt(t,r),r}catch(t){}return null},Vt:function(t,r,i,n,o,s){try{Ld.Vt(t,r,void 0,void 0,s);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Od.Vt(t,a,i,n,o,s)}catch(t){Ld.$t(t)}},jt:function(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Od.jt(t,e)}catch(t){Ld.$t(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Ld.Zt()?Ld:"localstorage+cookie"===i&&e.Zt()?e:"sessionstorage"===i&&qd.Zt()?qd:"memory"===i?Zd:"cookie"===i?Od:e.Zt()?e:Od}properties(){var t={};return vo(this.props,(function(e,r){if(r===zo&&Kr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ii(o=us)?a:Un&&o.indexOf===Un?-1!=o.indexOf(s):(vo(o,(function(t){if(a||(a=t===s))return ho})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.lr){var t=this.zt.Ht(this.sr);t&&(this.props=fo({},t))}}save(){this.lr||this.zt.Vt(this.sr,this.props,this.ur,this.hr,this.cr,this.ft.debug)}remove(){this.zt.jt(this.sr,!1),this.zt.jt(this.sr,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Kr(t)){ti(e)&&(e="None"),this.ur=ti(r)?this.dr:r;var i=!1;if(vo(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Kr(t)){this.ur=ti(e)?this.dr:e;var r=!1;if(vo(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.nr){var t=fv(this.ft.custom_campaign_params,this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties);Qr(bo(t))||this.register(t),this.nr=!0}}update_search_keyword(){var t;this.register((t=null==Jn?void 0:Jn.referrer)?gv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:yv(),$referring_domain:null!=Jn&&Jn.referrer&&(null==(t=ko(Jn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[is]||this.props[ns]||this.register_once({[os]:bv(this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};vo([ns,is],(e=>{var r=this.props[e];r&&vo(r,(function(e,r){t["$initial_"+jr(r)]=e}))}));var e,r,i=this.props[os];if(i){var n=(e=_v(i),r={},vo(e,(function(t,e){r["$initial_"+jr(e)]=t})),r);fo(t,n)}return t}safe_merge(t){return vo(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.dr=this.ur=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.ar(t),n=this.props;this.clear(),this.zt=i,this.props=n,this.save()}}set_disabled(t){this.lr=t,this.lr?this.remove():this.save()}set_cross_subdomain(t){t!==this.hr&&(this.hr=t,this.remove(),this.save())}set_secure(t){t!==this.cr&&(this.cr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Oo]||{};r[t]=e,this.props[Oo]=r,this.save()}remove_event_timer(t){var e=(this.props[Oo]||{})[t];return ti(e)||(delete this.props[Oo][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Yv=uo("[Product Tours]"),Gv="ph_product_tours";class zv{constructor(t){this.vr=null,this.pr=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Ho]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.vr||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Ho))||this.Jt((()=>this.gr()))}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Yv.error("Could not load product tours script",e):t()}))}gr(){var t;!this.vr&&null!=(t=io.__PosthogExtensions__)&&t.generateProductTours&&(this.vr=io.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ur(this.pr)||e){var r=this._instance.persistence;if(r){var i=r.props[Gv];if(Ur(i)&&!e)return this.pr=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Yv.error(n),void t([],{isLoaded:!1,error:n})}var o=Ur(e.json.product_tours)?e.json.product_tours:[];this.pr=o,r&&r.register({[Gv]:o}),t(o,{isLoaded:!0})}})}else t(this.pr,{isLoaded:!0})}getActiveProductTours(t){ni(this.vr)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.vr.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.vr)||e.showTourById(t)}previewTour(t){this.vr?this.vr.previewTour(t):this.Jt((()=>{var e;this.gr(),null==(e=this.vr)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.vr)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.vr)||t.nextStep()}previousStep(){var t;null==(t=this.vr)||t.previousStep()}clearCache(){var t;this.pr=null,null==(t=this._instance.persistence)||t.unregister(Gv)}resetTour(t){var e;null==(e=this.vr)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.vr)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.vr)||e.cancelPendingTour(t)}}class Wv{constructor(){this.mr={},this.mr={}}on(t,e){return this.mr[t]||(this.mr[t]=[]),this.mr[t].push(e),()=>{this.mr[t]=this.mr[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.mr[t]||[])r(e);for(var i of this.mr["*"]||[])i(t,e)}}function Uv(t,e,r){if(ni(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Xv{constructor(t){this.yr=new Wv,this.br=(t,e)=>this._r(t,e)&&this.wr(t,e)&&this.Cr(t,e)&&this.Ir(t,e),this._r=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Sr=new Set,this.kr=new Set}init(){var t;if(!ti(null==(t=this._instance)?void 0:t.Ar)){var e;null==(e=this._instance)||e.Ar(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ti(null==(e=this._instance)?void 0:e.Ar)&&(t.forEach((t=>{var e,r;null==(e=this.kr)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Sr)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.Sr.has(t)||this.Sr.has(null==e?void 0:e.event))&&this.kr&&(null==(r=this.kr)?void 0:r.size)>0&&this.kr.forEach((t=>{this.Tr(e,t)&&this.yr.emit("actionCaptured",t.name)}))}Er(t){this.onAction("actionCaptured",(e=>t(e)))}Tr(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.br(t,r))return!0;return!1}onAction(t,e){return this.yr.on(t,e)}wr(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Uv(i,e.url,e.url_matching||"contains"))return!1}return!0}Cr(t,e){return!!this.Mr(t,e)&&(!!this.Nr(t,e)&&!!this.Rr(t,e))}Mr(t,e){var r;if(null==e||!e.href)return!0;var i=this.Fr(t);if(i.length>0)return i.some((t=>Uv(t.href,e.href,e.href_matching||"exact")));var n,o=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!o&&Uv((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Nr(t,e){var r;if(null==e||!e.text)return!0;var i=this.Fr(t);if(i.length>0)return i.some((t=>Uv(t.text,e.text,e.text_matching||"exact")||Uv(t.$el_text,e.text,e.text_matching||"exact")));var n,o,s,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!ni(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),o=e.text,s=e.text_matching||"exact",n.some((t=>Uv(t,o,s))))}Rr(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch(t){return!1}return!1}Fr(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Ir(t,e){return null==e||!e.properties||0===e.properties.length||Hu(e.properties.reduce(((t,e)=>{var r=Ur(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Jv{constructor(t){this._instance=t,this.Or=new Map,this.Pr=new Map,this.Lr=new Map}Dr(t,e){return!!t&&Hu(t.propertyFilters,null==e?void 0:e.properties)}Br(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}Zr(t,e,r){var i=(r===yl.Activation?this.Or:this.Pr).get(t),n=[];return this.$r((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Dr(o,e)}))}register(t){var e;ti(null==(e=this._instance)?void 0:e.Ar)||(this.qr(t),this.Hr(t))}Hr(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Vr){this.Vr=new Xv(this._instance),this.Vr.init();this.Vr.Er((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Vr)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.Lr.get(e.name);r&&r.push(t.id),this.Lr.set(e.name,r||[t.id])}})))}))}}qr(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e.Ar(((t,e)=>{this.onEvent(t,e)})),this.Or=this.Br(t,yl.Activation),this.Pr=this.Br(t,yl.Cancellation)}}onEvent(t,e){var r,i=this.jr(),n=this.Yr(),o=this.Gr(),s=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(o===t&&e&&s.length>0){var a,l;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:s});var u=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(l=e.properties)?void 0:l.$product_tour_id);if(u){var h=s.indexOf(u);h>=0&&(s.splice(h,1),this.zr(s))}}else{if(this.Pr.has(t)){var c=this.Zr(t,e,yl.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=s.indexOf(t.id);e>=0&&s.splice(e,1),this.Wr(t.id)})),this.zr(s))}if(this.Or.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Or.get(t)});var d=this.Zr(t,e,yl.Activation);this.zr(s.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.Yr(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Lr.has(t)&&this.zr(i.concat(this.Lr.get(t)||[]))}zr(t){var e,r=this.jr(),i=this.Yr(),n=[...new Set(t)].filter((t=>!this.Ur(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.Yr(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Or}Xr(){return this.Vr}}class Kv extends Jv{constructor(t){super(t)}Yr(){return"$surveys_activated"}Gr(){return xl.SHOWN}$r(t){var e;null==(e=this._instance)||e.getSurveys(t)}Wr(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}jr(){return El}Ur(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Qv{constructor(t){this.Jr=void 0,this._surveyManager=null,this.Kr=!1,this.Qr=[],this.ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ni(e))return El.warn("Flags not loaded yet. Not loading surveys.");var r=Ur(e);this.Jr=r?e.length>0:e,El.info("flags response received, isSurveysEnabled: "+this.Jr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Fl)||null!=r&&r.startsWith(Ol))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Kr)El.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)El.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())El.info("Not loading surveys in cookieless mode without consent.");else{var t=null==io?void 0:io.__PosthogExtensions__;if(t){if(!ti(this.Jr)||this._instance.config.advanced_enable_surveys){var e=this.Jr||this._instance.config.advanced_enable_surveys;this.Kr=!0;try{var r=t.generateSurveys;if(r)return void this.ei(r,e);var i=t.loadExternalDependency;if(!i)return void this.ri("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.ri("Could not load surveys script",r):this.ei(t.generateSurveys,e)}))}catch(t){throw this.ri("Error initializing surveys",t),t}finally{this.Kr=!1}}}else El.error("PostHog Extensions not found.")}}ei(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Kv(this._instance),El.info("Surveys loaded successfully"),this.ii({isLoaded:!0})}ri(t,e){El.error(t,e),this.ii({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Qr.push(t),this._surveyManager&&this.ii({isLoaded:!0}),()=>{this.Qr=this.Qr.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return El.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(Ko);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.ti?this.ti.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.ti=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.ti=null;var n=e.statusCode;if(200!==n||!e.json){var o="Surveys API could not be loaded, status: "+n;El.error(o);var s={isLoaded:!1,error:o};return t([],s),void(null==r||r({surveys:[],context:s}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Nl(t)||Rl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[Ko]:l});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}ii(t){for(var e of this.Qr)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){El.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);El.warn("init was not called")}ni(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}oi(t){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.ni(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ni(this._surveyManager))return El.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.oi(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ni(this._surveyManager)?(El.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((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.oi(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var r;if(ni(this._surveyManager))El.warn("init was not called");else{var i="string"==typeof t?this.ni(t):t;if(null!=i&&i.id)if(Zl.includes(i.type)){var n=null==Jn?void 0:Jn.querySelector(e);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(El.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;El.info("Rendering survey "+i.id+" with delay of "+(null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(i,n),El.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);El.warn("Survey element not found")}else El.warn("Surveys of type "+i.type+" cannot be rendered in the app");else El.warn("Survey not found")}}displaySurvey(t,e){var i;if(ni(this._surveyManager))El.warn("init was not called");else{var n=this.ni(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void El.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,e.selector)}else El.warn("Survey not found")}}cancelPendingSurvey(t){ni(this._surveyManager)?El.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var tf=uo("[Conversations]");class ef{constructor(t){this.si=void 0,this._conversationsManager=null,this.ai=!1,this.li=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;ni(e)||(si(e)?this.si=e:(this.si=e.enabled,this.li=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.si=void 0,this.li=null}loadIfEnabled(){if(!this._conversationsManager&&!this.ai&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==io?void 0:io.__PosthogExtensions__;if(t&&!ti(this.si)&&this.si)if(this.li&&this.li.token){this.ai=!0;try{var e=t.initConversations;if(e)return this.ui(e),void(this.ai=!1);var r=t.loadExternalDependency;if(!r)return void this.hi("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.hi("Could not load conversations script",e):this.ui(t.initConversations),this.ai=!1}))}catch(t){this.hi("Error initializing conversations",t),this.ai=!1}}else tf.error("Conversations enabled but missing token in remote config.")}}ui(t){if(this.li)try{this._conversationsManager=t(this.li,this._instance),tf.info("Conversations loaded successfully")}catch(t){this.hi("Error completing conversations initialization",t)}else tf.error("Cannot complete initialization: remote config is null")}hi(t,e){tf.error(t,e),this._conversationsManager=null,this.ai=!1}show(){this._conversationsManager?this._conversationsManager.show():tf.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.si&&!ii(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(tf.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(tf.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(tf.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(tf.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}var rf=uo("[RateLimiter]");class nf{constructor(t){var e,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{rf.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void rf.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=t.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=(new Date).getTime(),o=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(rs))&&void 0!==e?e:{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||t||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||t||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(rs,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var of=uo("[RemoteConfig]");class sf{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=io._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}ci(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(of.error("PostHog Extensions not found. Cannot load remote config."),t())}di(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return of.info("Using preloaded remote config",this.remoteConfig),void this.er(this.remoteConfig);if(this._instance._t())return void of.warn("Remote config is disabled. Falling back to local config.");this.ci((t=>{if(!t)return of.info("No config found after loading remote JS config. Falling back to JSON."),void this.di((t=>{this.er(t)}));this.er(t)}))}catch(t){of.error("Error loading remote config",t)}}er(t){t?this._instance.config.__preview_remote_config?(this._instance.er(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):of.info("__preview_remote_config is disabled. Logging config instead",t):of.error("Failed to fetch remote config from PostHog.")}}var af=3e3;class lf{constructor(t,e){this.vi=!0,this.fi=[],this.pi=pi((null==e?void 0:e.flush_interval_ms)||af,250,5e3,lo.createLogger("flush interval"),af),this.gi=t}enqueue(t){this.fi.push(t),this.mi||this.yi()}unload(){this.bi();var t=this.fi.length>0?this.wi():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.gi(r({},t,{transport:"sendBeacon"}))}))}enable(){this.vi=!1,this.yi()}yi(){var t=this;this.vi||(this.mi=setTimeout((()=>{if(this.bi(),this.fi.length>0){var e=this.wi(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Ur(r.data)&&vo(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.gi(r)};for(var i in e)r()}}),this.pi))}bi(){clearTimeout(this.mi),this.mi=void 0}wi(){var t={};return vo(this.fi,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;ti(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.fi=[],t}}var uf=["retriesPerformedSoFar"];class hf{constructor(t){this.Ci=!1,this.Ii=3e3,this.fi=[],this._instance=t,this.fi=[],this.Si=!0,!ti(Yn)&&"onLine"in Yn.navigator&&(this.Si=Yn.navigator.onLine,this.ki=()=>{this.Si=!0,this.Te()},this.xi=()=>{this.Si=!1},So(Yn,"online",this.ki),So(Yn,"offline",this.xi))}get length(){return this.fi.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,uf);oi(e)&&e>0&&(n.url=Ou(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Ai(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Ai(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.fi.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),lo.warn(n),this.Ci||(this.Ci=!0,this.Ti())}Ti(){if(this.Ei&&clearTimeout(this.Ei),0===this.fi.length)return this.Ci=!1,void(this.Ei=void 0);this.Ei=setTimeout((()=>{this.Si&&this.fi.length>0&&this.Te(),this.Ti()}),this.Ii)}Te(){var t=Date.now(),e=[],r=this.fi.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.fi=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Ei&&(clearTimeout(this.Ei),this.Ei=void 0),this.Ci=!1,ti(Yn)||(this.ki&&(Yn.removeEventListener("online",this.ki),this.ki=void 0),this.xi&&(Yn.removeEventListener("offline",this.xi),this.xi=void 0)),this.fi))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){lo.error(t)}this.fi=[]}}class cf{constructor(t){this.Mi=()=>{var t,e,r,i;this.Ni||(this.Ni={});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.Ni.lastScrollY=Math.ceil(o),this.Ni.maxScrollY=Math.max(o,null!==(t=this.Ni.maxScrollY)&&void 0!==t?t:0),this.Ni.maxScrollHeight=Math.max(s,null!==(e=this.Ni.maxScrollHeight)&&void 0!==e?e:0),this.Ni.lastContentY=a,this.Ni.maxContentY=Math.max(a,null!==(r=this.Ni.maxContentY)&&void 0!==r?r:0),this.Ni.maxContentHeight=Math.max(l,null!==(i=this.Ni.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Ni}resetContext(){var t=this.Ni;return setTimeout(this.Mi,0),t}startMeasuringScrollPosition(){So(Yn,"scroll",this.Mi,{capture:!0}),So(Yn,"scrollend",this.Mi,{capture:!0}),So(Yn,"resize",this.Mi)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yn?void 0:Yn.document.documentElement;var t=Ur(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Yn?void 0:Yn.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yn&&(Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yn&&(Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft)||0}}var df=t=>bv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class vf{constructor(t,e,r,i){this.Ri=t=>{var e=this.Fi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Oi(this._instance)};this.Pi.register({[es]:r})}},this._instance=t,this.Li=e,this.Pi=r,this.Oi=i||df,this.Li.onSessionId(this.Ri)}Fi(){return this.Pi.props[es]}getSetOnceProps(){var t,e=null==(t=this.Fi())?void 0:t.props;return e?"r"in e?_v(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vo(bo(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+jr(r)]=e})),t}}var ff=uo("[SessionId]");class pf{on(t,e){return this.Di.on(t,e)}constructor(t,e,r){var i;if(this.Bi=[],this.Zi=void 0,this.Di=new Wv,this.$i=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.ft=t.config,this.Pi=t.persistence,this.qi=void 0,this.Hi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Vi=e||zl,this.ji=r||zl;var n=this.ft.persistence_name||this.ft.token,o=this.ft.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pi(o,60,36e3,ff.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Yi(),this.Gi="ph_"+n+"_window_id",this.zi="ph_"+n+"_primary_window_exists",this.Wi()){var s=qd.Ht(this.Gi),a=qd.Ht(this.zi);s&&!a?this.qi=s:qd.jt(this.Gi),qd.Vt(this.zi,!0)}if(null!=(i=this.ft.bootstrap)&&i.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.ft.bootstrap.sessionID);this.Ui(this.ft.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){ff.error("Invalid sessionID in bootstrap",t)}this.Xi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ti(this.Bi)&&(this.Bi=[]),this.Bi.push(t),this.Hi&&t(this.Hi,this.qi),()=>{this.Bi=this.Bi.filter((e=>e!==t))}}Wi(){return"memory"!==this.ft.persistence&&!this.Pi.lr&&qd.Zt()}Ji(t){t!==this.qi&&(this.qi=t,this.Wi()&&qd.Vt(this.Gi,t))}Ki(){return this.qi?this.qi:this.Wi()?qd.Ht(this.Gi):null}Ui(t,e,r){t===this.Hi&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Hi=t,this.Pi.register({[Yo]:[e,t,r]}))}Qi(){var t=this.Pi.props[Yo];return Ur(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ui(null,null,null)}destroy(){clearTimeout(this.tn),this.tn=void 0,this.Zi&&Yn&&(Yn.removeEventListener("beforeunload",this.Zi,{capture:!1}),this.Zi=void 0),this.Bi=[]}Xi(){this.Zi=()=>{this.Wi()&&qd.jt(this.zi)},So(Yn,"beforeunload",this.Zi,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.ft.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.Qi(),s=this.Ki(),a=oi(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,h=!u&&!t&&this.$i(r,i);u||h||a?(n=this.Vi(),s=this.ji(),ff.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.ji(),l=!0);var c=0===i||!t||a?r:i,d=0===o?(new Date).getTime():o;return this.Ji(s),this.Ui(n,c,d),t||this.Yi(),l&&this.Bi.forEach((t=>t(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}}Yi(){clearTimeout(this.tn),this.tn=setTimeout((()=>{var[t]=this.Qi();if(this.$i((new Date).getTime(),t)){var e=this.Hi;this.resetSessionId(),this.Di.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var gf=["$set_once","$set"],mf=uo("[SiteApps]");class yf{constructor(t){this._instance=t,this.en=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rn(t,e){if(e){var r=this.globalsForEvent(e);this.en.push(r),this.en.length>1e3&&(this.en=this.en.slice(10))}}get siteAppLoaders(){var t;return null==(t=io._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ar(this.rn.bind(this));this.nn=()=>{t(),this.en=[],this.nn=void 0}}}globalsForEvent(t){var e,n,o,s,a,l,u;if(!t)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}=t;return{event:r({},i(t,gf),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.en.length&&(mf.info("Processing "+this.en.length+" events for site app with id "+t.id),this.en.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.nn)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,mf.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){mf.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){mf.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}sn(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}an(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){mf.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.sn(),void this._instance.on("eventCaptured",(t=>this.an(t)))):void mf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.nn)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;io["__$$ph_site_app_"+t]=n._instance,null==(e=io.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return mf.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else mf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var bf=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&$r(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>$r(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},_f=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),wf="i.posthog.com";class Cf{constructor(t){this.ln={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+wf,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.ln[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=_f.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=_f.EU:this.ln[this.apiHost]=_f.CUSTOM),this.ln[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===_f.CUSTOM)return this.apiHost+e;var r=wf+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var If={icontains:(t,e)=>!!Yn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yn&&Bu(e.href,t),not_regex:(t,e)=>!!Yn&&!Bu(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Sf{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Sf.un("retrieved web experiments from the server"),e.hn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.hn)Sf.un("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.hn)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ei(i)&&t.variants[i]&&e.cn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];Sf.dn(o)&&e.cn(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Sf.un("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.hn))return this.hn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Sf.un("applying feature flags",t),t.forEach((t=>{var e;if(this.hn&&null!=(e=this.hn)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.hn)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.cn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Sf.getWindowLocation();if(null!=t&&t.search){var e=Ao(null==t?void 0:t.search,"__experiment_id"),r=Ao(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Sf.un("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.vn(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}vn(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Sf.un("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.cn(i[0].name,e,i[0].variants[e].transforms))}static dn(t){return!ni(t.conditions)&&(Sf.fn(t)&&Sf.pn(t))}static fn(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=Sf.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||If[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Yn?void 0:Yn.location}static pn(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.utm))return!0;var r=fv();if(r.utm_source){var i,n,o,s,a,l,u,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static un(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];lo.info("[WebExperiments] "+t,r)}cn(t,e,r){this._is_bot()?Sf.un("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Sf.un("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Sf.un("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?bf(Xn,this._instance.config.custom_blocked_useragents):void 0}}var kf=uo("[PostHog ExternalIntegrations]"),xf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Af{constructor(t){this._instance=t}Jt(t,e){var r;null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return kf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=io.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.Jt(xf[e],(()=>{var r;null==(r=io.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=io.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=io.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var Tf="[SessionRecording]",Ef=uo(Tf);class Mf{get started(){var t;return!(null==(t=this.gn)||!t.isStarted)}get status(){return this.gn?this.gn.status:this.mn&&!this.yn?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.mn=!1,this.bn=void 0,this._instance=t,!this._instance.sessionManager)throw Ef.error("started without valid sessionManager"),new Error(Tf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Tf+' cannot be used with cookieless_mode="always"')}get yn(){var t,e=!(null==(t=this._instance.get_property(jo))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.yn||null==(e=this.gn)||!e.isStarted){var r=!ti(Object.assign)&&!ti(Array.from);this.yn&&r?(this._n(t),Ef.info("starting")):this.stopRecording()}}_n(t){var e,r,i;this.yn&&(null!=io&&null!=(e=io.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=io.__PosthogExtensions__)&&r.initSessionRecording?this.wn(t):null==(i=io.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Cn,(e=>{if(e)return Ef.error("could not load recorder",e);this.wn(t)})))}stopRecording(){var t,e;null==(t=this.bn)||t.call(this),this.bn=void 0,null==(e=this.gn)||e.stop()}In(){var t;null==(t=this._instance.persistence)||t.unregister(Go)}Sn(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.In();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[jo]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ti(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.bn)||e.call(this),this.bn=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Sn(t),this.mn=!0,this.startIfEnabledOrStop()):this.mn=!0:Ef.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.gn)&&r.log?this.gn.log(t,e):Ef.warn("log called before recorder was ready")}get Cn(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(jo);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}wn(t){var e,r;if(null==(e=io.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.gn||(this.gn=null==(r=io.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.gn._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.gn.start(t)}onRRwebEmit(t){var e;null==(e=this.gn)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.gn)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.gn)||t.overrideSampling()}overrideTrigger(t){var e,r;this.gn||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.gn)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.gn)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.gn)||!r.tryAddCustomEvent(t,e))}}var Nf={},Rf=()=>{},Ff="posthog",Of=!Ru&&-1===(null==ro?void 0:ro.indexOf("MSIE"))&&-1===(null==ro?void 0:ro.indexOf("Mozilla")),Pf=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Co(null==Jn?void 0:Jn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Rf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:Kn&&ei(null==Kn?void 0:Kn.search)&&-1!==Kn.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_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(e=Yn.location)?void 0:e.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:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;lo.error(e)},get_device_id:t=>t,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:af},error_tracking:{},_onCapture:Rf,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Lf=t=>{var e={};ti(t.process_person)||(e.person_profiles=t.process_person),ti(t.xhr_headers)||(e.request_headers=t.xhr_headers),ti(t.cookie_name)||(e.persistence_name=t.cookie_name),ti(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ti(t.store_google)||(e.save_campaign_params=t.store_google),ti(t.verbose)||(e.debug=t.verbose);var r=fo({},e,t);return Ur(t.property_blacklist)&&(ti(t.property_denylist)?r.property_denylist=t.property_blacklist:Ur(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:lo.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Df{constructor(){this.__forceAllowLocalhost=!1}get kn(){return this.__forceAllowLocalhost}set kn(t){lo.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bf{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Df,this.xn=!1,this.version=so.LIB_VERSION,this.An=new Wv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Pf(),this.SentryIntegration=ev,this.sentryIntegration=t=>function(t,e){var r=tv(t,e);return{name:Qd,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tn=!1,this.En=null,this.Mn=null,this.Nn=null,this.featureFlags=new Hv(this),this.toolbar=new sv(this),this.scrollManager=new cf(this),this.pageViewManager=new Mv(this),this.surveys=new Qv(this),this.conversations=new ef(this),this.experiments=new Sf(this),this.exceptions=new dc(this),this.rateLimiter=new nf(this),this.requestRouter=new Cf(this),this.consent=new Vd(this),this.externalIntegrations=new Af(this),this.people={set:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>lo.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Ff){var i,n=null!==(i=Nf[r])&&void 0!==i?i:new Bf;return n._init(t,e,r),Nf[r]=n,Nf[Ff][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ti(t)||ri(t))return lo.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={},e.debug=this.Rn(e.debug),this.Fn=e,this.On=[],e.person_profiles&&(this.Mn=e.person_profiles),this.set_config(fo({},Pf(e.defaults),Lf(e),{name:i,token:t})),this.config.on_xhr_error&&lo.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Ul.GZipJS;var o=this.Pn();this.persistence=new jv(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new jv(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.Ln=new lf((t=>this.Dn(t)),this.config.request_queue_config),this.Bn=new hf(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 pf(this),this.sessionPropsManager=new vf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(lo.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Zn(l)}),0)):(lo.info("Initializing extensions synchronously"),this.Zn(l)),so.DEBUG=so.DEBUG||this.config.debug,so.DEBUG&&lo.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(zl()),d=null!=(u=e.bootstrap)&&u.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(ts,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.$n()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ls,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(zl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ts,"anonymous")}return So(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Kd(this,(()=>this.qn())):this.qn(),Xr(this.config._onCapture)&&this.config._onCapture!==Rf&&(lo.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&lo.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}Zn(t){var e=performance.now();this.historyAutocapture=new Xd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new lv(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new yf(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Mf(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Sd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new zv(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Ev(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new xv(this)})),r.push((()=>{this.exceptionObserver=new Ud(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new zd(this,Gd),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Hn){var t=this.Hn;this.Hn=void 0,this.er(t)}})),this.Vn(r,e)}Vn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Vn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){lo.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);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&&lo.info("PostHog extensions initialized ("+i+"ms)")}er(t){var e,r,i,n,o,s,a,l,u;if(!Jn||!Jn.body)return lo.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.er(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Hn=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Hr(t.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hr(t.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mn?this.Mn:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(s=this.productTours)||s.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}qn(){try{this.config.loaded(this)}catch(t){lo.critical("`loaded` function failed",t)}this.jn(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Yn()}),1),new sf(this).load(),this.featureFlags.flags()}jn(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ln)||t.enable()))}_dom_loaded(){this.is_capturing()&&co(this.__request_queue,(t=>this.Dn(t))),this.__request_queue=[],this.jn()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.Gn()&&this.capture("$pageleave"),null==(t=this.Ln)||t.unload(),null==(e=this.Bn)||e.unload()):this.Gn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Of?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Ou(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=Ou(o.url,{_:(new Date).getTime().toString(),ver:so.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Du.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),l=null!==(i=null==(n=Io(a,(t=>t.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({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}Dn(t){this.Bn?this.Bn.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];co(t,(t=>{t&&(e=t[0],Ur(e)?n.push(t):Xr(t)?t.call(this):Ur(t)&&"alias"===e?r.push(t):Ur(t)&&-1!==e.indexOf("capture")&&Xr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){co(t,(function(t){if(Ur(t[0])){var r=e;vo(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}$n(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ln){if(this.is_capturing())if(!ti(t)&&ei(t)){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!=e&&e.$current_url&&!ei(null==e?void 0:e.$current_url)&&(lo.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$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=zl(),h={uuid:u,event:t,properties:this.calculateEventProperties(t,e||{},l,u)};"$pageview"===t&&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="$groupidentify"!==t,d=this.zn(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=_o(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ti(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===xl.DISMISSED||t===xl.SENT){var v=null==e?void 0:e[Al.SURVEY_ID],f=null==e?void 0:e[Al.SURVEY_ITERATION];Bl({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Pl({id:v,current_iteration:f},t===xl.SENT?"responded":"dismissed")]:!0})}else t===xl.SHOWN&&(h.$set=r({},h.$set,{[Al.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(Qr(p)||this.setPersonPropertiesForFlags(p),!ni(this.config.before_send)){var g=this.Wn(h);if(!g)return;h=g}this.An.emit("eventCaptured",h);var m={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.Dn(m):this.Ln.enqueue(m),h}lo.critical("This capture call is ignored due to client rate limiting.")}}else lo.error("No event name provided to posthog.capture")}else lo.uninitializedWarning("posthog.capture")}Ar(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);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"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ei(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&lo.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=Iv(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&&fo(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fo(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Bn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===_f.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fo(a,u),"$pageview"===t&&Jn&&(a.title=Jn.title),!ti(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}ro&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fo({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ur(this.config.property_denylist)?vo(this.config.property_denylist,(function(t){delete a[t]})):lo.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&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.Un();return a.$process_person_profile=g,g&&!o&&this.Xn("_calculate_event_properties"),a}zn(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.Un())return t;if(this.xn)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=fo({},i,n||{},t||{}),s=this.config.sanitize_properties;return s&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),e&&(this.xn=!0),Qr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Jn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},o=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=r({},n,t),a=r({},o,e),l={};for(var[u,h]of Object.entries(s)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ti(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.An.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=$l),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return lo.uninitializedWarning("posthog.identify");if(oi(t)&&(t=t.toString(),lo.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))lo.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ls){if(this.Xn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Fo)&&(this.unregister(Fo),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(ts)||"anonymous");t!==n&&s?(this.persistence.set_property(ts,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Nn=Zu(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(Qo))}}else lo.critical('The string "'+ls+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else lo.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.Xn("posthog.setPersonProperties")){var i=Zu(this.get_distinct_id(),t,e);this.Nn!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Nn=i):lo.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else lo.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Xn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(lo.info("reset"),!this.__loaded)return lo.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(ts,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Nn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ls,$device_id:null},"");else{var s=this.config.get_device_id(zl());this.register_once({distinct_id:s,$device_id:t?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 t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.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(t,e){return t===this.get_property(Ro)?(lo.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xn("posthog.alias")?(ti(e)&&(e=this.get_distinct_id()),t!==e?(this.Jn(Fo,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(lo.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Kr(t)){var i,n,o,s,a,l,u;fo(this.config,Lf(t));var h=this.Pn();null==(i=this.persistence)||i.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new jv(r({},this.config,{persistence:"sessionStorage"}),h);var c=this.Rn(this.config.debug);si(c)&&(this.config.debug=c),si(this.config.debug)&&(this.config.debug?(so.DEBUG=!0,Ld.Zt()&&Ld.Vt("ph_debug","true"),lo.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(so.DEBUG=!1,Ld.Zt()&&Ld.jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Kn(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Ff;return e!==Ff&&(e=Ff+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(ts))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(ts))}Un(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Fo])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ss]))}Gn(){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.Un()||this.Xn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Xn(t){return"never"===this.config.person_profiles?(lo.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jn(ss,!0),!0)}Pn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Kn(){var t,e,r,i,n=this.Pn();(null==(t=this.persistence)?void 0:t.lr)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.lr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new pf(this),this.pageViewManager=new Mv(this),this.persistence&&(this.sessionPropsManager=new vf(this,this.sessionManager,this.persistence)),this.sessionRecording=new Mf(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Kn(),this.jn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Yn()}else lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ls,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.Yn())):lo.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 t=this.consent.consent;return t===Hd.GRANTED?"granted":t===Hd.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.Kn()}_is_bot(){return Xn?bf(Xn,this.config.custom_blocked_useragents):void 0}Yn(){Jn&&("visible"===Jn.visibilityState?this.Tn||(this.Tn=!0,this.capture("$pageview",{title:Jn.title},{send_instantly:!0}),this.En&&(Jn.removeEventListener("visibilitychange",this.En),this.En=null)):this.En||(this.En=this.Yn.bind(this),So(Jn,"visibilitychange",this.En)))}debug(t){!1===t?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.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}))}_t(){var t,e,r,i,n,o,s,a=this.Fn||{};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?(lo.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=lo,o=(e="advanced_disable_flags")in(t=a)&&!ti(t[e]),s=r in t&&!ti(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}Wn(t){if(ni(this.config.before_send))return t;var e=Ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ni(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return li(t.event)?lo.warn(n+". This can cause unexpected behavior."):lo.info(n),null}r.properties&&!Qr(r.properties)||lo.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Ze)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Rn(t){var e=si(t)&&!t,r=Ld.Zt()&&"true"===Ld.qt("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=yo(t.prototype[e[r]])}(Bf,["identify"]);var Zf,$f={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1},qf=(Zf=Nf[Ff]=new Bf,function(){function t(){t.done||(t.done=!0,Of=!1,vo(Nf,(function(t){t._dom_loaded()})))}null!=Jn&&Jn.addEventListener?"complete"===Jn.readyState?t():So(Jn,"DOMContentLoaded",t,{capture:!1}):Yn&&lo.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Zf);export{Ul as Compression,$f as DEFAULT_PRODUCT_TOUR_APPEARANCE,Tl as DisplaySurveyType,Bf as PostHog,xl as SurveyEventName,Al as SurveyEventProperties,yl as SurveyEventType,_l as SurveyPosition,Sl as SurveyQuestionBranchingType,Il as SurveyQuestionType,kl as SurveySchedule,wl as SurveyTabPosition,Cl as SurveyType,bl as SurveyWidgetType,qf as default,qf as posthog,Xl as severityLevels};
|
|
1
|
+
function t(t,e,r,i,n,o,s){try{var a=t[o](s),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,l,"next",e)}function l(e){t(s,n,o,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=Object.defineProperty,u=(t,e,r)=>((t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(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(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function _(t){return t.nodeType===t.ELEMENT_NODE}function w(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.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(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=C(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function M(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){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(t,e){return(t||"").replace(R,((t,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return t;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=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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(t,e){return e&&""!==e.trim()?U(t,e):e}function W(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?z(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=e.length);){var o=i(j);if(","===o.slice(-1))o=z(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=z(t,o);for(var a=!1;;){var l=e.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(", ")}(t,i):"style"===r?L(i,U(t)):"object"===e&&"data"===r?z(t,i):i:z(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(_(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){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}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){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}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},_=t.attributes.length,w=0;w<_;w++){var I=t.attributes[w];J(m,I.name,I.value)||(y[I.name]=X(i,m,T(I.name),I.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);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=C(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=C(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:M(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.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=t,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(t){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: "+t)}"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=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:z}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{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 t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,l=b.textContent(t),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=C(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){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:C,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:M=!0}=e;E||(E=Q(t,s,a,void 0===E));var R,F=tt(t,{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(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.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(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&I(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:C,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(t))){var Z=rt(B,D);Z&&O.childNodes.push(Z)}var q=null;if(_(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=rt(j,D);Y&&(I(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&w(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&C){var r=rt(e,{doc:e,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:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&C(t,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(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{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:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?st[t]=u:r}catch(t){return r}}var lt={};function ut(t,e,r){var i,n=t+"."+String(r);if(lt[n])return lt[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lt[n]=s,s.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,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=e-(l-n),h=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),u))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var _t=Date.now;function wt(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===H}function At(t,e){if(w(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Vt,i=t=>{for(var e=t,r=H;r===H;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=w(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=rt(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:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:s,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Wt(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Ut(this.droppedSet,s)||Wt(this.removes,s,this.mirror)?Ut(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(vt.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(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.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((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.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(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.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(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.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(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=w(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(r,i)]?zt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!w(t.target)||!I(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Yt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 zt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>zt(t,e)))}function Wt(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(i)&&(l=Zt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,i))})),Jt((()=>{u.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=wt(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.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(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){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}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;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=mt(Jt((t=>{var r=Date.now()-o;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],o=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=_t()),l.push({x:r,y:i,id:n.getId(e),timeOffset:_t()-o}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=It(),e=Ct();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),u=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=M(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:e,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};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((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),o.media||500))),l=[ft("play",a(qt.Play),s),ft("pause",a(qt.Pause),s),ft("seeked",a(qt.Seeked),s),ft("volumechange",a(qt.VolumeChange),s),ft("ratechange",a(qt.RateChange),s)];return Jt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";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:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),t.apply(e,o)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{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((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var l,[u,h,c]=s;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=se(null==(l=e.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:oe(e.parentRule)}),t.apply(e,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,s)=>{var a,[u]=s;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(we(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:we(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var _e=(t,e,r)=>t.map((t=>be(t,e,r))),we=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ie(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){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(!kt(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(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 t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ce(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var h=t.apply(this,l);if(ye(h,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=_e(l,o,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));s.push(l)}catch(i){var u=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Me(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,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(t,r,i,n,o){var s=this,a=Ie(r,i,n,!0),l=new Map,u=new Me;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:$t["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/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ie(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.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 kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=_e(a,e,this);t(this.canvas,{type:$t["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:$t["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ce(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ce(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,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:_={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Be.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(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=_t(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(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===Lt.FullSnapshot)L=s,Z=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Fe;Ae=new Ne({recordCanvas:C,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:_});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:_,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:W},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),I){ke({type:Lt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){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:_,keepIframeSrcFn:w=(()=>!1)}=e||{};return rt(t,{doc:t,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:_,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:_,recordCanvas:C,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Mt(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:_,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ve=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},We={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],r=e.prototype,i=t in ze?ze[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in We?We[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){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(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ar[t]=u:r}catch(t){return r}}var ur={};function hr(t,e,r){var i,n=t+"."+String(r);if(ur[n])return ur[n].call(e);var o=lr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=lr(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},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:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function _r(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||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 t(e,r){var i,n,o=null==(n=null==(i=e.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=t(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 t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.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(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||_r(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[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 e){var h=e[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:_r,throttle:function(t,e,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=e-(l-n),h=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Cr[Ir.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).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(t){return t.stack.split("\n").filter((function(t){return!t.match(Mr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.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(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.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(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var l=e[a];Array.isArray(l)?s[a]=Rr(l.length?l[0]:null):s[a]=l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}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(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?wr.patch(e,r,(e=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:h,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),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(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return Zr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},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(t,e){return-1!==t.indexOf(e)}var Vr=function(t){return t.trim()},jr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Gr=Object.prototype,zr=Gr.hasOwnProperty,Wr=Gr.toString,Ur=Yr||function(t){return"[object Array]"===Wr.call(t)},Xr=t=>"function"==typeof t,Jr=t=>Xr(t)&&-1!==t.toString().indexOf("[native code]"),Kr=t=>t===Object(t)&&!Ur(t),Qr=t=>{if(Kr(t)){for(var e in t)if(zr.call(t,e))return!1;return!0}return!1},ti=t=>void 0===t,ei=t=>"[object String]"==Wr.call(t),ri=t=>ei(t)&&0===t.trim().length,ii=t=>null===t,ni=t=>ti(t)||ii(t),oi=t=>"[object Number]"==Wr.call(t),si=t=>"[object Boolean]"===Wr.call(t),ai=t=>t instanceof FormData,li=t=>Hr(qr,t);function ui(t){return null===t||"object"!=typeof t}function hi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function ci(t){return!ti(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var di=[!0,"true",1,"1","yes"],vi=t=>Hr(di,t),fi=[!1,"false",0,"0","no"];function pi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),oi(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),pi(n||r,e,r,i))}class gi{constructor(t){this.o={},this.h=t.h,this.m=pi(t.bucketSize,0,100,t.I),this.C=pi(t.refillRate,0,this.m,t.I),this.S=pi(t.refillInterval,0,864e5,t.I)}k(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.S);if(i>0){var n=i*this.C;t.tokens=Math.min(t.tokens+n,this.m),t.lastAccess=t.lastAccess+i*this.S}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),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==(e=this.h)||e.call(this,t)),0===n.tokens)}stop(){this.o={}}}var mi="Mobile",yi="iOS",bi="Android",_i="Tablet",wi=bi+" "+_i,Ii="iPad",Ci="Apple",Si=Ci+" Watch",ki="Safari",xi="BlackBerry",Ai="Samsung",Ti=Ai+"Browser",Ei=Ai+" Internet",Mi="Chrome",Ni=Mi+" OS",Ri=Mi+" "+yi,Fi="Internet Explorer",Oi=Fi+" "+mi,Pi="Opera",Li=Pi+" Mini",Di="Edge",Bi="Microsoft "+Di,Zi="Firefox",$i=Zi+" "+yi,qi="Nintendo",Hi="PlayStation",Vi="Xbox",ji=bi+" "+mi,Yi=mi+" "+ki,Gi="Windows",zi=Gi+" Phone",Wi="Nokia",Ui="Ouya",Xi="Generic",Ji=Xi+" "+mi.toLowerCase(),Ki=Xi+" "+_i.toLowerCase(),Qi="Konqueror",tn="(\\d+(\\.\\d+)?)",en=new RegExp("Version/"+tn),rn=new RegExp(Vi,"i"),nn=new RegExp(Hi+" \\w+","i"),on=new RegExp(qi+" \\w+","i"),sn=new RegExp(xi+"|PlayBook|BB10","i"),an={"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 ln,un,hn,cn=(t,e)=>e&&Hr(e,Ci)||function(t){return Hr(t,ki)&&!Hr(t,Mi)&&!Hr(t,bi)}(t),dn=function(t,e){return e=e||"",Hr(t," OPR/")&&Hr(t,"Mini")?Li:Hr(t," OPR/")?Pi:sn.test(t)?xi:Hr(t,"IE"+mi)||Hr(t,"WPDesktop")?Oi:Hr(t,Ti)?Ei:Hr(t,Di)||Hr(t,"Edg/")?Bi:Hr(t,"FBIOS")?"Facebook "+mi:Hr(t,"UCWEB")||Hr(t,"UCBrowser")?"UC Browser":Hr(t,"CriOS")?Ri:Hr(t,"CrMo")||Hr(t,Mi)?Mi:Hr(t,bi)&&Hr(t,ki)?ji:Hr(t,"FxiOS")?$i:Hr(t.toLowerCase(),Qi.toLowerCase())?Qi:cn(t,e)?Hr(t,mi)?Yi:ki:Hr(t,Zi)?Zi:Hr(t,"MSIE")||Hr(t,"Trident/")?Fi:Hr(t,"Gecko")?Zi:""},vn={[Oi]:[new RegExp("rv:"+tn)],[Bi]:[new RegExp(Di+"?\\/"+tn)],[Mi]:[new RegExp("("+Mi+"|CrMo)\\/"+tn)],[Ri]:[new RegExp("CriOS\\/"+tn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+tn)],[ki]:[en],[Yi]:[en],[Pi]:[new RegExp("(Opera|OPR)\\/"+tn)],[Zi]:[new RegExp(Zi+"\\/"+tn)],[$i]:[new RegExp("FxiOS\\/"+tn)],[Qi]:[new RegExp("Konqueror[:/]?"+tn,"i")],[xi]:[new RegExp(xi+" "+tn),en],[ji]:[new RegExp("android\\s"+tn,"i")],[Ei]:[new RegExp(Ti+"\\/"+tn)],[Fi]:[new RegExp("(rv:|MSIE )"+tn)],Mozilla:[new RegExp("rv:"+tn)]},fn=function(t,e){var r=dn(t,e),i=vn[r];if(ti(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},pn=[[new RegExp(Vi+"; "+Vi+" (.*?)[);]","i"),t=>[Vi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(Hi,"i"),[Hi,""]],[sn,[xi,""]],[new RegExp(Gi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zi,""];if(new RegExp(mi).test(e)&&!/IEMobile\b/.test(e))return[Gi+" "+mi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=an[i]||"";return/arm/i.test(e)&&(n="RT"),[Gi,n]}return[Gi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[yi,e.join(".")]}return[yi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ti(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+bi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+bi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[bi,e.join(".")]}return[bi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ni,""]],[/Linux|debian/i,["Linux",""]]],gn=function(t){return on.test(t)?qi:nn.test(t)?Hi:rn.test(t)?Vi:new RegExp(Ui,"i").test(t)?Ui:new RegExp("("+zi+"|WPDesktop)","i").test(t)?zi:/iPad/.test(t)?Ii:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Si:sn.test(t)?xi:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wi,"i").test(t)?Wi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(mi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?bi:wi:new RegExp("(pda|"+mi+")","i").test(t)?Ji:new RegExp(_i,"i").test(t)&&!new RegExp(_i+" pc","i").test(t)?Ki:""},mn=function(t){var e=gn(t);return e===Ii||e===wi||"Kobo"===e||"Kindle Fire"===e||e===Ki?_i:e===qi||e===Vi||e===Hi||e===Ui?"Console":e===Si?"Wearable":e?mi:"Desktop"},yn=t=>t instanceof Error;function bn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return hn&&r.length===un||(un=r.length,hn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,ln[i]=[l,u];break}}return r}),{})),hn}}class _n{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ur(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bn(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var wn="?";function In(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?wn:r,in_app:!0};return ti(i)||(o.lineno=i),ti(n)||(o.colno=n),o}var Cn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:wn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Sn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=(t,e)=>{var r=Sn.exec(t);if(r){var[,i,n,o]=r;return In(e,i,wn,+n,+o)}var s=kn.exec(t);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=xn.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,u]=Cn(s[1]||wn,s[2]);return In(e,u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,En=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mn=(t,e)=>{var r=Tn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=En.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]||wn;return[o,n]=Cn(o,n),In(e,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Nn=/\(error: (.*)\)/,Rn=50;function Fn(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var o=[],s=e.split("\n"),a=n;a<s.length;a++){var l=s[a];if(!(l.length>1024)){var u=Nn.test(l)?l.replace(Nn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,t);if(c){o.push(c);break}}if(o.length>=Rn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Rn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||wn});var i}))}(o)}}("web:javascript",An,Mn)}class On{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ei(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return hi(t,"DOMException")}isDOMError(t){return hi(t,"DOMError")}}class Pn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Ln{constructor(){}match(t){return hi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Dn);return i&&(e=i[1],r=i[2]),[e,r]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var r=Object.keys(t);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>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return ci(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return ei(t)&&!ri(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(yn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return ci(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$n(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vn{match(t){return ui(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class jn{match(t){return hi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return ui(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(ui(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yn="undefined"!=typeof window?window:void 0,Gn="undefined"!=typeof globalThis?globalThis:Yn;"undefined"==typeof self&&(Gn.self=Gn),"undefined"==typeof File&&(Gn.File=function(){});var zn=Array.prototype,Wn=zn.forEach,Un=zn.indexOf,Xn=null==Gn?void 0:Gn.navigator,Jn=null==Gn?void 0:Gn.document,Kn=null==Gn?void 0:Gn.location,Qn=null==Gn?void 0:Gn.fetch,to=null!=Gn&&Gn.XMLHttpRequest&&"withCredentials"in new Gn.XMLHttpRequest?Gn.XMLHttpRequest:void 0,eo=null==Gn?void 0:Gn.AbortController,ro=null==Xn?void 0:Xn.userAgent,io=null!=Yn?Yn:{},no=()=>!!Yn.Zone,oo=t=>t instanceof Document,so={DEBUG:!1,LIB_VERSION:"1.317.0"},ao=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={A:function(e){if(Yn&&(so.DEBUG||io.POSTHOG_DEBUG||r)&&!ti(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(t,...o)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.A("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>ao(t+" "+e,r)};return i},lo=ao("[PostHog.js]"),uo=lo.createLogger,ho={};function co(t,e,r){if(Ur(t))if(Wn&&t.forEach===Wn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===ho)return}function vo(t,e,r){if(!ni(t)){if(Ur(t))return co(t,e,r);if(ai(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===ho)return}else for(var n in t)if(zr.call(t,n)&&e.call(r,t[n],n)===ho)return}}var fo=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return co(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},po=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return co(r,(function(e){co(e,(function(e){t.push(e)}))})),t};function go(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var mo=function(t){try{return t()}catch(t){return}},yo=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){lo.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),lo.critical(t)}}},bo=function(t){var e={};return vo(t,(function(t,r){(ei(t)&&t.length>0||oi(t))&&(e[r]=t)})),e};function _o(t,e){return r=t,i=t=>ei(t)&&!ii(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Ur(e)?(o=[],co(e,(e=>{o.push(t(e))}))):(o={},vo(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var wo=["herokuapp.com","vercel.app","netlify.app"];function Io(t){var e=null==t?void 0:t.hostname;if(!ei(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of wo)if(r===i)return!1;return!0}function Co(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function So(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var ko=t=>{var e=null==Jn?void 0:Jn.createElement("a");return ti(e)?null:(e.href=t,e)},xo=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vo(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ao=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Ur(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){lo.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},To=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.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)&&(e.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},Eo=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Mo(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function No(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Ro="$people_distinct_id",Fo="__alias",Oo="__timers",Po="$autocapture_disabled_server_side",Lo="$heatmaps_enabled_server_side",Do="$exception_capture_enabled_server_side",Bo="$error_tracking_suppression_rules",Zo="$error_tracking_capture_extension_exceptions",$o="$web_vitals_enabled_server_side",qo="$dead_clicks_enabled_server_side",Ho="$product_tours_enabled_server_side",Vo="$web_vitals_allowed_metrics",jo="$session_recording_remote_config",Yo="$sesid",Go="$session_is_sampled",zo="$enabled_feature_flags",Wo="$early_access_features",Uo="$feature_flag_details",Xo="$stored_person_properties",Jo="$stored_group_properties",Ko="$surveys",Qo="$flag_call_reported",ts="$user_state",es="$client_session_props",rs="$capture_rate_limit",is="$initial_campaign_params",ns="$initial_referrer_info",os="$initial_person_info",ss="$epp",as="__POSTHOG_TOOLBAR__",ls="$posthog_cookieless",us=[Ro,Fo,"__cmpns",Oo,"$session_recording_enabled_server_side",Lo,Yo,zo,Bo,ts,Wo,Uo,Jo,Xo,Ko,Qo,es,rs,is,ns,ss,os,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function hs(t){return t instanceof Element&&(t.id===as||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function cs(t){return!!t&&1===t.nodeType}function ds(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function vs(t){return!!t&&3===t.nodeType}function fs(t){return!!t&&11===t.nodeType}function ps(t){return t?Vr(t).split(/\s+/):[]}function gs(t){var e=null==Yn?void 0:Yn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ms(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ps(e)}function ys(t){return ni(t)?null:Vr(t).split(/(\s+)/).filter((t=>Zs(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function bs(t){var e="";return Ns(t)&&!Rs(t)&&t.childNodes&&t.childNodes.length&&vo(t.childNodes,(function(t){var r;vs(t)&&t.textContent&&(e+=null!==(r=ys(t.textContent))&&void 0!==r?r:"")})),Vr(e)}function _s(t){return ti(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ws=["a","button","form","input","select","textarea","label"];function Is(t,e){if(ti(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Cs(t){var e=t.parentNode;return!(!e||!cs(e))&&e}var Ss=["next","previous","prev",">","<"],ks=10;var xs=[".ph-no-rageclick",".ph-no-capture"];function As(t,e){if(!Yn||Ts(t))return!1;var r,i,n;si(e)?(r=!!e&&xs,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:xs,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Es(t,!1);return!function(t,e){if(!1===t||ti(t))return!1;var r;if(!0===t)r=Ss;else{if(!Ur(t))return!1;if(t.length>ks)return lo.error("[PostHog] content_ignorelist array cannot exceed "+ks+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,o.map((t=>{var e;return{safeText:bs(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Is(o,r)}var Ts=t=>!t||ds(t,"html")||!cs(t),Es=(t,e)=>{if(!Yn||Ts(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!ds(n,"body");)if(fs(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=Cs(n);if(!o)break;if(e||ws.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Yn.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Ms(t,e,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!Yn||Ts(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!gs(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&gs(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Es(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ti(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!Is(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ws.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ns(t){for(var e=t;e.parentNode&&!ds(e,"body");e=e.parentNode){var r=ms(e);if(Hr(r,"ph-sensitive")||Hr(r,"ph-no-capture"))return!1}if(Hr(ms(t),"ph-include"))return!0;var i=t.type||"";if(ei(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ei(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 Rs(t){return!!(ds(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ds(t,"select")||ds(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fs="(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})",Os=new RegExp("^(?:"+Fs+")$"),Ps=new RegExp(Fs),Ls="\\d{3}-?\\d{2}-?\\d{4}",Ds=new RegExp("^("+Ls+")$"),Bs=new RegExp("("+Ls+")");function Zs(t,e){if(void 0===e&&(e=!0),ni(t))return!1;if(ei(t)){if(t=Vr(t),(e?Os:Ps).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Ds:Bs).test(t))return!1}return!0}function $s(t){var e=bs(t);return Zs(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&vo(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=bs(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){lo.error("[AutoCapture]",t)}})),e}function Hs(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return go(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Vs(e.toString())]=Vs(r.toString())})),n+=":",n+=go(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:js(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return go(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Vs(t){return t.replace(/"|\\"/g,'\\"')}function js(t){var e=t.attr__class;return e?Ur(e)?e:ps(e):void 0}var Ys={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,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"]},Gs=uo("[Recorder]"),zs=t=>"navigation"===t.entryType,Ws=t=>"resource"===t.entryType;function Us(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>zs(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ra({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>zs(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ra({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Xs(t,e){return!!e&&(si(e)||e[t])}function Js(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(si(r))return!0;if(Ur(r))return o(r);var s=r[e];return si(s)?s:o(s)}function Ks(t,e,r,i,n,o){return Qs.apply(this,arguments)}function Qs(){return Qs=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return Gs.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ws(t)&&t.initiatorType===e&&(ti(i)||t.startTime>=i)&&(ti(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Ks(t,e,r,i,n,o+1))})),Qs.apply(this,arguments)}function ta(t){var{body:e,options:r,url:i}=t;if(ni(e))return null;var{hostname:n,isHostDenied:o}=No(i,r);if(o)return n+" is in deny list";if(ei(e))return e;if(oo(e))return e.textContent;if(ai(e))return xo(e);if(Kr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ea=t=>!ii(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ra(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:ti(a)?void 0:Math.round(a),endTime:ti(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ea(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ia=["video/","audio/"];function na(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function oa(){return oa=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=No(i,r);return o?Promise.resolve(n+" is in deny list"):na(e)})),oa.apply(this,arguments)}function sa(){return sa=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=ia.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=No(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return ii(n)?na(e):Promise.resolve(n)})),sa.apply(this,arguments)}function aa(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xs("request",i.recordHeaders),o=Xs("response",i.recordHeaders),s=Mo(r,"fetch",(s=>function(){var a=e((function*(e,a){var l,u,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Js({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return oa.apply(this,arguments)}({r:c,options:i,url:e})),u=r.performance.now(),l=yield s(c),h=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Js({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return sa.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Ks(r,"fetch",c.url,u,h).then((e=>{var r,i=ra({entry:e,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var la=null;function ua(t,e,i){if(!("performance"in e))return()=>{};if(la)return Gs.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Ys,i):Ys,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Us(o,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),o=Mo(e.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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Js({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ta({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Js({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ta({body:v.response,options:r,url:a})),Ks(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ra({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),l,u,h)}));return()=>{o()}}(o,e,n),l=aa(o,e,n)),la=()=>{s(),a(),l(),la=null}}var ha=t=>({name:"rrweb/network@1",observer:ua,options:t});io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ha},io.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},io.rrweb={record:Ze,version:"v2"},io.rrwebConsoleRecord={getRecordConsolePlugin:Br},io.getRecordNetworkPlugin=ha;var ca,da,va,fa,pa,ga,ma,ya,ba={},_a=[],wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ia=Array.isArray;function Ca(t,e){for(var r in e)t[r]=e[r];return t}function Sa(t){var e=t.parentNode;e&&e.removeChild(t)}function ka(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?ca.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return xa(t,s,i,n,null)}function xa(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++va:n,__i:-1,__u:0};return null==n&&null!=da.vnode&&da.vnode(o),o}function Aa(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function Ea(t,e){if(null==e)return t.__?Ea(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ea(t):null}function Ma(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ma(t)}}function Na(t){(!t.__d&&(t.__d=!0)&&fa.push(t)&&!Ra.__r++||pa!==da.debounceRendering)&&((pa=da.debounceRendering)||ga)(Ra)}function Ra(){var t,e,r,i,n,o,s,a,l;for(fa.sort(ma);t=fa.shift();)t.__d&&(e=fa.length,i=void 0,o=(n=(r=t).__v).__e,a=[],l=[],(s=r.__P)&&((i=Ca({},n)).__v=n.__v+1,da.vnode&&da.vnode(i),$a(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?Ea(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,qa(a,i,l),i.__e!=o&&Ma(i)),fa.length>e&&fa.sort(ma));Ra.__r=0}function Fa(t,e,r,i,n,o,s,a,l,u,h){var c,d,v,f,p,g=i&&i.__k||_a,m=e.length;for(r.__d=l,function(t,e,r){var i,n,o,s,a,l=e.length,u=r.length,h=u,c=0;for(t.__k=[],i=0;i<l;i++)null!=(n=t.__k[i]=null==(n=e[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?xa(null,n,null,null,n):Ia(n)?xa(Aa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?xa(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Pa(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==t.__d&&(t.__d=Ea(o)),Va(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==t.__d&&(t.__d=Ea(o)),Va(o,o))}(r,e,g),l=r.__d,c=0;c<m;c++)null!=(v=r.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ba:g[v.__i]||ba,v.__i=c,$a(t,v,d,n,o,s,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ha(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=Oa(v,l,t):"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 Oa(t,e,r){var i,n;if("function"==typeof t.type){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=Oa(i[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Pa(t,e,r,i){var n=t.key,o=t.type,s=r-1,a=r+1,l=e[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<e.length;){if(s>=0){if((l=e[s])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function La(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||wa.test(e)?r:r+"px"}function Da(t,e,r,i,n){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||La(t.style,e,"");if(r)for(e in r)i&&r[e]===i[e]||La(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=Date.now(),t.addEventListener(e,o?Za:Ba,o)):t.removeEventListener(e,o?Za:Ba,o);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function Ba(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(da.event?da.event(t):t)}function Za(t){return this.l[t.type+!0](da.event?da.event(t):t)}function $a(t,e,r,i,n,o,s,a,l,u){var h,c,d,v,f,p,g,m,y,b,_,$,w,I,C,S=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(h=da.__b)&&h(e);t:if("function"==typeof S)try{if(m=e.props,y=(h=S.contextType)&&i[h.__c],b=h?y?y.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:("prototype"in S&&S.prototype.render?e.__c=c=new S(m,b):(e.__c=c=new Ta(m,b),c.constructor=S,c.render=ja),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=Ca({},c.__s)),Ca(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,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)||e.__v===r.__v)){for(e.__v!==r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[],c.__h.length&&s.push(c);break t}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=t,c.__e=!1,$=da.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(i=Ca(Ca({},i),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Fa(t,Ia(C=null!=h&&h.type===Aa&&null==h.key?h.props.children:h)?C:[C],e,r,i,n,o,s,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(t){e.__v=null,l||null!=o?(e.__e=a,e.__u|=l?160:32,o[o.indexOf(a)]=null):(e.__e=r.__e,e.__k=r.__k),da.__e(t,e,r)}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=function(t,e,r,i,n,o,s,a,l){var u,h,c,d,v,f,p,g=r.props,m=e.props,y=e.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)){t=v,o[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=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&&t.data===m||(t.data=m);else{if(o=o&&ca.call(t.childNodes),g=r.props||ba,!a&&null!=o)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||Da(t,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||Da(t,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Fa(t,Ia(d)?d:[d],e,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&Ea(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&Sa(o[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Da(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Da(t,u,p,g[u],!1))}return t}(r.__e,e,r,i,n,o,s,l,u);(h=da.diffed)&&h(e)}function qa(t,e,r){e.__d=void 0;for(var i=0;i<r.length;i++)Ha(r[i],r[++i],r[++i]);da.__c&&da.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){da.__e(t,e.__v)}}))}function Ha(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){da.__e(t,r)}}function Va(t,e,r){var i,n;if(da.unmount&&da.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Ha(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){da.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Va(i[n],e,r||"function"!=typeof t.type);r||null==t.__e||Sa(t.__e),t.__=t.__e=t.__d=void 0}function ja(t,e,r){return this.constructor(t,r)}function Ya(t,e,r){var i,n,o;da.__&&da.__(t,e),i=!1?null:e.__k,n=[],o=[],$a(e,t=e.__k=ka(Aa,null,[t]),i||ba,ba,void 0!==e.ownerSVGElement,i?null:e.firstChild?ca.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),qa(n,t,o)}function Ga(t,e,r){var i,n,o,s,a=Ca({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&void 0!==s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?ca.call(arguments,2):r),xa(t.type,a,i||t.key,n||t.ref,null)}ca=_a.slice,da={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},va=0,Ta.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ca({},this.state),"function"==typeof t&&(t=t(Ca({},r),this.props)),t&&Ca(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Na(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Na(this))},Ta.prototype.render=Aa,fa=[],ga="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ma=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ya=0;var za,Wa,Ua,Xa,Ja=0,Ka=[],Qa=[],tl=da.__b,el=da.__r,rl=da.diffed,il=da.__c,nl=da.unmount;function ol(t,e){da.__h&&da.__h(Wa,t,Ja||e),Ja=0;var r=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Qa}),r.__[t]}function sl(t){return Ja=1,function(t,e,r){var i=ol(za++,2);if(i.t=t,!i.__c&&(i.__=[ml(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Wa,!Wa.u)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&i.__c.props===t)&&(!o||o.call(this,t,e,r))};Wa.u=!0;var o=Wa.shouldComponentUpdate,s=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Wa.shouldComponentUpdate=n}return i.__N||i.__}(ml,t)}function al(t,e){var r=ol(za++,3);!da.__s&&gl(r.__H,e)&&(r.__=t,r.i=e,Wa.__H.__h.push(r))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var r=ol(za++,7);return gl(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function hl(t){var e=Wa.context[t.__c],r=ol(za++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Wa)),e.props.value):t.__}function cl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fl),t.__H.__h.forEach(pl),t.__H.__h=[]}catch(e){t.__H.__h=[],da.__e(e,t.__v)}}da.__b=function(t){Wa=null,tl&&tl(t)},da.__r=function(t){el&&el(t),za=0;var e=(Wa=t.__c).__H;e&&(Ua===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Qa,t.__N=t.i=void 0}))):(e.__h.forEach(fl),e.__h.forEach(pl),e.__h=[],za=0)),Ua=Wa},da.diffed=function(t){rl&&rl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===da.requestAnimationFrame||((Xa=da.requestAnimationFrame)||vl)(cl)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Qa&&(t.__=t.__V),t.i=void 0,t.__V=Qa}))),Ua=Wa=null},da.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],da.__e(r,t.__v)}})),il&&il(t,e)},da.unmount=function(t){nl&&nl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{fl(t)}catch(t){e=t}})),r.__H=void 0,e&&da.__e(e,r.__v))};var dl="function"==typeof requestAnimationFrame;function vl(t){var e,r=function(){clearTimeout(i),dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,100);dl&&(e=requestAnimationFrame(r))}function fl(t){var e=Wa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Wa=e}function pl(t){var e=Wa;t.__c=t.__(),Wa=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),bl=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),_l=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),wl=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Il=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Cl=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Sl=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),kl=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),xl=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Al=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Tl=function(t){return t.Popover="popover",t.Inline="inline",t}({}),El=uo("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Nl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Rl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Fl="seenSurvey_",Ol="inProgressSurvey_",Pl=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},Ll=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Dl=t=>Ll(Fl,t),Bl=t=>{localStorage.getItem(Dl(t))||localStorage.setItem(Dl(t),"true")},Zl=[Il.Popover,Il.Widget,Il.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return oi(t)&&isFinite(t)&&Math.floor(t)===t});var ql="0123456789abcdef";class Hl{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,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 Hl(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+ql.charAt(this.bytes[e]>>>4)+ql.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Hl(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Vl{constructor(){this.T=0,this.M=0,this.N=new Gl}generate(){var t=this.generateOrAbort();if(ti(t)){this.T=0;var e=this.generateOrAbort();if(ti(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.T)this.T=t,this.R();else{if(!(t+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return Hl.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 jl,Yl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!ti(Yn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Gl{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(Yl(this.F),this.O=0),this.F[this.O++]}}var zl=()=>Wl().toString(),Wl=()=>(jl||(jl=new Vl)).generate(),Ul=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Xl=["fatal","error","warning","log","info","debug"],Jl=Uint8Array,Kl=Uint16Array,Ql=Uint32Array,tu=new Jl([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 Jl([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]),ru=new Jl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iu=function(t,e){for(var r=new Kl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Ql(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]},nu=iu(tu,2),ou=nu[0],su=nu[1];ou[28]=258,su[258]=28;for(var au=iu(eu,0)[1],lu=new Kl(32768),uu=0;uu<32768;++uu){var hu=(43690&uu)>>>1|(21845&uu)<<1;hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4,lu[uu]=((65280&hu)>>>8|(255&hu)<<8)>>>1}var cu=function(t,e,r){for(var i=t.length,n=0,o=new Kl(e);n<i;++n)++o[t[n]-1];var s,a=new Kl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new Kl(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[lu[c]>>>l]=u}else for(s=new Kl(i),n=0;n<i;++n)s[n]=lu[a[t[n]-1]++]>>>15-t[n];return s},du=new Jl(288);for(uu=0;uu<144;++uu)du[uu]=8;for(uu=144;uu<256;++uu)du[uu]=9;for(uu=256;uu<280;++uu)du[uu]=7;for(uu=280;uu<288;++uu)du[uu]=8;var vu=new Jl(32);for(uu=0;uu<32;++uu)vu[uu]=5;var fu=cu(du,9,0),pu=cu(vu,5,0),gu=function(t){return(t/8>>0)+(7&t&&1)},mu=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Kl?Kl:t instanceof Ql?Ql:Jl)(r-e);return i.set(t.subarray(e,r)),i},yu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},bu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},_u=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new Jl(0),0];if(1==n){var s=new Jl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.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 Kl(d+1),f=wu(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=o[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new Jl(v),f]},wu=function(t,e,r){return-1==t.s?Math.max(wu(t.l,e,r+1),wu(t.r,e,r+1)):e[t.s]=r},Iu=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Kl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++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=t[a]}return[r.subarray(0,i),e]},Cu=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Su=function(t,e,r){var i=r.length,n=gu(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},ku=function(t,e,r,i,n,o,s,a,l,u,h){yu(e,h++,r),++n[256];for(var c=_u(n,15),d=c[0],v=c[1],f=_u(o,15),p=f[0],g=f[1],m=Iu(d),y=m[0],b=m[1],_=Iu(p),w=_[0],I=_[1],C=new Kl(19),S=0;S<y.length;++S)C[31&y[S]]++;for(S=0;S<w.length;++S)C[31&w[S]]++;for(var k=_u(C,7),x=k[0],A=k[1],T=19;T>4&&!x[ru[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Cu(n,du)+Cu(o,vu)+s,P=Cu(n,d)+Cu(o,p)+s+14+3*T+Cu(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Su(e,h,t.subarray(l,l+u));if(yu(e,h,1+(P<O)),h+=2,P<O){E=cu(d,v,0),M=d,N=cu(p,g,0),R=p;var L=cu(x,A,0);yu(e,h,b-257),yu(e,h+5,I-1),yu(e,h+10,T-4),h+=14;for(S=0;S<T;++S)yu(e,h+3*S,x[ru[S]]);h+=3*T;for(var D=[y,w],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];yu(e,h,L[q]),h+=x[q],q>15&&(yu(e,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=fu,M=du,N=pu,R=vu;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;bu(e,h,E[q+257]),h+=M[q+257],q>7&&(yu(e,h,i[S]>>>23&31),h+=tu[q]);var H=31&i[S];bu(e,h,N[H]),h+=R[H],H>3&&(bu(e,h,i[S]>>>5&8191),h+=eu[H])}else bu(e,h,E[i[S]]),h+=M[i[S]];return bu(e,h,E[256]),h+M[256]},xu=new Ql([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Au=function(){for(var t=new Ql(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Tu=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new Jl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?u=Su(l,u,t.subarray(h,c)):(l[h]=o,u=Su(l,u,t.subarray(h,s)))}else{for(var d=xu[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Kl(32768),m=new Kl(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ql(25e3),I=new Kl(288),C=new Kl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=_(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=ku(t,l,0,w,I,C,k,x,T,h-T,u),x=S=k=0,T=h;for(var F=0;F<286;++F)I[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==_(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(t[h+O]==t[h+O-D]){for(var H=0;H<q&&t[h+H]==t[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){w[x++]=268435456|su[O]<<18|au[P];var z=31&su[O],W=31&au[P];k+=tu[z]+eu[W],++I[257+z],++C[W],A=h+O,++S}else w[x++]=t[h],++I[t[h]]}}u=ku(t,l,o,w,I,C,k,x,T,h-T,u)}return mu(a,0,i+gu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Eu=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Mu(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Au[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Tu(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Eu(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Eu(n,o-8,r.d()),Eu(n,o-4,i),n}var Nu=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.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>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Ru=!!to||!!Qn,Fu="text/plain",Ou=function(t,e,i){var n;void 0===i&&(i=!0);var[o,s]=t.split("?"),a=r({},e),l=null!==(n=null==s?void 0:s.split("&").map((t=>{var e,[r,n]=t.split("="),o=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],u=xo(a);return u&&l.push(u),o+"?"+l.join("&")},Pu=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Lu=t=>{var{data:e,compression:r}=t;if(e){if(r===Ul.GZipJS){var i=Mu(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Jl(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new Jl(n+8+(r-s<<1));a.set(i),i=a}var l=t.charCodeAt(s);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&t.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 mu(i,0,n)}(Pu(e)),{mtime:0}),n=new Blob([i],{type:Fu});return{contentType:Fu,body:n,estimatedSize:n.size}}if(r===Ul.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=Nu(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[l++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Pu(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Pu(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Pu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Du=[];Qn&&Du.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=Lu(t))&&void 0!==e?e:{},a=new Headers;vo(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(eo){var h=new eo;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Qn(l,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){lo.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{lo.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),to&&Du.push({transport:"XHR",method:t=>{var e,r=new to;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Lu(t))&&void 0!==e?e:{};vo(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Xn&&Xn.sendBeacon&&Du.push({transport:"sendBeacon",method:t=>{var e=Ou(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Lu(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Xn.sendBeacon(e,o)}catch(t){}}});var Bu=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Zu(t,e,r){return Pu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var $u={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Bu(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Bu(e,t))))),icontains:(t,e)=>e.map(qu).some((e=>t.map(qu).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(qu).every((e=>t.map(qu).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},qu=t=>t.toLowerCase();function Hu(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ti(n)||ii(n))return!1;var o=[String(n)],s=$u[i.operator];return!!s&&s(i.values,o)}))}var Vu=uo("[Stylesheet Loader]"),ju=Yn,Yu=Jn;function Gu(t){return"$survey_response_"+t}var zu="#020617",Wu={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:_l.Right,widgetType:bl.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:zu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Uu(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Xu(t){var e;void 0===t&&(t=Wu.backgroundColor),"#"===t[0]&&(e=Uu(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Uu(r)),!e)return zu;var i=e.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?zu:"white"}return zu}function Ju(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Vu.error("prepare_external_dependency_stylesheet returned null"),null)})(Yu,':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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Ku=(t,e,i)=>{var n=bh(t),o=Yu.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Yu.createElement("div");((t,e,i)=>{var n=r({},Wu,i),o=t.style,s=![_l.Center,_l.Left,_l.Right].includes(n.position)||e===Il.Widget&&(null==i?void 0:i.widgetType)===bl.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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)||Xu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Xu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Xu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Xu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),o.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Xu(l);o.setProperty("--ph-survey-input-text-color",u),o.setProperty("--ph-survey-rating-text-color",u),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,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Ju(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Yu.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Qu=(t,e)=>{if(!e)return null;var r=t[Gu(e)];return Ur(r)?[...r]:r},th=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=t;o?(Bl(i),o.capture(xl.SENT,r({[Al.SURVEY_NAME]:i.name,[Al.SURVEY_ID]:i.id,[Al.SURVEY_ITERATION]:i.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Al.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:Qu(e,t.id)}))),[Al.SURVEY_SUBMISSION_ID]:n,[Al.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,{$set:{[Pl(i,"responded")]:!0}})),s&&(ju.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),yh(i))):El.error("[survey sent] event not captured, PostHog instance not found.")},eh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!ni(t))).length>0,rh=(t,e,i)=>r({[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Al.SURVEY_PARTIALLY_COMPLETED]:eh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Al.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Al.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Qu((null==e?void 0:e.responses)||{},t.id)})))}),ih=(t,e,i)=>{if(e){if(!i){var n=gh(t);e.capture(xl.DISMISSED,r({},rh(t,n,e),{$set:{[Pl(t,"dismissed")]:!0}})),yh(t),Bl(t),ju.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else El.error("[survey dismissed] event not captured, PostHog instance not found.")},nh=(t,e)=>{if(e){var r=(t=>Ll("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=gh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(xl.ABANDONED,rh(t,i,e),{transport:"sendBeacon"})}}else El.error("[survey abandoned] event not captured, PostHog instance not found.")},oh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),sh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ah=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,oh(t.questions)):t.questions,lh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===kl.Always||mh(t)},uh=function(t,e){var r={__c:e="__cC"+ya++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i;return this.getChildContext||(r=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Na(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),hh=()=>hl(uh),ch=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return Ga(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function dh(t){return null!=t?t:"icontains"}function vh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==ju||null==(r=ju.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=dh(null==(i=t.conditions)?void 0:i.urlMatchType);return $u[s](o,[n])}var fh=t=>{var e=""+Ol+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ol+t.id+"_"+t.current_iteration),e},ph=(t,e)=>{try{localStorage.setItem(fh(t),JSON.stringify(e))}catch(t){El.error("Error setting in-progress survey state in localStorage",t)}},gh=t=>{try{var e=localStorage.getItem(fh(t));if(e)return JSON.parse(e)}catch(t){El.error("Error getting in-progress survey state from localStorage",t)}return null},mh=t=>{var e=gh(t);return!ni(null==e?void 0:e.surveySubmissionId)},yh=t=>{try{localStorage.removeItem(fh(t))}catch(t){El.error("Error clearing in-progress survey state from localStorage",t)}};function bh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}var _h=0;function wh(t,e,r,i,n,o){var s,a,l={};for(a in e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--_h,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return da.vnode&&da.vnode(u),u}var Ih=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Ch=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Sh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),kh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),xh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wh("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"})}),Ah=wh("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:[wh("title",{id:"close-survey-title",children:"Close survey"}),wh("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"})]}),Th=wh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wh("g",{"clip-path":"url(#clip0_2415_6911)",children:[wh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wh("g",{mask:"url(#mask0_2415_6911)",children:[wh("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"}),wh("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"}),wh("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"}),wh("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"}),wh("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"}),wh("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"})]})]}),wh("defs",{children:wh("clipPath",{id:"clip0_2415_6911",children:wh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Eh(){return wh("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Th]})}function Mh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:l}=hl(uh);return wh("div",{className:"bottom-section",children:[!a&&wh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Yn||Yn.open(o)),l?null==s||s():n()},children:e}),!i.whiteLabel&&wh(Eh,{})]})}function Nh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return wh("div",{class:"question-header",children:[wh(e.type===Cl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&ch({component:ka("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Rh(t){var{onClick:e}=t,{isPreviewMode:r}=hl(uh);return wh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Ah})}wh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wh("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 Fh=Yn;function Oh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=hl(uh);return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return So(Fh,"keydown",t),()=>{Fh.removeEventListener("keydown",t)}}),[s]),wh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&wh(Rh,{onClick:()=>s()}),wh("h3",{className:"thank-you-message-header",children:e}),r&&ch({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&wh(Mh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Ph=t=>Ur(t)&&t.every((t=>ei(t)));function Lh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:l}=hh(),u=ll(null),[h,c]=sl((()=>ei(a)?a:""));al((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+s;return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:r,htmlFor:d}),wh("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Dh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return wh(Aa,{children:[wh("div",{className:"question-container",children:wh(Nh,{question:e,forceDisableHtml:r})}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Bh(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[h,c]=sl((()=>oi(a)?a:Ur(a)&&a.length>0&&oi(parseInt(a[0]))?parseInt(a[0]):ei(a)&&oi(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=hh(),v=t=>d?s(t):o(t);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:r}),wh("div",{className:"rating-section",children:[wh("div",{className:"rating-options",children:["emoji"===e.display&&wh("div",{className:"rating-options-emoji",children:(3===e.scale?qh:Hh).map(((t,r)=>wh("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 t=r+1;c(t),e.skipSubmitButton&&v(t)},children:t},r)))}),"number"===e.display&&wh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Gh(e.scale).map(((t,r)=>wh(Zh,{displayQuestionIndex:i,active:h===t,appearance:n,num:t,setActiveNumber:t=>{c(t),e.skipSubmitButton&&v(t)}},r)))})]}),wh("div",{className:"rating-text",children:[wh("div",{children:e.lowerBoundLabel}),wh("div",{children:e.upperBoundLabel})]})]})]}),wh(Mh,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(h)&&!e.optional,appearance:n,onSubmit:()=>o(h),onPreviewSubmit:()=>s(h),skipSubmitButton:e.skipSubmitButton})]})}function Zh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return wh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function $h(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u=ll(null),h=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=sh(e,oh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=sl((()=>((t,e)=>ei(t)||Ph(t)?t:e===Cl.SingleChoice?null:[])(l,e.type))),[v,f]=sl((()=>((t,e)=>{if(ei(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Ph(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=hh(),g=e.type===Cl.SingleChoice,m=e.type===Cl.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Ur(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!e.optional&&(!!ii(c)||(!(!Ur(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),C=()=>{v.isSelected&&m?Ur(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Nh,{question:e,forceDisableHtml:i}),wh("fieldset",{className:"multiple-choice-options limit-height",children:[wh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===t:Ur(c)&&c.includes(t);return wh("label",{className:i?"choice-option-open":"",children:[wh("div",{className:"response-choice",children:[wh("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),wh("span",{children:i?t+":":t})]}),i&&wh("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:w,onInput:_,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),wh(Mh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:o,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var qh=[Sh,Ch,Ih],Hh=[kh,Sh,Ch,Ih,xh],Vh=[1,2,3,4,5],jh=[1,2,3,4,5,6,7],Yh=[0,1,2,3,4,5,6,7,8,9,10];function Gh(t){switch(t){case 5:default:return Vh;case 7:return jh;case 10:return Yh}}var zh=uo("[Surveys]");function Wh(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Sl.End:o;if(n.branching.type===Sl.End)return Sl.End;if(n.branching.type===Sl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Sl.ResponseBased){if(n.type===Cl.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===Sl.End?Sl.End:o}}else if(n.type===Cl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=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===Sl.End?Sl.End:o}}return o}return zh.warn("Falling back to next question index due to unexpected branching type"),o}var Uh=Yn,Xh=Jn,Jh="ph:show_survey_widget",Kh="PHWidgetSurveyClickListener",Qh=250,tc=20,ec=12;class rc{constructor(t){var e=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Ko);if(t)for(var e of t)mh(e)&&nh(e,this._posthog)},this.handlePopoverSurvey=t=>{var e;this.B(t.id),this.Z(t);var i=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Ku(t,this._posthog);if(i<=0)return Ya(wh(ac,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),n);var o=setTimeout((()=>{if(this.P.delete(t.id),!vh(t))return this.$(t);Ya(wh(ac,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*i);this.P.set(t.id,o)},this.q=t=>{var{shadow:e,isNewlyCreated:r}=Ku(t,this._posthog);r&&Ya(wh(uc,{posthog:this._posthog,survey:t},t.id),e)},this.H=t=>{this.V(t);var e=this.L.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Kh),this.L.delete(t.id),El.info("Removed click listener for survey "+t.id))},this.j=(t,e)=>{var r=Xh.querySelector(e),i=this.L.get(t.id);if(r){if(this.q(t),i){if(r===i.element)return;El.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.H(t)}if(!r.hasAttribute(Kh)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===_l.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=Uh.innerHeight,n=Uh.innerWidth,o=Qh,s=r.left+r.width/2-e/2;s+e>n-tc&&(s=n-e-tc),s<tc&&(s=tc);var a=ec,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:Wu.zIndex}}catch(t){return El.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Wu.maxWidth)):{};Uh.dispatchEvent(new CustomEvent(Jh,{detail:{surveyId:t.id,position:n}}))};So(r,"click",n),r.setAttribute(Kh,"true"),this.L.set(t.id,{element:r,listener:n,survey:t}),El.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.H(t)},this.renderPopover=t=>{var{shadow:e}=Ku(t,this._posthog);Ya(wh(ac,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),e)},this.renderSurvey=(t,e)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this.Y(t),Ya(wh(ac,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.W(t)&&e.U(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Il.Popover||t.type===Il.Widget)),i=e.X(r),n=new Set;i.forEach((t=>{if(t.type===Il.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Tab)return void e.q(t);if((null==(i=t.appearance)?void 0:i.widgetType)===bl.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.j(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ii(e.J)&&t.type===Il.Popover&&e.handlePopoverSurvey(t)})),e.L.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.H(r)}))}),t)},this.Z=t=>{ii(this.J)||El.error("Survey "+this.J+" already in focus. Cannot add survey "+t.id+"."),this.J=t.id},this.$=t=>{this.J!==t.id&&El.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.B(t.id),this.J=null,this.V(t)},this._posthog=t,this.J=null}B(t){var e=this.P.get(t);e&&(clearTimeout(e),this.P.delete(t))}cancelSurvey(t){this.P.has(t)&&(El.info("Cancelled pending survey "+t),this.B(t),this.J===t&&(this.J=null))}X(t){return t.sort(((t,e)=>{var r,i,n=mh(t),o=mh(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===kl.Always,a=e.schedule===kl.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}Y(t){if(!this.D.has(t.id))try{var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ti(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);e[c]||(e[c]=[]),e[c].push(u)}}else r=!0}}return{params:e,autoSubmit:r}}(Uh.location.search);if(0===Object.keys(e).length)return;El.info("[Survey Prefill] Detected URL prefill parameters");var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],o=Gu(t.id);try{switch(t.type){case Cl.SingleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=t.choices.length)return void lo.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[s];break;case Cl.MultipleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void lo.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];l.length<a.length&&lo.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=l;break;case Cl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||u<0||u>h)return void lo.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=u;break;default:lo.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){lo.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return void El.warn("[Survey Prefill] No valid responses after conversion");var i=zl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:s}=function(t,e,r){for(var i=0,n={},o=t.questions.length+1;i<t.questions.length&&0<o&&e.includes(i);){var s=t.questions[i];if(!s||!("skipSubmitButton"in s)||!s.skipSubmitButton)break;if(s.id){var a=Gu(s.id);ti(r[a])||(n[a]=r[a])}var l=Wh(t,i,s.id?r[Gu(s.id)]:null);if(l===Sl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=o>=t.questions.length;ph(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?t.questions.length-1:o}),El.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(s).length>0&&t.enable_partial_responses||a)&&th({responses:a?r:s,survey:t,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this.D.add(t.id)}catch(t){El.error("[Survey Prefill] Error handling URL prefill:",t)}}K(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}G(t){return!t.conditions||vh(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!ro)return!1;var n=mn(ro);return $u[dh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Yu||!Yu.querySelector(t.conditions.selector))}(t)}tt(t){return lh(t)||this.K(t.internal_targeting_flag_key)||mh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Ml(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Zl.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.K(t.linked_flag_key,n)?this.K(t.targeting_flag_key)?this.tt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Dl(t))&&!lh(t))(t)?(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(t){var e;if(!Nl(t)&&!Rl(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.K(r)}))}V(t){try{var e=Xh.querySelector(bh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){El.warn("Failed to remove survey "+t.id+" from DOM:",e)}}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.K.bind(this)}}}function ic(t,e){if(Xh&&Uh){var r,i=new rc(t);if(t.config.disable_surveys_automatic_display)return El.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return El.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ti(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),So(Xh,"visibilitychange",(()=>{Xh.hidden?ti(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function nc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;al((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===Il.Widget,o=vh(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&n;if(!o)return El.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(El.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};So(Uh,"popstate",o),So(Uh,"hashchange",o);var s=Uh.history.pushState,a=Uh.history.replaceState;return Uh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},Uh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{Uh.removeEventListener("popstate",o),Uh.removeEventListener("hashchange",o),Uh.history.pushState=s,Uh.history.replaceState=a}}}),[n,e,r,i])}function oc(t,e,r){if(void 0===e&&(e=_l.Right),t===Il.ExternalSurvey)return{};switch(e){case _l.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case _l.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case _l.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case _l.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case _l.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case _l.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case _l.Left:return{left:"30px"};case _l.Center:return{left:"50%",transform:"translateX(-50%)"};default:case _l.Right:return{right:t===Il.Widget&&r===bl.Tab?"60px":"30px"}}}function sc(t){switch(void 0===t&&(t=wl.Right),t){case wl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case wl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case wl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case wl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function ac(t){var e,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=(()=>{})}=t,y=ll(null),b=Number.isInteger(d),_=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:w,isSurveySent:I,hidePopupWithViewTransition:C}=function(t,e,r,i,n,o,s){var[a,l]=sl(i||0===r||t.type===Il.ExternalSurvey),[u,h]=sl(!1),c=()=>{var e=()=>{o&&n(t),l(!1)};Xh.startViewTransition?Xh.startViewTransition((()=>{var t;null==s||null==(t=s.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return al((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{vh(t)&&(l(!0),Uh.dispatchEvent(new Event("PHSurveyShown")),e.capture(xl.SHOWN,{[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(So(Uh,"PHSurveyClosed",d),So(Uh,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),Uh.removeEventListener("PHSurveyClosed",d),Uh.removeEventListener("PHSurveySent",n)}}return o(),()=>{Uh.removeEventListener("PHSurveyClosed",d),Uh.removeEventListener("PHSurveySent",n)}}}else El.error("usePopupVisibility hook called without a PostHog instance.")}),[]),nc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,_,b,v,f,y),S=I||d===l.questions.length,k=ul((()=>{var t=gh(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{ih(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||zl(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return w?wh(uh.Provider,{value:k,children:wh("div",{className:"ph-survey",style:r({},oc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?wh(Oh,{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||Wu,onClose:()=>{C(),m()}}):wh(lc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function lc(t){var e,{survey:i,forceDisableHtml:n,posthog:o}=t,[s,a]=sl((()=>{var t=gh(i);return null!=t&&t.responses&&El.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v}=hl(uh),[f,p]=sl((()=>{var t=gh(i);return l||(null==t?void 0:t.lastQuestionIndex)||0})),g=ul((()=>ah(i)),[i]);al((()=>{v&&!ti(l)&&p(l)}),[l,v]);var m=g.at(f);return m?wh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&wh(Rh,{onClick:()=>{u()}}),wh("div",{className:"survey-box",children:hc({question:m,forceDisableHtml:n,displayQuestionIndex:f,appearance:i.appearance||Wu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(o)if(l){var u=Gu(l),h=r({},s,{[u]:e});a(h);var c=Wh(i,n,e),v=c===Sl.End;v||(p(c),ph(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&th({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:o})}else El.error("onNextButtonClick called without a questionId.");else El.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:f,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?s[Gu(m.id)]:void 0})})]}):null}function uc(t){var e,r,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=sl(!0),[f,p]=sl(!1),[g,m]=sl({}),y=()=>{p(!f)};if(al((()=>{var t;if(h){if(!c){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(El.info("Received show event for feedback button survey "+l.id),m(r.detail.position||{}),y())};return So(Uh,Jh,e),()=>{Uh.removeEventListener(Jh,e)}}}else El.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),nc({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==kl.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return wh(Aa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&wh("button",{className:"ph-survey-widget-tab "+((null==(o=l.appearance)?void 0:o.tabPosition)===wl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:sc(null==(s=l.appearance)?void 0:s.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&wh(ac,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var hc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case Cl.Open:return ka(Lh,r({},u,{question:e,key:e.id}));case Cl.Link:return ka(Dh,r({},u,{question:e,key:e.id}));case Cl.Rating:return ka(Bh,r({},u,{question:e,key:e.id}));case Cl.SingleChoice:case Cl.MultipleChoice:return ka($h,r({},u,{question:e,key:e.id}));default:return El.error("Unsupported question type: "+e.type),null}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.generateSurveys=ic,io.extendPostHogWithSurveys=ic;var cc=uo("[Error tracking]");function dc(){return new _n([new On,new jn,new Ln,new Pn,new Hn,new qn,new Bn,new Vn],Fn())}class vc{constructor(t){var e,r;this.et=[],this.rt=dc(),this._instance=t,this.et=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Bo))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.et=n,this._instance.persistence&&this._instance.persistence.register({[Bo]:this.et,[Zo]:o})}get it(){var t,e=!!this._instance.get_property(Zo),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.rt.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.nt(e)){if(this.ot(e))return void cc.info("Skipping exception capture because a suppression rule matched");if(!this.it&&this.st(e))return void cc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ut(e))return void cc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ot(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ei(r)&&r.length>0&&t.$exception_types.push(r),ei(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.et.some((t=>{var r=t.values.map((t=>{var r,i=$u[t.operator],n=Ur(t.value)?t.value:[t.value],o=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}st(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ut(t){if(t.length>0){var e,r,i,n,o=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],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}nt(t){return!ni(t)&&Ur(t)}}var fc=uo("[ExceptionAutocapture]"),pc=dc(),gc={wrapOnError:t=>{var e=Yn;e||fc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n[4],a=n[0],l=pc.buildFromUnknown(s||a,{mechanism:{handled:!1}});return t(l),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Yn;e||fc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=pc.buildFromUnknown(i,{mechanism:{handled:!1}});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||fc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=i.find((t=>t instanceof Error)),a=pc.buildFromUnknown(s||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.errorWrappingFunctions=gc,io.posthogErrorWrappingFunctions=gc;var mc=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Ur(t)||t.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)}e!==ls&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};io.__PosthogExtensions__=io.__PosthogExtensions__||{};var yc={_patchFetch:(t,r,i)=>Mo(Yn,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return mc(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Mo(Yn.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return mc(t,e,r,u),i.call(this,n,u.url,s,a,l)}))};io.__PosthogExtensions__.tracingHeadersPatchFns=yc,io.postHogTracingHeadersPatchFns=yc;var bc,_c,wc=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ic=function(t){if("loading"===document.readyState)return"loading";var e=wc();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},Cc=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Sc=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:Cc(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>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},kc=-1,xc=function(){return kc},Ac=function(t){addEventListener("pageshow",(function(e){e.persisted&&(kc=e.timeStamp,t(e))}),!0)},Tc=function(){var t=wc();return t&&t.activationStart||0},Ec=function(t,e){var r=wc(),i="navigate";return xc()>=0?i="back-forward-cache":r&&(document.prerendering||Tc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Mc=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},Nc=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},Rc=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Fc=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Oc=function(t){var e=!1;return function(){e||(t(),e=!0)}},Pc=-1,Lc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Dc=function(t){"hidden"===document.visibilityState&&Pc>-1&&(Pc="visibilitychange"===t.type?t.timeStamp:0,Zc())},Bc=function(){addEventListener("visibilitychange",Dc,!0),addEventListener("prerenderingchange",Dc,!0)},Zc=function(){removeEventListener("visibilitychange",Dc,!0),removeEventListener("prerenderingchange",Dc,!0)},$c=function(){return Pc<0&&(Pc=Lc(),Bc(),Ac((function(){setTimeout((function(){Pc=Lc(),Bc()}),0)}))),{get firstHiddenTime(){return Pc}}},qc=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Hc=[1800,3e3],Vc=function(t,e){e=e||{},qc((function(){var r,i=$c(),n=Ec("FCP"),o=Mc("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Tc(),0),n.entries.push(t),r(!0)))}))}));o&&(r=Nc(t,n,Hc,e.reportAllChanges),Ac((function(i){n=Ec("FCP"),r=Nc(t,n,Hc,e.reportAllChanges),Rc((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},jc=[.1,.25],Yc=0,Gc=1/0,zc=0,Wc=function(t){t.forEach((function(t){t.interactionId&&(Gc=Math.min(Gc,t.interactionId),zc=Math.max(zc,t.interactionId),Yc=zc?(zc-Gc)/7+1:0)}))},Uc=function(){return bc?Yc:performance.interactionCount||0},Xc=function(){"interactionCount"in performance||bc||(bc=Mc("event",Wc,{type:"event",buffered:!0,durationThreshold:0}))},Jc=[],Kc=new Map,Qc=0,td=[],ed=function(t){if(td.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Jc[Jc.length-1],r=Kc.get(t.interactionId);if(r||Jc.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Kc.set(i.id,i),Jc.push(i)}Jc.sort((function(t,e){return e.latency-t.latency})),Jc.length>10&&Jc.splice(10).forEach((function(t){return Kc.delete(t.id)}))}}},rd=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=Oc(t),"hidden"===document.visibilityState?t():(r=e(t),Fc(t)),r},id=[200,500],nd=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},qc((function(){var r;Xc();var i,n=Ec("INP"),o=function(t){rd((function(){t.forEach(ed);var e=function(){var t=Math.min(Jc.length-1,Math.floor((Uc()-Qc)/50));return Jc[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=Mc("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=Nc(t,n,id,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Fc((function(){o(s.takeRecords()),i(!0)})),Ac((function(){Qc=Uc(),Jc.length=0,Kc.clear(),n=Ec("INP"),i=Nc(t,n,id,e.reportAllChanges)})))})))},od=[],sd=[],ad=0,ld=new WeakMap,ud=new Map,hd=-1,cd=function(t){od=od.concat(t),dd()},dd=function(){hd<0&&(hd=rd(vd))},vd=function(){ud.size>10&&ud.forEach((function(t,e){Kc.has(e)||ud.delete(e)}));var t=Jc.map((function(t){return ld.get(t.entries[0])})),e=sd.length-50;sd=sd.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<sd.length;i++){var n=sd[i];fd(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=od.length-1-50;od=od.filter((function(t,e){return t.startTime>ad&&e>o||r.has(t)})),hd=-1};td.push((function(t){t.interactionId&&t.target&&!ud.has(t.interactionId)&&ud.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;ad=Math.max(ad,t.processingEnd);for(var i=sd.length-1;i>=0;i--){var n=sd[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},sd.push(e)),(t.interactionId||"first-input"===t.entryType)&&ld.set(t,e),dd()}));var fd=function(t,e){for(var r,i=[],n=0;r=od[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},pd=[2500,4e3],gd={},md={onLCP:function(t,e){!function(t,e){e=e||{},qc((function(){var r,i=$c(),n=Ec("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Tc(),0),n.entries=[t],r())}))},s=Mc("largest-contentful-paint",o);if(s){r=Nc(t,n,pd,e.reportAllChanges);var a=Oc((function(){gd[n.id]||(o(s.takeRecords()),s.disconnect(),gd[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return rd(a)}),{once:!0,capture:!0})})),Fc(a),Ac((function(i){n=Ec("LCP"),r=Nc(t,n,pd,e.reportAllChanges),Rc((function(){n.value=performance.now()-i.timeStamp,gd[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=wc();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.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);e={element:Sc(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Vc(Oc((function(){var r,i=Ec("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=Mc("layout-shift",s);a&&(r=Nc(t,i,jc,e.reportAllChanges),Fc((function(){s(a.takeRecords()),r(!0)})),Ac((function(){n=0,i=Ec("CLS",0),r=Nc(t,i,jc,e.reportAllChanges),Rc((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:Sc(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:Ic(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Vc((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Ic(xc())};if(t.entries.length){var r=wc(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:Ic(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){_c||(_c=Mc("long-animation-frame",cd)),nd((function(e){var r=function(t){var e=t.entries[0],r=ld.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=fd(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||ud.get(e.interactionId),u=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:Sc(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:Ic(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(r)}),e)}};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.postHogWebVitalsCallbacks=md,io.postHogWebVitalsCallbacks=md;class yd{constructor(t){this.disabled=!1===t;var e=Kr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var bd="$copy_autocapture",_d=uo("[AutoCapture]");function wd(t,e){return e.length>t?e.slice(0,t)+"...":e}function Id(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!cs(e));return e}function Cd(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};ws.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=wd(1024,$s(t)):o.$el_text=wd(1024,bs(t)));var s=ms(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),vo(t.attributes,(function(r){var n;if((!Rs(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Zs(r.value)&&(n=r.name,!ei(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=ps(s).join(" ")),o["attr__"+r.name]=wd(1024,s)}}));for(var a=1,l=1,u=t;u=Id(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function Sd(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],h=t;h.parentNode&&!ds(h,"body");)fs(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(vo(u,(t=>{var e=Ns(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zs(f)&&f),Hr(ms(t),"ph-no-capture")&&(p=!0),d.push(Cd(t,o,s,a));var r=function(t){if(!Ns(t))return{};var e={};return vo(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zs(i)&&(e[r]=i)}})),e}(t);fo(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$s(t):d[0].$el_text=bs(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=ko(f))?void 0:g.host,b=null==Yn||null==(m=Yn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:fo({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Hs(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 kd{constructor(t){this.ht=!1,this.ct=null,this.dt=!1,this.instance=t,this.rageclicks=new yd(t.config.rageclick),this.vt=null}get ft(){var t,e,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}yt(){if(this.isBrowserSupported()){if(Yn&&Jn){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.bt(t)}catch(t){_d.error("Failed to capture event",t)}};if(So(Jn,"submit",t,{capture:!0}),So(Jn,"change",t,{capture:!0}),So(Jn,"click",t,{capture:!0}),this.ft.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event),this.bt(t,bd)};So(Jn,"copy",e,{capture:!0}),So(Jn,"cut",e,{capture:!0})}}}else _d.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ht&&(this.yt(),this.ht=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.dt=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Po]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.vt=t}getElementSelectors(t){var e,r=[];return null==(e=this.vt)||e.forEach((e=>{var i=null==Jn?void 0:Jn.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Po],i=this.ct;if(ii(i)&&!si(r)&&!this.instance._t())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}bt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_s(t);if(vs(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&As(i,this.instance.config.rageclick)&&this.bt(t,"$rageclick");var n=e===bd;if(i&&Ms(i,t,this.ft,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Sd(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:this.dt});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===bd){var l,u=ys(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Xr(null==Jn?void 0:Jn.querySelectorAll)}}var xd={};function Ad(t){return function(t,e){var r=xd[t];if(r)return r;var i=e[t];if(Jr(i)&&!no())return xd[t]=i.bind(e);var n=e.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[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){lo.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Xr(i)?xd[t]=i.bind(e):i}("MutationObserver",t)}function Td(t,e){return oi(t)&&t>=e}class Ed{wt(t){var e,r,i,n,o,s=this.It((null==t?void 0:t.__onCapture)||this.Ct.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(t,e){this.St=[],this.It=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.kt=t=>{var e=function(t){var e=_s(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ii(e)||this.xt(e)||this.St.push(e),this.St.length&&ti(this.At)&&(this.At=io.setTimeout((()=>{this.Tt()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.St.forEach((e=>{ti(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Mt=()=>{this.Nt=Date.now()},this.instance=t,this.ft=this.wt(e),this._onCapture=this.ft.__onCapture}start(t){this.Rt(),this.Ft(),this.Ot(),this.Pt(t)}Pt(t){if(!this.Lt){var e=Ad(io);this.Lt=new e((t=>{this.Dt(t)})),this.Lt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Lt)||t.disconnect(),this.Lt=void 0,io.removeEventListener("click",this.kt),io.removeEventListener("scroll",this.Et,{capture:!0}),io.removeEventListener("selectionchange",this.Mt)}Dt(t){this.Bt=Date.now()}Rt(){So(io,"click",this.kt)}Ft(){So(io,"scroll",this.Et,{capture:!0})}Ot(){So(io,"selectionchange",this.Mt)}xt(t){if(!t)return!0;if(!this.ft.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(hs(t.node))return!0;var r=this.St.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!ds(t.node,"html")&&cs(t.node)&&!ws.includes(t.node.tagName.toLowerCase()))}Tt(){if(this.St.length){clearTimeout(this.At),this.At=void 0;var t=this.St;for(var e of(this.St=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Bt&&e.timestamp<=this.Bt?this.Bt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&e.timestamp<=this.Nt?this.Nt-e.timestamp:void 0;var i=Td(e.scrollDelayMs,this.ft.scroll_threshold_ms),n=Td(e.selectionChangedDelayMs,this.ft.selection_change_threshold_ms),o=Td(e.mutationDelayMs,this.ft.mutation_threshold_ms),s=Td(e.absoluteDelayMs,1.1*this.ft.mutation_threshold_ms),a=oi(e.scrollDelayMs)&&e.scrollDelayMs<this.ft.scroll_threshold_ms,l=oi(e.mutationDelayMs)&&e.mutationDelayMs<this.ft.mutation_threshold_ms,u=oi(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.ft.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.ft.mutation_threshold_ms&&this.St.push(e))}this.St.length&&ti(this.At)&&(this.At=io.setTimeout((()=>{this.Tt()}),1e3))}}Ct(t,e){this.instance.capture("$dead_click",r({},e,Sd(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ed(t,e);var Md=uo("[ExternalScriptsLoader]"),Nd=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Md.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Jn?void 0:Jn.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Jn)return r("document not found");var i=Jn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Jn.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Jn.body.appendChild(i)};null!=Jn&&Jn.body?a():null==Jn||Jn.addEventListener("DOMContentLoaded",a)};io.__PosthogExtensions__=io.__PosthogExtensions__||{},io.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);Nd(t,o,r)},io.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Nd(t,i,r)};var Rd="";var Fd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Od(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Jn),Rd)return Rd;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+zl();!Rd&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",Rd=o)}return Rd}(t);if(!r){var i=(t=>{var e=t.match(Fd);return e?e[0]:""})(t);i!==r&&lo.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Pd={Zt:()=>!!Jn,$t:function(t){lo.error("cookieStore error: "+t)},qt:function(t){if(Jn){try{for(var e=t+"=",r=Jn.cookie.split(";").filter((t=>t.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(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ht:function(t){var e;try{e=JSON.parse(Pd.qt(t))||{}}catch(t){}return e},Vt:function(t,e,r,i,n){if(Jn)try{var o="",s="",a=Od(Jn.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=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&lo.warn("cookieStore warning: large cookie, len="+u.length),Jn.cookie=u,u}catch(t){return}},jt:function(t,e){if(null!=Jn&&Jn.cookie)try{Pd.Vt(t,"",-1,e)}catch(t){return}}},Ld=null,Dd={Zt:function(){if(!ii(Ld))return Ld;var t=!0;if(ti(Yn))t=!1;else try{var e="__mplssupport__";Dd.Vt(e,"xyz"),'"xyz"'!==Dd.qt(e)&&(t=!1),Dd.jt(e)}catch(e){t=!1}return t||lo.error("localStorage unsupported; falling back to cookie store"),Ld=t,t},$t:function(t){lo.error("localStorage error: "+t)},qt:function(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Dd.$t(t)}return null},Ht:function(t){try{return JSON.parse(Dd.qt(t))||{}}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Dd.$t(t)}},jt:function(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Dd.$t(t)}}},Bd=["$device_id","distinct_id",Yo,Go,ss,os],Zd={},$d={Zt:function(){return!0},$t:function(t){lo.error("memoryStorage error: "+t)},qt:function(t){return Zd[t]||null},Ht:function(t){return Zd[t]||null},Vt:function(t,e){Zd[t]=e},jt:function(t){delete Zd[t]}},qd=null,Hd={Zt:function(){if(!ii(qd))return qd;if(qd=!0,ti(Yn))qd=!1;else try{var t="__support__";Hd.Vt(t,"xyz"),'"xyz"'!==Hd.qt(t)&&(qd=!1),Hd.jt(t)}catch(t){qd=!1}return qd},$t:function(t){lo.error("sessionStorage error: ",t)},qt:function(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){Hd.$t(t)}return null},Ht:function(t){try{return JSON.parse(Hd.qt(t))||null}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Hd.$t(t)}},jt:function(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){Hd.$t(t)}}},Vd=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class jd{constructor(t){this._instance=t}get ft(){return this._instance.config}get consent(){return this.Yt()?Vd.DENIED:this.Gt}isOptedOut(){return"always"===this.ft.cookieless_mode||(this.consent===Vd.DENIED||this.consent===Vd.PENDING&&(this.ft.opt_out_capturing_by_default||"on_reject"===this.ft.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Vd.DENIED}optInOut(t){this.zt.Vt(this.Wt,t?1:0,this.ft.cookie_expiration,this.ft.cross_subdomain_cookie,this.ft.secure_cookie)}reset(){this.zt.jt(this.Wt,this.ft.cross_subdomain_cookie)}get Wt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get Gt(){var t=this.zt.qt(this.Wt);return vi(t)?Vd.GRANTED:Hr(fi,t)?Vd.DENIED:Vd.PENDING}get zt(){if(!this.Ut){var t=this.ft.opt_out_capturing_persistence_type;this.Ut="localStorage"===t?Dd:Pd;var e="localStorage"===t?Pd:Dd;e.qt(this.Wt)&&(this.Ut.qt(this.Wt)||this.optInOut(vi(e.qt(this.Wt))),e.jt(this.Wt,this.ft.cross_subdomain_cookie))}return this.Ut}Yt(){return!!this.ft.respect_dnt&&!!Co([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,io.doNotTrack],(t=>vi(t)))}}var Yd=uo("[Dead Clicks]"),Gd=()=>!0,zd=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qo)),i=t.instance.config.capture_dead_clicks;return si(i)?i:!!Kr(i)||r};class Wd{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qo]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Jt((()=>{this.Kt()}))}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Yd.error("failed to load script",e):t()}))}Kt(){var t;if(Jn){if(!this.Xt&&null!=(t=io.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.Xt=io.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(Jn),Yd.info("starting...")}}else Yd.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Yd.info("stopping..."))}}var Ud=uo("[ExceptionAutocapture]");class Xd{constructor(t){var e,r,i;this.Qt=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=io.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=io.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=io.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=io.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.te&&this.ft.capture_unhandled_errors&&(this.te=e(this.captureException.bind(this))),!this.ee&&this.ft.capture_unhandled_rejections&&(this.ee=r(this.captureException.bind(this))),!this.re&&this.ft.capture_console_errors&&(this.re=i(this.captureException.bind(this)))}catch(t){Ud.error("failed to start",t),this.ie()}}},this._instance=t,this.ne=!(null==(e=this._instance.persistence)||!e.props[Do]),this.oe=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,I:Ud}),this.ft=this.se(),this.startIfEnabledOrStop()}se(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(t)?e=r({},e,t):(ti(t)?this.ne:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.ft.capture_console_errors||this.ft.capture_unhandled_errors||this.ft.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ud.info("enabled"),this.ie(),this.Jt(this.Qt)):this.ie()}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Ud.error("failed to load script",e);t()}))}ie(){var t,e,r;null==(t=this.te)||t.call(this),this.te=void 0,null==(e=this.ee)||e.call(this),this.ee=void 0,null==(r=this.re)||r.call(this),this.re=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.ne=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Do]:this.ne}),this.ft=this.se(),this.startIfEnabledOrStop()}onConfigChange(){this.ft=this.se()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(i)?Ud.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Jd{constructor(t){var e;this._instance=t,this.ae=(null==Yn||null==(e=Yn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(lo.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.le&&this.le(),this.le=void 0,lo.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yn&&Yn.history){var r=this;null!=(t=Yn.history.pushState)&&t.__posthog_wrapped__||Mo(Yn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.ue("pushState")})),null!=(e=Yn.history.replaceState)&&e.__posthog_wrapped__||Mo(Yn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.ue("replaceState")})),this.he()}}ue(t){try{var e,r=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!r)return;r!==this.ae&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ae=r}catch(e){lo.error("Error capturing "+t+" pageview",e)}}he(){if(!this.le){var t=()=>{this.ue("popstate")};So(Yn,"popstate",t),this.le=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}}var Kd=uo("[SegmentIntegration]");function Qd(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||zl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(ts,"identified")),e()},n=r.user();"then"in n&&Xr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Kd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Kd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Kd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var tv="posthog-js";function ev(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class rv{constructor(t,e,r,i,n,o){this.name=tv,this.setupOnce=function(s){s(ev(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var iv=null!=Yn&&Yn.location?Eo(Yn.location.hash,"__posthog")||Eo(location.hash,"state"):null,nv="_postHogToolbarParams",ov=uo("[Toolbar]"),sv=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(sv||{});class av{constructor(t){this.instance=t}ce(t){io.ph_toolbar_state=t}de(){var t;return null!==(t=io.ph_toolbar_state)&&void 0!==t?t:sv.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Yn||!Jn)return!1;t=null!=t?t:Yn.location,r=null!=r?r:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var i,n=iv||Eo(t.hash,"__posthog")||Eo(t.hash,"state"),o=n?mo((()=>JSON.parse(atob(decodeURIComponent(n)))))||mo((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(nv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}ve(t){var e=io.ph_load_toolbar||io.ph_load_editor;!ni(e)&&Xr(e)?e(t,this.instance):ov.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Jn||!Jn.getElementById(as));if(!Yn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(nv,JSON.stringify(r({},n,{source:void 0}))),this.de()===sv.LOADED)this.ve(n);else if(this.de()===sv.UNINITIALIZED){var o;this.ce(sv.LOADING),null==(o=io.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return ov.error("[Toolbar] Failed to load",t),void this.ce(sv.UNINITIALIZED);this.ce(sv.LOADED),this.ve(n)})),So(Yn,"turbolinks:load",(()=>{this.ce(sv.UNINITIALIZED),this.loadToolbar(n)}))}return!0}fe(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var lv=uo("[TracingHeaders]");class uv{constructor(t){this.pe=void 0,this.ge=void 0,this.Qt=()=>{var t,e;ti(this.pe)&&(null==(t=io.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ti(this.ge)&&(null==(e=io.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return lv.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Jt(this.Qt):(null==(t=this.pe)||t.call(this),null==(e=this.ge)||e.call(this),this.pe=void 0,this.ge=void 0)}}var hv="https?://(.*)",cv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],dv=po(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],cv),vv="<masked>",fv=["li_fat_id"];function pv(t,e,r){if(!Jn)return{};var i,n=e?po([],cv,r||[]):[],o=gv(To(Jn.URL,n,vv),t),s=(i={},vo(fv,(function(t){var e=Pd.qt(t);i[t]=e||null})),i);return fo(s,o)}function gv(t,e){var r=dv.concat(e||[]),i={};return vo(r,(function(e){var r=Ao(t,e);i[e]=r||null})),i}function mv(t){var e=function(t){return t?0===t.search(hv+"google.([^/?]*)")?"google":0===t.search(hv+"bing.com")?"bing":0===t.search(hv+"yahoo.com")?"yahoo":0===t.search(hv+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ii(e)){i.$search_engine=e;var n=Jn?Ao(Jn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function yv(){return navigator.language||navigator.userLanguage}function bv(){return(null==Jn?void 0:Jn.referrer)||"$direct"}function _v(t,e){var r=t?po([],cv,e||[]):[],i=null==Kn?void 0:Kn.href.substring(0,1e3);return{r:bv().substring(0,1e3),u:i?To(i,r,vv):void 0}}function wv(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=ko(r))?void 0:e.host};if(i){n.$current_url=i;var o=ko(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=gv(i);fo(n,s)}if(r){var a=mv(r);fo(n,a)}return n}function Iv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Cv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Sv(t,e){if(!ro)return{};var r,i=t?po([],cv,e||[]):[],[n,o]=function(t){for(var e=0;e<pn.length;e++){var[r,i]=pn[e],n=r.exec(t),o=n&&(Xr(i)?i(n,t):i);if(o)return o}return["",""]}(ro);return fo(bo({$os:n,$os_version:o,$browser:dn(ro,navigator.vendor),$device:gn(ro),$device_type:mn(ro),$timezone:Iv(),$timezone_offset:Cv()}),{$current_url:To(null==Kn?void 0:Kn.href,i,vv),$host:null==Kn?void 0:Kn.host,$pathname:null==Kn?void 0:Kn.pathname,$raw_user_agent:ro.length>1e3?ro.substring(0,997)+"...":ro,$browser_version:fn(ro,navigator.vendor),$browser_language:yv(),$browser_language_prefix:(r=yv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:"web",$lib_version:so.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var kv=uo("[Web Vitals]"),xv=9e5;class Av{constructor(t){var e;this.me=!1,this.ht=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ye=()=>{clearTimeout(this.be),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._e=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ti(i))kv.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.we();if(!ti(n))if(ni(null==t?void 0:t.name)||ni(null==t?void 0:t.value))kv.error("Invalid metric received",t);else if(this.Ie&&t.value>=this.Ie)kv.error("Ignoring metric with value >= "+this.Ie,t);else this.F.url!==n&&(this.ye(),this.be=setTimeout(this.ye,this.flushToCaptureTimeoutMs)),ti(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=ti(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.F.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.ye()}},this.Qt=()=>{var t,e,r,i,n=io.__PosthogExtensions__;ti(n)||ti(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this._e.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this._e.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._e.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._e.bind(this)),this.ht=!0):kv.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.me=!(null==(e=this._instance.persistence)||!e.props[$o]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Kr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return ti(r)?(null==(e=this._instance.persistence)?void 0:e.props[Vo])||["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 Ie(){var t=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:xv;return 0<t&&t<=6e4?xv:t}get isEnabled(){var t=null==Kn?void 0:Kn.protocol;if("http:"!==t&&"https:"!==t)return kv.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=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(e)?e:this.me}startIfEnabled(){this.isEnabled&&!this.ht&&(kv.info("enabled, starting..."),this.Jt(this.Qt))}onRemoteConfig(t){var e=Kr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Kr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$o]:e}),this._instance.persistence.register({[Vo]:r})),this.me=e,this.startIfEnabled()}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?kv.error("failed to load script",e):t()}))}we(){var t=Yn?Yn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?po([],cv,r||[]):[];return To(t,i,vv)}kv.error("Could not determine current URL")}}var Tv=uo("[Heatmaps]");function Ev(t){return Kr(t)&&"clientX"in t&&"clientY"in t&&oi(t.clientX)&&oi(t.clientY)}class Mv{constructor(t){var e;this.me=!1,this.ht=!1,this.Ce=null,this.instance=t,this.me=!(null==(e=this.instance.persistence)||!e.props[Lo]),this.rageclicks=new yd(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Kr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return ti(this.instance.config.capture_heatmaps)?ti(this.instance.config.enable_heatmaps)?this.me:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ht)return;Tv.info("starting..."),this.Se(),this.ke()}else{var t;clearInterval(null!==(t=this.Ce)&&void 0!==t?t:void 0),this.xe(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Lo]:e}),this.me=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.F;return this.F=void 0,t}Ae(t){this.kt(t.originalEvent,"deadclick")}ke(){this.Ce&&clearInterval(this.Ce),this.Ce=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Jn)?setInterval(this.Te.bind(this),this.flushIntervalMilliseconds):null}Se(){Yn&&Jn&&(this.Ee=this.Te.bind(this),So(Yn,"beforeunload",this.Ee),this.Me=t=>this.kt(t||(null==Yn?void 0:Yn.event)),So(Jn,"click",this.Me,{capture:!0}),this.Ne=t=>this.Re(t||(null==Yn?void 0:Yn.event)),So(Jn,"mousemove",this.Ne,{capture:!0}),this.Fe=new Wd(this.instance,Gd,this.Ae.bind(this)),this.Fe.startIfEnabled(),this.Oe=this.ke.bind(this),So(Jn,"visibilitychange",this.Oe),this.ht=!0)}xe(){var t;Yn&&Jn&&(this.Ee&&Yn.removeEventListener("beforeunload",this.Ee),this.Me&&Jn.removeEventListener("click",this.Me,{capture:!0}),this.Ne&&Jn.removeEventListener("mousemove",this.Ne,{capture:!0}),this.Oe&&Jn.removeEventListener("visibilitychange",this.Oe),clearTimeout(this.Pe),null==(t=this.Fe)||t.stop(),this.ht=!1)}Le(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&cs(i)&&!ds(i,"body");){if(i===r)return!1;if(Hr(e,null==Yn?void 0:Yn.getComputedStyle(i).position))return!0;i=Cs(i)}return!1}(_s(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}kt(t,e){var i;if(void 0===e&&(e="click"),!hs(t.target)&&Ev(t)){var n=this.Le(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.De(r({},n,{type:"rageclick"})),this.De(n)}}Re(t){!hs(t.target)&&Ev(t)&&(clearTimeout(this.Pe),this.Pe=setTimeout((()=>{this.De(this.Le(t,"mousemove"))}),500))}De(t){if(Yn){var e=Yn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?po([],cv,i||[]):[],o=To(e,n,vv);this.F=this.F||{},this.F[o]||(this.F[o]=[]),this.F[o].push(t)}}Te(){this.F&&!Qr(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Nv{constructor(t){this.Be=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(lo.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Ze=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.$e()}$e(){var t;this.qe=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Be)}destroy(){var t;null==(t=this.qe)||t.call(this),this.qe=void 0}doPageView(t,e){var r,i=this.He(t,e);return this.Ze={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.He(t,null==(e=this.Ze)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ze)?void 0:t.pageViewId}}He(t,e){var r=this.Ze;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$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(!(ti(o)||ti(s)||ti(a)||ti(l)||ti(u)||ti(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,lo),d=o<=1?1:pi(a/o,0,1,lo),v=l<=1?1:pi(u/l,0,1,lo),f=l<=1?1:pi(h/l,0,1,lo);i=fo(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=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Rv=uo("[FeatureFlags]"),Fv=uo("[FeatureFlags]",{debugEnabled:!0}),Ov="$active_feature_flags",Pv="$override_feature_flags",Lv="$feature_flag_payloads",Dv="$override_feature_flag_payloads",Bv="$feature_flag_request_id",Zv="$feature_flag_evaluated_at",$v=t=>{var e={};for(var[r,i]of go(t||{}))i&&(e[r]=i);return e},qv=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Rv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Hv=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Vv{constructor(t){this.Ve=!1,this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this._instance=t,this.featureFlagEventHandlers=[]}Xe(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Rv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}Je(){return this.Xe().length>0}flags(){if(this._instance.config.__preview_remote_config)this.We=!0;else{var t=!this.Ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Qe({disableFlags:t})}}get hasLoadedFlags(){return this.je}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Uo),e=this._instance.get_property(Pv),i=this._instance.get_property(Dv);if(!i&&!e)return t||{};var n=fo({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,l,u=n[s],h=null==e?void 0:e[s],c=ti(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=ti(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.Ve||(Rv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Ve=!0),n}getFlagVariants(){var t=this._instance.get_property(zo),e=this._instance.get_property(Pv);if(!e)return t||{};for(var r=fo({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Ve||(Rv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Ve=!0),r}getFlagPayloads(){var t=this._instance.get_property(Lv),e=this._instance.get_property(Dv);if(!e)return t||{};for(var r=fo({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Ve||(Rv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Ve=!0),r}reloadFeatureFlags(){this.Ge||this._instance.config.advanced_disable_feature_flags||this.Ke||(this.Ke=setTimeout((()=>{this.Qe()}),5))}tr(){clearTimeout(this.Ke),this.Ke=void 0}ensureFlagsLoaded(){this.je||this.Ye||this.Ke||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ge=t}Qe(t){var e;if(this.tr(),!this._instance._t())if(this.Ye)this.ze=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Xo)||{}),group_properties:this._instance.get_property(Jo)};ii(n)||ti(n)||(o.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.Je()&&(o.evaluation_environments=this.Xe());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);s&&(o.timezone=Iv()),this.Ye=!0,this._instance._send_request({method:"POST",url:u,data:o,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i=!0;(200===t.statusCode&&(this.ze||(this.$anon_distinct_id=void 0),i=!1),this.Ye=!1,this.We)||(this.We=!0,this._instance.er(null!==(r=t.json)&&void 0!==r?r:{}));if(!o.disable_flags||this.ze)if(this.Ue=!i,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(Hv.FeatureFlags))Rv.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 n;if(!o.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},i);this.ze&&(this.ze=!1,this.Qe())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(Bv)||void 0,o=this._instance.get_property(Zv)||void 0,s=this._instance.get_property(Qo)||{};if((e.send_event||!("send_event"in e))&&(!(t in s)||!s[t].includes(i))){var a,l,u,h,c,d,v,f,p;Ur(s[t])?s[t].push(i):s[t]=[i],null==(a=this._instance.persistence)||a.register({[Qo]:s});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||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[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.Ue};ti(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),ti(null==g?void 0:g.original_variant)&&ti(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ti(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}Rv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Je()&&(i.evaluation_environments=this.Xe()),this._instance._send_request({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;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ti(r)?void 0:!!r}Rv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.je=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=qv(t),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(Ur(l)){Rv.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;e&&e.register({[Ov]:l,[zo]:d})}else{var f=l,p=u,g=a;t.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),e&&e.register(r({[Ov]:Object.keys($v(f)),[zo]:f||{},[Lv]:p||{},[Uo]:g||{}},h?{[Bv]:h}:{},c?{[Zv]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.rr(e)}}override(t,e){void 0===e&&(e=!1),Rv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Rv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Pv),this._instance.persistence.unregister(Dv),this.rr(),Fv.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.Ve=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Pv),Fv.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({[Pv]:i})}else this._instance.persistence.register({[Pv]:r.flags});Fv.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Dv),Fv.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Dv]:r.payloads}),Fv.info("Payload overrides set",{payloads:r.payloads}))),void this.rr()}this.rr()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.je){var{flags:e,flagVariants:r}=this.ir();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wo)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$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(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Ov]:Object.keys($v(l)),[zo]:l}),this.rr()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wo),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wo),null==(i=this._instance.persistence)||i.register({[Wo]:n}),t(n)}}})}ir(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}rr(t){var{flags:e,flagVariants:r}=this.ir();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Xo)||{};this._instance.register({[Xo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Xo)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Jo)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Jo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Jo)||{};this._instance.register({[Jo]:r({},e,{[t]:{}})})}else this._instance.unregister(Jo)}reset(){this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this.$anon_distinct_id=void 0,this.tr(),this.Ve=!1}}var jv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Yv{constructor(t,e){this.ft=t,this.props={},this.nr=!1,this.sr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.zt=this.ar(t),this.load(),t.debug&&lo.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.lr}ar(t){-1===jv.indexOf(t.persistence.toLowerCase())&&(lo.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Bd,...t];return r({},Dd,{Ht:function(t){try{var e={};try{e=Pd.Ht(t)||{}}catch(t){}var r=fo(e,JSON.parse(Dd.qt(t)||"{}"));return Dd.Vt(t,r),r}catch(t){}return null},Vt:function(t,r,i,n,o,s){try{Dd.Vt(t,r,void 0,void 0,s);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Pd.Vt(t,a,i,n,o,s)}catch(t){Dd.$t(t)}},jt:function(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Pd.jt(t,e)}catch(t){Dd.$t(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Dd.Zt()?Dd:"localstorage+cookie"===i&&e.Zt()?e:"sessionstorage"===i&&Hd.Zt()?Hd:"memory"===i?$d:"cookie"===i?Pd:e.Zt()?e:Pd}properties(){var t={};return vo(this.props,(function(e,r){if(r===zo&&Kr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ii(o=us)?a:Un&&o.indexOf===Un?-1!=o.indexOf(s):(vo(o,(function(t){if(a||(a=t===s))return ho})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.lr){var t=this.zt.Ht(this.sr);t&&(this.props=fo({},t))}}save(){this.lr||this.zt.Vt(this.sr,this.props,this.ur,this.hr,this.cr,this.ft.debug)}remove(){this.zt.jt(this.sr,!1),this.zt.jt(this.sr,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Kr(t)){ti(e)&&(e="None"),this.ur=ti(r)?this.dr:r;var i=!1;if(vo(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Kr(t)){this.ur=ti(e)?this.dr:e;var r=!1;if(vo(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.nr){var t=pv(this.ft.custom_campaign_params,this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties);Qr(bo(t))||this.register(t),this.nr=!0}}update_search_keyword(){var t;this.register((t=null==Jn?void 0:Jn.referrer)?mv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:bv(),$referring_domain:null!=Jn&&Jn.referrer&&(null==(t=ko(Jn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[is]||this.props[ns]||this.register_once({[os]:_v(this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};vo([ns,is],(e=>{var r=this.props[e];r&&vo(r,(function(e,r){t["$initial_"+jr(r)]=e}))}));var e,r,i=this.props[os];if(i){var n=(e=wv(i),r={},vo(e,(function(t,e){r["$initial_"+jr(e)]=t})),r);fo(t,n)}return t}safe_merge(t){return vo(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.dr=this.ur=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.ar(t),n=this.props;this.clear(),this.zt=i,this.props=n,this.save()}}set_disabled(t){this.lr=t,this.lr?this.remove():this.save()}set_cross_subdomain(t){t!==this.hr&&(this.hr=t,this.remove(),this.save())}set_secure(t){t!==this.cr&&(this.cr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Oo]||{};r[t]=e,this.props[Oo]=r,this.save()}remove_event_timer(t){var e=(this.props[Oo]||{})[t];return ti(e)||(delete this.props[Oo][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Gv=uo("[Product Tours]"),zv="ph_product_tours";class Wv{constructor(t){this.vr=null,this.pr=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Ho]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.vr||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Ho))||this.Jt((()=>this.gr()))}Jt(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Gv.error("Could not load product tours script",e):t()}))}gr(){var t;!this.vr&&null!=(t=io.__PosthogExtensions__)&&t.generateProductTours&&(this.vr=io.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ur(this.pr)||e){var r=this._instance.persistence;if(r){var i=r.props[zv];if(Ur(i)&&!e)return this.pr=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Gv.error(n),void t([],{isLoaded:!1,error:n})}var o=Ur(e.json.product_tours)?e.json.product_tours:[];this.pr=o,r&&r.register({[zv]:o}),t(o,{isLoaded:!0})}})}else t(this.pr,{isLoaded:!0})}getActiveProductTours(t){ni(this.vr)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.vr.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.vr)||e.showTourById(t)}previewTour(t){this.vr?this.vr.previewTour(t):this.Jt((()=>{var e;this.gr(),null==(e=this.vr)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.vr)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.vr)||t.nextStep()}previousStep(){var t;null==(t=this.vr)||t.previousStep()}clearCache(){var t;this.pr=null,null==(t=this._instance.persistence)||t.unregister(zv)}resetTour(t){var e;null==(e=this.vr)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.vr)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.vr)||e.cancelPendingTour(t)}}class Uv{constructor(){this.mr={},this.mr={}}on(t,e){return this.mr[t]||(this.mr[t]=[]),this.mr[t].push(e),()=>{this.mr[t]=this.mr[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.mr[t]||[])r(e);for(var i of this.mr["*"]||[])i(t,e)}}function Xv(t,e,r){if(ni(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Jv{constructor(t){this.yr=new Uv,this.br=(t,e)=>this._r(t,e)&&this.wr(t,e)&&this.Ir(t,e)&&this.Cr(t,e),this._r=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Sr=new Set,this.kr=new Set}init(){var t;if(!ti(null==(t=this._instance)?void 0:t.Ar)){var e;null==(e=this._instance)||e.Ar(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ti(null==(e=this._instance)?void 0:e.Ar)&&(t.forEach((t=>{var e,r;null==(e=this.kr)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Sr)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.Sr.has(t)||this.Sr.has(null==e?void 0:e.event))&&this.kr&&(null==(r=this.kr)?void 0:r.size)>0&&this.kr.forEach((t=>{this.Tr(e,t)&&this.yr.emit("actionCaptured",t.name)}))}Er(t){this.onAction("actionCaptured",(e=>t(e)))}Tr(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.br(t,r))return!0;return!1}onAction(t,e){return this.yr.on(t,e)}wr(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Xv(i,e.url,e.url_matching||"contains"))return!1}return!0}Ir(t,e){return!!this.Mr(t,e)&&(!!this.Nr(t,e)&&!!this.Rr(t,e))}Mr(t,e){var r;if(null==e||!e.href)return!0;var i=this.Fr(t);if(i.length>0)return i.some((t=>Xv(t.href,e.href,e.href_matching||"exact")));var n,o=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!o&&Xv((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Nr(t,e){var r;if(null==e||!e.text)return!0;var i=this.Fr(t);if(i.length>0)return i.some((t=>Xv(t.text,e.text,e.text_matching||"exact")||Xv(t.$el_text,e.text,e.text_matching||"exact")));var n,o,s,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!ni(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),o=e.text,s=e.text_matching||"exact",n.some((t=>Xv(t,o,s))))}Rr(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch(t){return!1}return!1}Fr(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Cr(t,e){return null==e||!e.properties||0===e.properties.length||Hu(e.properties.reduce(((t,e)=>{var r=Ur(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Kv{constructor(t){this._instance=t,this.Or=new Map,this.Pr=new Map,this.Lr=new Map}Dr(t,e){return!!t&&Hu(t.propertyFilters,null==e?void 0:e.properties)}Br(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}Zr(t,e,r){var i=(r===yl.Activation?this.Or:this.Pr).get(t),n=[];return this.$r((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Dr(o,e)}))}register(t){var e;ti(null==(e=this._instance)?void 0:e.Ar)||(this.qr(t),this.Hr(t))}Hr(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Vr){this.Vr=new Jv(this._instance),this.Vr.init();this.Vr.Er((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Vr)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.Lr.get(e.name);r&&r.push(t.id),this.Lr.set(e.name,r||[t.id])}})))}))}}qr(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e.Ar(((t,e)=>{this.onEvent(t,e)})),this.Or=this.Br(t,yl.Activation),this.Pr=this.Br(t,yl.Cancellation)}}onEvent(t,e){var r,i=this.jr(),n=this.Yr(),o=this.Gr(),s=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(o===t&&e&&s.length>0){var a,l;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:s});var u=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(l=e.properties)?void 0:l.$product_tour_id);if(u){var h=s.indexOf(u);h>=0&&(s.splice(h,1),this.zr(s))}}else{if(this.Pr.has(t)){var c=this.Zr(t,e,yl.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=s.indexOf(t.id);e>=0&&s.splice(e,1),this.Wr(t.id)})),this.zr(s))}if(this.Or.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Or.get(t)});var d=this.Zr(t,e,yl.Activation);this.zr(s.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.Yr(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Lr.has(t)&&this.zr(i.concat(this.Lr.get(t)||[]))}zr(t){var e,r=this.jr(),i=this.Yr(),n=[...new Set(t)].filter((t=>!this.Ur(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.Yr(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Or}Xr(){return this.Vr}}class Qv extends Kv{constructor(t){super(t)}Yr(){return"$surveys_activated"}Gr(){return xl.SHOWN}$r(t){var e;null==(e=this._instance)||e.getSurveys(t)}Wr(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}jr(){return El}Ur(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class tf{constructor(t){this.Jr=void 0,this._surveyManager=null,this.Kr=!1,this.Qr=[],this.ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ni(e))return El.warn("Flags not loaded yet. Not loading surveys.");var r=Ur(e);this.Jr=r?e.length>0:e,El.info("flags response received, isSurveysEnabled: "+this.Jr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Fl)||null!=r&&r.startsWith(Ol))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Kr)El.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)El.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())El.info("Not loading surveys in cookieless mode without consent.");else{var t=null==io?void 0:io.__PosthogExtensions__;if(t){if(!ti(this.Jr)||this._instance.config.advanced_enable_surveys){var e=this.Jr||this._instance.config.advanced_enable_surveys;this.Kr=!0;try{var r=t.generateSurveys;if(r)return void this.ei(r,e);var i=t.loadExternalDependency;if(!i)return void this.ri("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.ri("Could not load surveys script",r):this.ei(t.generateSurveys,e)}))}catch(t){throw this.ri("Error initializing surveys",t),t}finally{this.Kr=!1}}}else El.error("PostHog Extensions not found.")}}ei(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Qv(this._instance),El.info("Surveys loaded successfully"),this.ii({isLoaded:!0})}ri(t,e){El.error(t,e),this.ii({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Qr.push(t),this._surveyManager&&this.ii({isLoaded:!0}),()=>{this.Qr=this.Qr.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return El.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(Ko);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.ti?this.ti.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.ti=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.ti=null;var n=e.statusCode;if(200!==n||!e.json){var o="Surveys API could not be loaded, status: "+n;El.error(o);var s={isLoaded:!1,error:o};return t([],s),void(null==r||r({surveys:[],context:s}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Nl(t)||Rl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[Ko]:l});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}ii(t){for(var e of this.Qr)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){El.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);El.warn("init was not called")}ni(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}oi(t){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.ni(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ni(this._surveyManager))return El.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.oi(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ni(this._surveyManager)?(El.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((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.oi(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var r;if(ni(this._surveyManager))El.warn("init was not called");else{var i="string"==typeof t?this.ni(t):t;if(null!=i&&i.id)if(Zl.includes(i.type)){var n=null==Jn?void 0:Jn.querySelector(e);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(El.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;El.info("Rendering survey "+i.id+" with delay of "+(null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(i,n),El.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);El.warn("Survey element not found")}else El.warn("Surveys of type "+i.type+" cannot be rendered in the app");else El.warn("Survey not found")}}displaySurvey(t,e){var i;if(ni(this._surveyManager))El.warn("init was not called");else{var n=this.ni(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void El.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,e.selector)}else El.warn("Survey not found")}}cancelPendingSurvey(t){ni(this._surveyManager)?El.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var ef=uo("[Conversations]");class rf{constructor(t){this.si=void 0,this._conversationsManager=null,this.ai=!1,this.li=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;ni(e)||(si(e)?this.si=e:(this.si=e.enabled,this.li=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.si=void 0,this.li=null}loadIfEnabled(){if(!this._conversationsManager&&!this.ai&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==io?void 0:io.__PosthogExtensions__;if(t&&!ti(this.si)&&this.si)if(this.li&&this.li.token){this.ai=!0;try{var e=t.initConversations;if(e)return this.ui(e),void(this.ai=!1);var r=t.loadExternalDependency;if(!r)return void this.hi("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.hi("Could not load conversations script",e):this.ui(t.initConversations),this.ai=!1}))}catch(t){this.hi("Error initializing conversations",t),this.ai=!1}}else ef.error("Conversations enabled but missing token in remote config.")}}ui(t){if(this.li)try{this._conversationsManager=t(this.li,this._instance),ef.info("Conversations loaded successfully")}catch(t){this.hi("Error completing conversations initialization",t)}else ef.error("Cannot complete initialization: remote config is null")}hi(t,e){ef.error(t,e),this._conversationsManager=null,this.ai=!1}show(){this._conversationsManager?this._conversationsManager.show():ef.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.si&&!ii(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(ef.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(ef.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(ef.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(ef.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}var nf=uo("[RateLimiter]");class of{constructor(t){var e,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{nf.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void nf.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=t.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=(new Date).getTime(),o=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(rs))&&void 0!==e?e:{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||t||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||t||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(rs,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var sf=uo("[RemoteConfig]");class af{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=io._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}ci(t){var e,r;null!=(e=io.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(sf.error("PostHog Extensions not found. Cannot load remote config."),t())}di(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return sf.info("Using preloaded remote config",this.remoteConfig),void this.er(this.remoteConfig);if(this._instance._t())return void sf.warn("Remote config is disabled. Falling back to local config.");this.ci((t=>{if(!t)return sf.info("No config found after loading remote JS config. Falling back to JSON."),void this.di((t=>{this.er(t)}));this.er(t)}))}catch(t){sf.error("Error loading remote config",t)}}er(t){t?this._instance.config.__preview_remote_config?(this._instance.er(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):sf.info("__preview_remote_config is disabled. Logging config instead",t):sf.error("Failed to fetch remote config from PostHog.")}}var lf=3e3;class uf{constructor(t,e){this.vi=!0,this.fi=[],this.pi=pi((null==e?void 0:e.flush_interval_ms)||lf,250,5e3,lo.createLogger("flush interval"),lf),this.gi=t}enqueue(t){this.fi.push(t),this.mi||this.yi()}unload(){this.bi();var t=this.fi.length>0?this.wi():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.gi(r({},t,{transport:"sendBeacon"}))}))}enable(){this.vi=!1,this.yi()}yi(){var t=this;this.vi||(this.mi=setTimeout((()=>{if(this.bi(),this.fi.length>0){var e=this.wi(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Ur(r.data)&&vo(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.gi(r)};for(var i in e)r()}}),this.pi))}bi(){clearTimeout(this.mi),this.mi=void 0}wi(){var t={};return vo(this.fi,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;ti(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.fi=[],t}}var hf=["retriesPerformedSoFar"];class cf{constructor(t){this.Ii=!1,this.Ci=3e3,this.fi=[],this._instance=t,this.fi=[],this.Si=!0,!ti(Yn)&&"onLine"in Yn.navigator&&(this.Si=Yn.navigator.onLine,this.ki=()=>{this.Si=!0,this.Te()},this.xi=()=>{this.Si=!1},So(Yn,"online",this.ki),So(Yn,"offline",this.xi))}get length(){return this.fi.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,hf);oi(e)&&e>0&&(n.url=Ou(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Ai(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Ai(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.fi.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),lo.warn(n),this.Ii||(this.Ii=!0,this.Ti())}Ti(){if(this.Ei&&clearTimeout(this.Ei),0===this.fi.length)return this.Ii=!1,void(this.Ei=void 0);this.Ei=setTimeout((()=>{this.Si&&this.fi.length>0&&this.Te(),this.Ti()}),this.Ci)}Te(){var t=Date.now(),e=[],r=this.fi.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.fi=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Ei&&(clearTimeout(this.Ei),this.Ei=void 0),this.Ii=!1,ti(Yn)||(this.ki&&(Yn.removeEventListener("online",this.ki),this.ki=void 0),this.xi&&(Yn.removeEventListener("offline",this.xi),this.xi=void 0)),this.fi))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){lo.error(t)}this.fi=[]}}class df{constructor(t){this.Mi=()=>{var t,e,r,i;this.Ni||(this.Ni={});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.Ni.lastScrollY=Math.ceil(o),this.Ni.maxScrollY=Math.max(o,null!==(t=this.Ni.maxScrollY)&&void 0!==t?t:0),this.Ni.maxScrollHeight=Math.max(s,null!==(e=this.Ni.maxScrollHeight)&&void 0!==e?e:0),this.Ni.lastContentY=a,this.Ni.maxContentY=Math.max(a,null!==(r=this.Ni.maxContentY)&&void 0!==r?r:0),this.Ni.maxContentHeight=Math.max(l,null!==(i=this.Ni.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Ni}resetContext(){var t=this.Ni;return setTimeout(this.Mi,0),t}startMeasuringScrollPosition(){So(Yn,"scroll",this.Mi,{capture:!0}),So(Yn,"scrollend",this.Mi,{capture:!0}),So(Yn,"resize",this.Mi)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yn?void 0:Yn.document.documentElement;var t=Ur(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Yn?void 0:Yn.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yn&&(Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yn&&(Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft)||0}}var vf=t=>_v(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class ff{constructor(t,e,r,i){this.Ri=t=>{var e=this.Fi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Oi(this._instance)};this.Pi.register({[es]:r})}},this._instance=t,this.Li=e,this.Pi=r,this.Oi=i||vf,this.Li.onSessionId(this.Ri)}Fi(){return this.Pi.props[es]}getSetOnceProps(){var t,e=null==(t=this.Fi())?void 0:t.props;return e?"r"in e?wv(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vo(bo(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+jr(r)]=e})),t}}var pf=uo("[SessionId]");class gf{on(t,e){return this.Di.on(t,e)}constructor(t,e,r){var i;if(this.Bi=[],this.Zi=void 0,this.Di=new Uv,this.$i=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.ft=t.config,this.Pi=t.persistence,this.qi=void 0,this.Hi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Vi=e||zl,this.ji=r||zl;var n=this.ft.persistence_name||this.ft.token,o=this.ft.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pi(o,60,36e3,pf.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Yi(),this.Gi="ph_"+n+"_window_id",this.zi="ph_"+n+"_primary_window_exists",this.Wi()){var s=Hd.Ht(this.Gi),a=Hd.Ht(this.zi);s&&!a?this.qi=s:Hd.jt(this.Gi),Hd.Vt(this.zi,!0)}if(null!=(i=this.ft.bootstrap)&&i.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.ft.bootstrap.sessionID);this.Ui(this.ft.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){pf.error("Invalid sessionID in bootstrap",t)}this.Xi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ti(this.Bi)&&(this.Bi=[]),this.Bi.push(t),this.Hi&&t(this.Hi,this.qi),()=>{this.Bi=this.Bi.filter((e=>e!==t))}}Wi(){return"memory"!==this.ft.persistence&&!this.Pi.lr&&Hd.Zt()}Ji(t){t!==this.qi&&(this.qi=t,this.Wi()&&Hd.Vt(this.Gi,t))}Ki(){return this.qi?this.qi:this.Wi()?Hd.Ht(this.Gi):null}Ui(t,e,r){t===this.Hi&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Hi=t,this.Pi.register({[Yo]:[e,t,r]}))}Qi(){var t=this.Pi.props[Yo];return Ur(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ui(null,null,null)}destroy(){clearTimeout(this.tn),this.tn=void 0,this.Zi&&Yn&&(Yn.removeEventListener("beforeunload",this.Zi,{capture:!1}),this.Zi=void 0),this.Bi=[]}Xi(){this.Zi=()=>{this.Wi()&&Hd.jt(this.zi)},So(Yn,"beforeunload",this.Zi,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.ft.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.Qi(),s=this.Ki(),a=oi(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,h=!u&&!t&&this.$i(r,i);u||h||a?(n=this.Vi(),s=this.ji(),pf.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.ji(),l=!0);var c=0===i||!t||a?r:i,d=0===o?(new Date).getTime():o;return this.Ji(s),this.Ui(n,c,d),t||this.Yi(),l&&this.Bi.forEach((t=>t(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}}Yi(){clearTimeout(this.tn),this.tn=setTimeout((()=>{var[t]=this.Qi();if(this.$i((new Date).getTime(),t)){var e=this.Hi;this.resetSessionId(),this.Di.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var mf=["$set_once","$set"],yf=uo("[SiteApps]");class bf{constructor(t){this._instance=t,this.en=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rn(t,e){if(e){var r=this.globalsForEvent(e);this.en.push(r),this.en.length>1e3&&(this.en=this.en.slice(10))}}get siteAppLoaders(){var t;return null==(t=io._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ar(this.rn.bind(this));this.nn=()=>{t(),this.en=[],this.nn=void 0}}}globalsForEvent(t){var e,n,o,s,a,l,u;if(!t)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}=t;return{event:r({},i(t,mf),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.en.length&&(yf.info("Processing "+this.en.length+" events for site app with id "+t.id),this.en.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.nn)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,yf.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){yf.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){yf.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}sn(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}an(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){yf.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.sn(),void this._instance.on("eventCaptured",(t=>this.an(t)))):void yf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.nn)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;io["__$$ph_site_app_"+t]=n._instance,null==(e=io.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return yf.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else yf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var _f=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&$r(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>$r(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},wf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),If="i.posthog.com";class Cf{constructor(t){this.ln={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+If,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.ln[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=wf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=wf.EU:this.ln[this.apiHost]=wf.CUSTOM),this.ln[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===wf.CUSTOM)return this.apiHost+e;var r=If+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Sf={icontains:(t,e)=>!!Yn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yn&&Bu(e.href,t),not_regex:(t,e)=>!!Yn&&!Bu(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class kf{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{kf.un("retrieved web experiments from the server"),e.hn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.hn)kf.un("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.hn)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ei(i)&&t.variants[i]&&e.cn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];kf.dn(o)&&e.cn(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())kf.un("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.hn))return this.hn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();kf.un("applying feature flags",t),t.forEach((t=>{var e;if(this.hn&&null!=(e=this.hn)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.hn)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.cn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=kf.getWindowLocation();if(null!=t&&t.search){var e=Ao(null==t?void 0:t.search,"__experiment_id"),r=Ao(null==t?void 0:t.search,"__experiment_variant");e&&r&&(kf.un("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.vn(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}vn(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(kf.un("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.cn(i[0].name,e,i[0].variants[e].transforms))}static dn(t){return!ni(t.conditions)&&(kf.fn(t)&&kf.pn(t))}static fn(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=kf.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||Sf[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Yn?void 0:Yn.location}static pn(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.utm))return!0;var r=pv();if(r.utm_source){var i,n,o,s,a,l,u,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static un(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];lo.info("[WebExperiments] "+t,r)}cn(t,e,r){this._is_bot()?kf.un("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;kf.un("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):kf.un("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?_f(Xn,this._instance.config.custom_blocked_useragents):void 0}}var xf=uo("[PostHog ExternalIntegrations]"),Af={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Tf{constructor(t){this._instance=t}Jt(t,e){var r;null==(r=io.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return xf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=io.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.Jt(Af[e],(()=>{var r;null==(r=io.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=io.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=io.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var Ef="[SessionRecording]",Mf=uo(Ef);class Nf{get started(){var t;return!(null==(t=this.gn)||!t.isStarted)}get status(){return this.gn?this.gn.status:this.mn&&!this.yn?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.mn=!1,this.bn=void 0,this._instance=t,!this._instance.sessionManager)throw Mf.error("started without valid sessionManager"),new Error(Ef+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Ef+' cannot be used with cookieless_mode="always"')}get yn(){var t,e=!(null==(t=this._instance.get_property(jo))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.yn||null==(e=this.gn)||!e.isStarted){var r=!ti(Object.assign)&&!ti(Array.from);this.yn&&r?(this._n(t),Mf.info("starting")):this.stopRecording()}}_n(t){var e,r,i;this.yn&&(null!=io&&null!=(e=io.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=io.__PosthogExtensions__)&&r.initSessionRecording?this.wn(t):null==(i=io.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.In,(e=>{if(e)return Mf.error("could not load recorder",e);this.wn(t)})))}stopRecording(){var t,e;null==(t=this.bn)||t.call(this),this.bn=void 0,null==(e=this.gn)||e.stop()}Cn(){var t;null==(t=this._instance.persistence)||t.unregister(Go)}Sn(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.Cn();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[jo]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ti(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.bn)||e.call(this),this.bn=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Sn(t),this.mn=!0,this.startIfEnabledOrStop()):this.mn=!0:Mf.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.gn)&&r.log?this.gn.log(t,e):Mf.warn("log called before recorder was ready")}get In(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(jo);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}wn(t){var e,r;if(null==(e=io.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.gn||(this.gn=null==(r=io.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.gn._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.gn.start(t)}onRRwebEmit(t){var e;null==(e=this.gn)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.gn)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.gn)||t.overrideSampling()}overrideTrigger(t){var e,r;this.gn||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.gn)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.gn)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.gn)||!r.tryAddCustomEvent(t,e))}}var Rf={},Ff=()=>{},Of="posthog",Pf=!Ru&&-1===(null==ro?void 0:ro.indexOf("MSIE"))&&-1===(null==ro?void 0:ro.indexOf("Mozilla")),Lf=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Io(null==Jn?void 0:Jn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ff,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:Kn&&ei(null==Kn?void 0:Kn.search)&&-1!==Kn.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_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(e=Yn.location)?void 0:e.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:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;lo.error(e)},get_device_id:t=>t,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:lf},error_tracking:{},_onCapture:Ff,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Df=t=>{var e={};ti(t.process_person)||(e.person_profiles=t.process_person),ti(t.xhr_headers)||(e.request_headers=t.xhr_headers),ti(t.cookie_name)||(e.persistence_name=t.cookie_name),ti(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ti(t.store_google)||(e.save_campaign_params=t.store_google),ti(t.verbose)||(e.debug=t.verbose);var r=fo({},e,t);return Ur(t.property_blacklist)&&(ti(t.property_denylist)?r.property_denylist=t.property_blacklist:Ur(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:lo.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Bf{constructor(){this.__forceAllowLocalhost=!1}get kn(){return this.__forceAllowLocalhost}set kn(t){lo.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Zf{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Bf,this.xn=!1,this.version=so.LIB_VERSION,this.An=new Uv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Lf(),this.SentryIntegration=rv,this.sentryIntegration=t=>function(t,e){var r=ev(t,e);return{name:tv,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tn=!1,this.En=null,this.Mn=null,this.Nn=null,this.featureFlags=new Vv(this),this.toolbar=new av(this),this.scrollManager=new df(this),this.pageViewManager=new Nv(this),this.surveys=new tf(this),this.conversations=new rf(this),this.experiments=new kf(this),this.exceptions=new vc(this),this.rateLimiter=new of(this),this.requestRouter=new Cf(this),this.consent=new jd(this),this.externalIntegrations=new Tf(this),this.people={set:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>lo.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Of){var i,n=null!==(i=Rf[r])&&void 0!==i?i:new Zf;return n._init(t,e,r),Rf[r]=n,Rf[Of][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ti(t)||ri(t))return lo.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={},e.debug=this.Rn(e.debug),this.Fn=e,this.On=[],e.person_profiles&&(this.Mn=e.person_profiles),this.set_config(fo({},Lf(e.defaults),Df(e),{name:i,token:t})),this.config.on_xhr_error&&lo.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Ul.GZipJS;var o=this.Pn();this.persistence=new Yv(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yv(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.Ln=new uf((t=>this.Dn(t)),this.config.request_queue_config),this.Bn=new cf(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 gf(this),this.sessionPropsManager=new ff(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(lo.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Zn(l)}),0)):(lo.info("Initializing extensions synchronously"),this.Zn(l)),so.DEBUG=so.DEBUG||this.config.debug,so.DEBUG&&lo.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(zl()),d=null!=(u=e.bootstrap)&&u.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(ts,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.$n()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ls,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(zl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ts,"anonymous")}return So(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Qd(this,(()=>this.qn())):this.qn(),Xr(this.config._onCapture)&&this.config._onCapture!==Ff&&(lo.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&lo.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}Zn(t){var e=performance.now();this.historyAutocapture=new Jd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new uv(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new bf(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Nf(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new kd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Wv(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Mv(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Av(this)})),r.push((()=>{this.exceptionObserver=new Xd(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new Wd(this,zd),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Hn){var t=this.Hn;this.Hn=void 0,this.er(t)}})),this.Vn(r,e)}Vn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Vn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){lo.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);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&&lo.info("PostHog extensions initialized ("+i+"ms)")}er(t){var e,r,i,n,o,s,a,l,u;if(!Jn||!Jn.body)return lo.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.er(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Hn=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Hr(t.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hr(t.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mn?this.Mn:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(s=this.productTours)||s.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}qn(){try{this.config.loaded(this)}catch(t){lo.critical("`loaded` function failed",t)}this.jn(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Yn()}),1),new af(this).load(),this.featureFlags.flags()}jn(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ln)||t.enable()))}_dom_loaded(){this.is_capturing()&&co(this.__request_queue,(t=>this.Dn(t))),this.__request_queue=[],this.jn()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.Gn()&&this.capture("$pageleave"),null==(t=this.Ln)||t.unload(),null==(e=this.Bn)||e.unload()):this.Gn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Pf?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Ou(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=Ou(o.url,{_:(new Date).getTime().toString(),ver:so.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Du.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),l=null!==(i=null==(n=Co(a,(t=>t.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({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}Dn(t){this.Bn?this.Bn.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];co(t,(t=>{t&&(e=t[0],Ur(e)?n.push(t):Xr(t)?t.call(this):Ur(t)&&"alias"===e?r.push(t):Ur(t)&&-1!==e.indexOf("capture")&&Xr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){co(t,(function(t){if(Ur(t[0])){var r=e;vo(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}$n(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ln){if(this.is_capturing())if(!ti(t)&&ei(t)){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!=e&&e.$current_url&&!ei(null==e?void 0:e.$current_url)&&(lo.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$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=zl(),h={uuid:u,event:t,properties:this.calculateEventProperties(t,e||{},l,u)};"$pageview"===t&&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="$groupidentify"!==t,d=this.zn(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=_o(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ti(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===xl.DISMISSED||t===xl.SENT){var v=null==e?void 0:e[Al.SURVEY_ID],f=null==e?void 0:e[Al.SURVEY_ITERATION];Bl({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Pl({id:v,current_iteration:f},t===xl.SENT?"responded":"dismissed")]:!0})}else t===xl.SHOWN&&(h.$set=r({},h.$set,{[Al.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(Qr(p)||this.setPersonPropertiesForFlags(p),!ni(this.config.before_send)){var g=this.Wn(h);if(!g)return;h=g}this.An.emit("eventCaptured",h);var m={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.Dn(m):this.Ln.enqueue(m),h}lo.critical("This capture call is ignored due to client rate limiting.")}}else lo.error("No event name provided to posthog.capture")}else lo.uninitializedWarning("posthog.capture")}Ar(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);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"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ei(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&lo.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=Sv(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&&fo(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fo(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Bn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===wf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fo(a,u),"$pageview"===t&&Jn&&(a.title=Jn.title),!ti(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}ro&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fo({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ur(this.config.property_denylist)?vo(this.config.property_denylist,(function(t){delete a[t]})):lo.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&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.Un();return a.$process_person_profile=g,g&&!o&&this.Xn("_calculate_event_properties"),a}zn(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.Un())return t;if(this.xn)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=fo({},i,n||{},t||{}),s=this.config.sanitize_properties;return s&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),e&&(this.xn=!0),Qr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Jn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},o=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=r({},n,t),a=r({},o,e),l={};for(var[u,h]of Object.entries(s)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ti(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.An.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=$l),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return lo.uninitializedWarning("posthog.identify");if(oi(t)&&(t=t.toString(),lo.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))lo.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ls){if(this.Xn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Fo)&&(this.unregister(Fo),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(ts)||"anonymous");t!==n&&s?(this.persistence.set_property(ts,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Nn=Zu(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(Qo))}}else lo.critical('The string "'+ls+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else lo.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.Xn("posthog.setPersonProperties")){var i=Zu(this.get_distinct_id(),t,e);this.Nn!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Nn=i):lo.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else lo.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Xn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(lo.info("reset"),!this.__loaded)return lo.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(ts,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Nn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ls,$device_id:null},"");else{var s=this.config.get_device_id(zl());this.register_once({distinct_id:s,$device_id:t?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 t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.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(t,e){return t===this.get_property(Ro)?(lo.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xn("posthog.alias")?(ti(e)&&(e=this.get_distinct_id()),t!==e?(this.Jn(Fo,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(lo.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Kr(t)){var i,n,o,s,a,l,u;fo(this.config,Df(t));var h=this.Pn();null==(i=this.persistence)||i.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yv(r({},this.config,{persistence:"sessionStorage"}),h);var c=this.Rn(this.config.debug);si(c)&&(this.config.debug=c),si(this.config.debug)&&(this.config.debug?(so.DEBUG=!0,Dd.Zt()&&Dd.Vt("ph_debug","true"),lo.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(so.DEBUG=!1,Dd.Zt()&&Dd.jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Kn(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Of;return e!==Of&&(e=Of+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(ts))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(ts))}Un(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Fo])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ss]))}Gn(){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.Un()||this.Xn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Xn(t){return"never"===this.config.person_profiles?(lo.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jn(ss,!0),!0)}Pn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Kn(){var t,e,r,i,n=this.Pn();(null==(t=this.persistence)?void 0:t.lr)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.lr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new gf(this),this.pageViewManager=new Nv(this),this.persistence&&(this.sessionPropsManager=new ff(this,this.sessionManager,this.persistence)),this.sessionRecording=new Nf(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Kn(),this.jn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Yn()}else lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ls,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.Yn())):lo.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 t=this.consent.consent;return t===Vd.GRANTED?"granted":t===Vd.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.Kn()}_is_bot(){return Xn?_f(Xn,this.config.custom_blocked_useragents):void 0}Yn(){Jn&&("visible"===Jn.visibilityState?this.Tn||(this.Tn=!0,this.capture("$pageview",{title:Jn.title},{send_instantly:!0}),this.En&&(Jn.removeEventListener("visibilitychange",this.En),this.En=null)):this.En||(this.En=this.Yn.bind(this),So(Jn,"visibilitychange",this.En)))}debug(t){!1===t?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.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}))}_t(){var t,e,r,i,n,o,s,a=this.Fn||{};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?(lo.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=lo,o=(e="advanced_disable_flags")in(t=a)&&!ti(t[e]),s=r in t&&!ti(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}Wn(t){if(ni(this.config.before_send))return t;var e=Ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ni(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return li(t.event)?lo.warn(n+". This can cause unexpected behavior."):lo.info(n),null}r.properties&&!Qr(r.properties)||lo.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Ze)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Rn(t){var e=si(t)&&!t,r=Dd.Zt()&&"true"===Dd.qt("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=yo(t.prototype[e[r]])}(Zf,["identify"]);var $f,qf={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1},Hf=($f=Rf[Of]=new Zf,function(){function t(){t.done||(t.done=!0,Pf=!1,vo(Rf,(function(t){t._dom_loaded()})))}null!=Jn&&Jn.addEventListener?"complete"===Jn.readyState?t():So(Jn,"DOMContentLoaded",t,{capture:!1}):Yn&&lo.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),$f);export{Ul as Compression,qf as DEFAULT_PRODUCT_TOUR_APPEARANCE,Tl as DisplaySurveyType,Zf as PostHog,xl as SurveyEventName,Al as SurveyEventProperties,yl as SurveyEventType,_l as SurveyPosition,Sl as SurveyQuestionBranchingType,Cl as SurveyQuestionType,kl as SurveySchedule,wl as SurveyTabPosition,Il as SurveyType,bl as SurveyWidgetType,Hf as default,Hf as posthog,Xl as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.full.js.map
|