posthog-js 1.366.1 → 1.366.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function e(e){return function(){var i=this,r=arguments;return new Promise((function(n,s){var o=e.apply(i,r);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var n,s=["type"],o=Object.defineProperty,a=(t,e,i)=>((t,e,i)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),l=Object.defineProperty,u=(t,e,i)=>((t,e,i)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),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"]},v={};function f(t){if(v[t])return v[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in c?c[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)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,i){var r,n=t+"."+String(i);if(p[n])return p[n].call(e);var s=f(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(p[n]=o,o.call(e)):e[i]}var m={};function y(t,e,i){var r=t+"."+String(i);if(m[r])return m[r].bind(e);var n=f(t)[i];return"function"!=typeof n?e[i]:(m[r]=n,n.bind(e))}var b={childNodes:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),contains:(t,e)=>y("Node",t,"contains")(e),getRootNode:t=>y("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>g("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>g("Element",t,"querySelectorAll")(e),mutationObserver:()=>f("MutationObserver").constructor};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(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]"==={}.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;return e?((i=Array.from(e,(e=>S(e,t.href))).join("")).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):null}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var i;try{i=C(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(e){i=t.cssText}return t.styleSheet.href?L(i,t.styleSheet.href):i}var r=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(r=r.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?L(r,e):r}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 i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-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){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function T(t){var{element:e,maskInputOptions:i,tagName:r,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&A(n);return(i[r.toLowerCase()]||l&&i[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function A(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?A(e):null}function N(t,e){var i,r;try{r=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||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,j=1,q=new RegExp("[^a-z0-9-_:]"),Z=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function U(t,e){return e&&""!==e.trim()?W(t,e):e}function W(t,e){var i=Y.get(t);if(i||(i=t.createElement("a"),Y.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function G(t,e,i,r){return r?"src"===i||"href"===i&&("use"!==e||"#"!==r[0])||"xlink:href"===i&&"#"!==r[0]?U(t,r):"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(z),e.length>i;){var s=r(V);if(","===s.slice(-1))s=U(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=U(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?L(r,W(t)):"object"===e&&"data"===i?U(t,r):r:U(t,r):r}function X(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function J(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&J(b.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&J(b.parentNode(t),e,i)}function K(t,e,i,r){var n;if(w(t)){if(!b.childNodes(n=t).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(J(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function Q(t){return null==t?"":t.toLowerCase()}function tt(t,e){var{doc:i,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,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:S,iframeLoadTimeout:x=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:O=(()=>!1),newlyAddedElement:P=!1}=e,{needsMask:j}=e,{preserveWhiteSpace:V=!0}=e;j||(j=K(t,o,a,void 0===j));var z,Y=function(t,e){var{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:o,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)){var i=e.getId(t);return 1===i?void 0:i}}(i,r);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 i,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=A(t.tagName);return q.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;w>_;_++){var I=t.attributes[_];X(m,I.name)||(y[I.name]=G(r,m,A(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(r,S);!x&&S.includes(".css")&&(x=k(r,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 M=C(t.sheet);M&&(y._cssText=M)}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=T({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}if("option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected),"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 i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((E in n?n[E]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).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=r.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=r.createElement("canvas"),B=D.getContext("2d"));var j=t,Z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+Z+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop)),g){var{width:Y,height:U}=t.getBoundingClientRect();y={class:y.class,rr_width:Y+"px",rr_height:U+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(i=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:(W=t,Boolean("svg"===W.tagName||W.ownerSVGElement)||void 0),needBlock:g,rootId:p,isCustom:i};var W}(t,{doc:i,blockClass:n,blockSelector:s,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 i,{needsMask:r,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,l=b.textContent(t),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(i=o.sheet)?void 0:i.cssRules)&&(l=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,W(e.doc))}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&r&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*")),{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:o,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}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:j,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:O,newlyAddedElement:P});if(!Y)return console.warn(t,"not serialized"),null;z=r.hasNode(t)?r.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&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(Y,f)&&(V||Y.type!==h.Text||Y.isStyle||Y.textContent.replace(/^\s+|\s+$/gm,"").length)?H():Z;var U=Object.assign(Y,{id:z});if(r.add(t,U),z===Z)return null;y&&y(t);var J=!l;if(U.type===h.Element){J=J&&!U.needBlock,delete U.needBlock;var et=b.shadowRoot(t);et&&I(et)&&(U.isShadowHost=!0)}if((U.type===h.Document||U.type===h.Element)&&J){f.headWhitespace&&U.type===h.Element&&"head"===U.tagName&&(V=!1);var it={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O};if(U.type===h.Element&&"textarea"===U.tagName&&void 0!==U.attributes.value);else for(var rt of Array.from(b.childNodes(t))){var nt=tt(rt,it);nt&&U.childNodes.push(nt)}var st=null;if(w(t)&&(st=b.shadowRoot(t)))for(var ot of Array.from(b.childNodes(st))){var at=tt(ot,it);at&&(I(st)&&(at.isShadow=!0),U.childNodes.push(at))}}var lt=b.parentNode(t);return lt&&_(lt)&&I(lt)&&(U.isShadow=!0),U.type===h.Element&&"iframe"===U.tagName&&function(t,e,i){var r=t.contentWindow;if(r){var n,s=!1;try{n=r.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&S){var i=tt(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});i&&S(t,i)}}),x),U.type===h.Element&&"link"===U.tagName&&"string"==typeof U.attributes.rel&&("stylesheet"===U.attributes.rel||"preload"===U.attributes.rel&&"string"==typeof U.attributes.href&&"css"===N(U.attributes.href))&&function(t,e,i){var r,n=!1;try{r=t.sheet}catch(t){return}if(!r){var s=setTimeout((()=>{n||(e(),n=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(M){var e=tt(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});e&&M(t,e)}}),F),U}let et=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 it={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},rt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},nt={};function st(t){if(nt[t])return nt[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in it?it[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in rt?rt[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return nt[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?nt[t]=u:i}catch(t){return i}}var ot={};function at(t,e,i){var r,n=t+"."+String(i);if(ot[n])return ot[n].call(e);var s=st(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(ot[n]=o,o.call(e)):e[i]}var lt={};function ut(t,e,i){var r=t+"."+String(i);if(lt[r])return lt[r].bind(e);var n=st(t)[i];return"function"!=typeof n?e[i]:(lt[r]=n,n.bind(e))}function ht(){return st("MutationObserver").constructor}var ct={childNodes:t=>at("Node",t,"childNodes"),parentNode:t=>at("Node",t,"parentNode"),parentElement:t=>at("Node",t,"parentElement"),textContent:t=>at("Node",t,"textContent"),contains:(t,e)=>ut("Node",t,"contains")(e),getRootNode:t=>ut("Node",t,"getRootNode")(),host:t=>t&&"host"in t?at("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?at("Element",t,"shadowRoot"):null,querySelector:(t,e)=>at("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>at("Element",t,"querySelectorAll")(e),mutationObserver:ht};function dt(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}var vt="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.",ft={map:{},getId(){return console.error(vt),-1},getNode(){return console.error(vt),null},removeNodeFromMap(){console.error(vt)},has(){return console.error(vt),!1},reset(){console.error(vt)}};function pt(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}}function gt(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>gt(t,e,s||{},!0)}function mt(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ft=new Proxy(ft,{get(t,e,i){return"map"===e&&console.error(vt),Reflect.get(t,e,i)}}));var yt=Date.now;function bt(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=ct.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=ct.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function wt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _t(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t){return t?t.nodeType===t.ELEMENT_NODE?t:ct.parentElement(t):null}function Ct(t,e,i,r){if(!t)return!1;var n=It(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(J(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function St(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Z}function kt(t,e){if(_(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=ct.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||kt(r,e))}function xt(t){return Boolean(t.changedTouches)}function Tt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function At(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Et(t){return!!t&&(t instanceof et&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(ct.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(yt=()=>(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):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}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 Nt(t){var e,i=null;return"getRootNode"in t&&(null==(e=ct.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ct.host(ct.getRootNode(t))&&(i=ct.host(ct.getRootNode(t))),i}function Mt(t){var e=t.ownerDocument;return!!e&&(ct.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Nt(i);)i=e;return i}(t);return ct.contains(e,i)}(t))}var Ft=(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))(Ft||{}),Ot=(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))(Ot||{}),Pt=(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))(Pt||{}),Lt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Lt||{}),Dt=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Dt||{}),Bt=(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))(Bt||{});function jt(t){return"__ln"in t}class qt{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,i=0;t>i;i++)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&&jt(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&jt(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.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 Zt,$t=(t,e)=>t+"@"+e;class Ht{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,i=new qt,r=t=>{for(var e=t,i=Z;i===Z;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=ct.parentNode(n);if(s&&Mt(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Nt(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=tt(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=>{Tt(t,this.mirror)&&this.iframeManager.addIframe(t),At(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Et(n)&&this.shadowDomManager.addShadowRoot(ct.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:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)zt(this.removes,s,this.mirror)&&!this.movedSet.has(ct.parentNode(s))||n(s);for(var o of this.addedSet)Yt(this.droppedSet,o)||zt(this.removes,o,this.mirror)?Yt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(ct.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=i.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(ct.parentNode(d.value));if(-1===r(d.value))continue;if(-1!==v){l=d;break}var f=ct.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ct.host(f);if(-1!==this.mirror.getId(p)){l=d;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=ct.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{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 i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e)),e.attributes.value=Array.from(ct.childNodes(t),(t=>ct.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!St(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=ct.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:K(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,It(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,n=t.target.getAttribute(r);if("value"===r){var s=R(i);n=T({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(i.contentDocument)return;r="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!X(i.tagName,r))if(o.attributes[r]=G(this.doc,A(i.tagName),A(r),n),"style"===r){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(i.style))){var u=i.style.getPropertyValue(l),h=i.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===i.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===r&&"DIALOG"===i.tagName&&(o.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(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 i=this.mirror.getId(e),r=_(t.target)?this.mirror.getId(ct.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||St(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Vt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||kt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[$t(i,r)]?Vt(this.movedSet,e):this.removes.push({parentId:r,id:i,isShadow:!(!_(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(St(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[$t(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(ct.childNodes(t).forEach((t=>this.genAdds(t))),Et(t)&&ct.childNodes(ct.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 Vt(t,e){t.delete(e),ct.childNodes(e).forEach((e=>Vt(t,e)))}function zt(t,e,i){return 0!==t.length&&function(t,e,i){for(var r,n=ct.parentNode(e),s=function(){var e=i.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=ct.parentNode(n)};n;)if(r=s())return r.v;return!1}(t,e,i)}function Yt(t,e){return 0!==t.size&&Ut(t,e)}function Ut(t,e){var i=ct.parentNode(e);return!!i&&(!!t.has(i)||Ut(t,i))}var Wt=t=>Zt?function(){try{return t(...arguments)}catch(t){if(Zt&&!0===Zt(t))return;throw t}}:t,Gt=[];function Xt(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 Jt(t,e){var i=new Ht;Gt.push(i),i.init(t);var r=new(ht())(Wt(i.processMutations.bind(i)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Kt(t){var{scrollCb:e,doc:i,mirror:r,blockClass:n,blockSelector:s,sampling:o}=t;return dt("scroll",Wt(pt(Wt((t=>{var o=Xt(t);if(o&&!Ct(o,n,s,!0)){var a=r.getId(o);if(o===i&&i.defaultView){var l=bt(i.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),i)}var Qt=["INPUT","TEXTAREA","SELECT"],te=new WeakMap;function ee(t){return function(t,e){if(se("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||se("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||se("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||se("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(i)}else if(t.parentStyleSheet){var r=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(r)}return e}(t,[])}function ie(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function re(t,e){var i,r,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:ct.host(e));var l="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.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!==s&&-1!==s&&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,i=null==(e=u.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Wt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function ne(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:i,mousemoveCb:r,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,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),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...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&&(r=Jt(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:i,doc:r,mirror:n}=t;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=pt(Wt((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),a),h=Wt(pt(Wt((t=>{var e=Xt(t),{clientX:i,clientY:r}=xt(t)?t.changedTouches[0]:t;s||(s=yt()),l.push({x:i,y:r,id:n.getId(e),timeOffset:yt()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Ot.Drag:t instanceof MouseEvent?Ot.MouseMove:Ot.TouchMove)})),o,{trailing:!1})),c=[dt("mousemove",h,r),dt("touchmove",h,r),dt("drag",h,r)];return Wt((()=>{c.forEach((t=>t()))}))}(t),o=function(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,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(Pt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=A(t),l=(t=>r=>{var a=Xt(r);if(!Ct(a,s,o,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=Lt.Mouse;break;case"touch":l=Lt.Touch;break;case"pen":l=Lt.Pen}l===Lt.Touch&&(Pt[t]===Pt.MouseDown?u="TouchStart":Pt[t]===Pt.MouseUp&&(u="TouchEnd"))}else xt(r)&&(l=Lt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Lt.Touch||u.startsWith("Mouse")&&l===Lt.Mouse)&&(l=null)):Pt[t]===Pt.Click&&(l=h,h=null);var c=xt(r)?r.changedTouches[0]:r;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Wt(e)(i({type:Pt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Pt[t]){case Pt.MouseDown:case Pt.MouseUp:a=a.replace("mouse","pointer");break;case Pt.TouchStart:case Pt.TouchEnd:return}u.push(dt(a,l,r))})),Wt((()=>{u.forEach((t=>t()))}))}(t),a=Kt(t),l=function(t,e){var{viewportResizeCb:i}=t,{win:r}=e,n=-1,s=-1;return dt("resize",Wt(pt(Wt((()=>{var t=wt(),e=_t();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n}),u=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Xt(t),i=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=ct.parentElement(e)),e&&n&&Qt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=T({element:e,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:i}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&r.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var i=t.value;f(t,d?{text:i,isChecked:!v,userTriggered:!1}:{text:i,isChecked:!v})}}))}}function f(t,r){var s=te.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){te.set(t,r);var o=n.getId(t);Wt(e)(i({},r,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>dt(t,Wt(v),r))),g=r.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((t=>gt(t[0],t[1],{set(){Wt(v)({target:this,isTrusted:!1})}},!1,g)))),Wt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:i,blockSelector:r,mirror:n,sampling:s,doc:o}=t,a=Wt((t=>pt(Wt((s=>{var o=Xt(s);if(o&&!Ct(o,i,r,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[dt("play",a(Bt.Play),o),dt("pause",a(Bt.Pause),o),dt("seeked",a(Bt.Seeked),o),dt("volumechange",a(Bt.VolumeChange),o),dt("ratechange",a(Bt.RateChange),o)];return Wt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:i,mirror:r,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Wt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=ie(e,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=ie(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=ie(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=ie(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};oe("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(oe("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),oe("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),oe("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Wt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=ie(e.parentStyleSheet,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:[...ee(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=ie(e.parentStyleSheet,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:[...ee(e),o]}]}),t.apply(e,s)}))})})),Wt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var[e,i]=t;i.prototype.insertRule=c[e].insertRule,i.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=re(t,t.doc),v=function(t,e){var{styleDeclarationCb:i,mirror:r,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Wt(((t,e,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=ie(null==(l=e.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&i({id:d,styleId:v,set:{property:u,value:h,priority:c},index:ee(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Wt(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=ie(null==(a=e.parentRule)?void 0:a.parentStyleSheet,r,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&i({id:h,styleId:c,remove:{property:u},index:ee(e.parentRule)}),t.apply(e,o)}))}),Wt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:i}=t,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=mt(i.fonts,"add",(function(t){return function(i){return setTimeout(Wt((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=o})),n.push(a),Wt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:i,blockClass:r,blockSelector:n,selectionCb:s}=t,o=!0,a=Wt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ct(c,r,n,!0)||Ct(v,r,n,!0)||a.push({start:i.getId(c),startOffset:d,end:i.getId(v),endOffset:f})}s({ranges:a})}}));return a(),dt("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:i}=t,r=e.defaultView;return r&&r.customElements?mt(r.customElements,"define",(function(t){return function(e,r,n){try{i({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,r,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Wt((()=>{Gt.forEach((t=>t.reset())),null==r||r.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function se(t){return void 0!==window[t]}function oe(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ae{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){var n=i||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:r.get(e)||-1}getRemoteIds(t,e){var i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}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||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class le{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ae(H)),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 ae(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 i,r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(i=t.contentWindow)||i.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.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 i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Ft.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),{timestamp:e.timestamp,type:Ft.IncrementalSnapshot,data:{source:Ot.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return e;case Ft.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ft.IncrementalSnapshot:switch(e.data.source){case Ot.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),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 Ot.Drag:case Ot.TouchMove:case Ot.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Ot.ViewportResize:return!1;case Ot.MediaInteraction:case Ot.MouseInteraction:case Ot.Scroll:case Ot.CanvasMutation:case Ot.Input:return this.replaceIds(e.data,t,["id"]),e;case Ot.StyleSheetRule:case Ot.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Ot.Font:return e;case Ot.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Ot.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}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 ue{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 r=Jt(i({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Kt(i({},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(ct.host(t))),this.restoreHandlers.push(re({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 i=this;this.restoreHandlers.push(mt(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=ct.shadowRoot(this);return s&&Mt(this)&&i.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce="undefined"==typeof Uint8Array?[]:new Uint8Array(256),de=0;64>de;de++)ce[he.charCodeAt(de)]=de;var ve=new Map,fe=(t,e,i)=>{if(t&&(me(t,e)||"object"==typeof t)){var r=function(t,e){var i=ve.get(t);return i||ve.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function pe(t,e,i){if(t instanceof Array)return t.map((t=>pe(t,e,i)));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,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=he[i[e]>>2],n+=he[(3&i[e])<<4|i[e+1]>>4],n+=he[(15&i[e+1])<<2|i[e+2]>>6],n+=he[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[pe(t.buffer,e,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var r=t.constructor.name,{src:n}=t;return{rr_type:r,src:n}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pe(t.data,e,i),t.width,t.height]}:me(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fe(t,e,i)}:t}var ge=(t,e,i)=>t.map((t=>pe(t,e,i))),me=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))};function ye(t,e,i,r){var n=[];try{var s=mt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ct(this,e,i,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function be(t,e,i,r,n,s){var o=[],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=mt(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=t.apply(this,l);if(fe(h,s,this),"tagName"in this.canvas&&!Ct(this.canvas,r,n,!0)){var c=ge(l,s,this);i(this.canvas,{type:e,property:a,args:c})}return h}}));o.push(l)}catch(r){var u=gt(t,a,{set(t){i(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var we,_e,Ie,Ce,Se="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ke="undefined"!=typeof window&&window.Blob&&new Blob([(we=Se,Uint8Array.from(atob(we),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function xe(t){var e;try{if(!(e=ke&&(window.URL||window.webkitURL).createObjectURL(ke)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;base64,"+Se,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Te{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:i,blockClass:r,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(i,r,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,i,r,n,{dataURLOptions:o})}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,i,r,n,s){var o=this,a=ye(i,r,n,!0),l=new Map,u=new xe;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:i,type:r,width:n,height:s}=t.data;this.mutationCb({id:e,type:Dt["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:r}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&c>t-d||(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{Ct(t,r,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(i.document),a).forEach(function(){var t=e((function*(t){var e,i=o.mirror.getId(t);if(!l.get(i)&&0!==t.width&&0!==t.height){if(l.set(i,!0),["webgl","webgl2"].includes(t.__context)){var r=t.getContext(t.__context);!1===(null==(e=null==r?void 0:r.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&r.clear(r.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:i,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=ye(t,e,i,!1),n=function(t,e,i,r){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=mt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ct(this.canvas,i,r,!0)||setTimeout((()=>{var i=ge(a,e,this);t(this.canvas,{type:Dt["2D"],property:s,args:i})}),0),n.apply(this,a)}}));n.push(o)}catch(i){var a=gt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:Dt["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i),s=function(t,e,i,r){var n=[];return n.push(...be(e.WebGLRenderingContext.prototype,Dt.WebGL,t,i,r,e)),void 0!==e.WebGL2RenderingContext&&n.push(...be(e.WebGL2RenderingContext.prototype,Dt.WebGL2,t,i,r,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i);this.resetObservers=()=>{r(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var n=i.map((t=>r(t,s))),{type:o}=i[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Ae{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 i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;i.styleMirror.has(t)?e=i.styleMirror.getId(t):(e=i.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:S(e,t.href),index:i})))})),r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ee{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).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 Re=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ne=document.createElement("iframe");document.body.appendChild(Ne),Array.from=(null==(n=Ne.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ne)}}catch(t){console.debug("Unable to override Array.from",t)}var Me,Fe,Oe=new x;function Pe(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:A=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Zt=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!==_&&void 0===b.mousemove&&(b.mousemove=_),Oe.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=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var j=0,q=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};_e=(t,i)=>{var s,o=t;if(o.timestamp=yt(),!(null==(s=Gt[0])?void 0:s.isFrozen())||o.type===Ft.FullSnapshot||o.type===Ft.IncrementalSnapshot&&o.data.source===Ot.Mutation||Gt.forEach((t=>t.unfreeze())),O)null==e||e(q(o),i);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(o.type===Ft.FullSnapshot)L=o,j=0;else if(o.type===Ft.IncrementalSnapshot){if(o.data.source===Ot.Mutation&&o.data.isAttachIframe)return;j++,(n&&j>=n||r&&o.timestamp-L.timestamp>r)&&Ie(!0)}};var Z=t=>{_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.Mutation},t)})},H=t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.Scroll},t)}),V=t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.CanvasMutation},t)}),z=new Ae({mutationCb:Z,adoptedStyleSheetCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.AdoptedStyleSheet},t)})}),Y=new le({mirror:Oe,mutationCb:Z,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:_e});for(var U of R||[])U.getMirror&&U.getMirror({nodeMirror:Oe,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});var W=new Ee;Ce=new Te({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Oe,sampling:b.canvas,dataURLOptions:w});var G=new ue({mutationCb:Z,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:Y,stylesheetManager:z,canvasManager:Ce,keepIframeSrcFn:N,processedNodeManager:W},mirror:Oe});Ie=function(t){if(void 0===t&&(t=!1),I){_e({type:Ft.Meta,data:{href:window.location.href,width:_t(),height:wt()}},t),z.reset(),G.init(),Gt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:i=new x,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return tt(t,{doc:t,mirror:i,blockClass:r,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Oe,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize(t){Tt(t,Oe)&&Y.addIframe(t),At(t,Oe)&&z.trackLinkElement(t),Et(t)&&G.addShadowRoot(ct.shadowRoot(t),document)},onIframeLoad(t,e){Y.attachIframe(t,e),G.observeAttachShadow(t)},onStylesheetLoad(t,e){z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");_e({type:Ft.FullSnapshot,data:{node:e,initialOffset:bt(window)}},t),Gt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))}};try{var X=[],J=t=>{var e;return Wt(ne)({mutationCb:Z,mousemoveCb:(t,e)=>_e({type:Ft.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.ViewportResize},t)}),inputCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.Input},t)}),mediaInteractionCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.MediaInteraction},t)}),styleSheetRuleCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.StyleSheetRule},t)}),styleDeclarationCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.Font},t)}),selectionCb(t){_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.Selection},t)})},customElementCb(t){_e({type:Ft.IncrementalSnapshot,data:i({source:Ot.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:A,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Oe,iframeManager:Y,stylesheetManager:z,shadowDomManager:G,processedNodeManager:W,canvasManager:Ce,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>_e({type:Ft.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};Y.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{Ie(),X.push(J(document)),Re=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(dt("DOMContentLoaded",(()=>{_e({type:Ft.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(dt("load",(()=>{_e({type:Ft.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Re=!1,Zt=void 0}}catch(t){console.warn(t)}}Pe.addCustomEvent=(t,e)=>{if(!Re)throw new Error("please add custom event after start recording");_e({type:Ft.Custom,data:{tag:t,payload:e}})},Pe.freezePage=()=>{Gt.forEach((t=>t.freeze()))},Pe.takeFullSnapshot=t=>{if(!Re)throw new Error("please take full snapshot after start recording");Ie(t)},Pe.mirror=Oe,(Fe=Me||(Me={}))[Fe.NotStarted=0]="NotStarted",Fe[Fe.Running=1]="Running",Fe[Fe.Stopped=2]="Stopped";var Le,De=Object.defineProperty,Be=(t,e,i)=>((t,e,i)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),je=Object.defineProperty,qe=(t,e,i)=>((t,e,i)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ze=Object.defineProperty,$e=(t,e,i)=>((t,e,i)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),He={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ve={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ze={};function Ye(t){if(ze[t])return ze[t];var e=globalThis[t],i=e.prototype,r=t in He?He[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in Ve?Ve[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ze[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?ze[t]=u:i}catch(t){return i}}var Ue={};function We(t,e,i){var r,n=t+"."+String(i);if(Ue[n])return Ue[n].call(e);var s=Ye(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(Ue[n]=o,o.call(e)):e[i]}var Ge={};function Xe(t,e,i){var r=t+"."+String(i);if(Ge[r])return Ge[r].bind(e);var n=Ye(t)[i];return"function"!=typeof n?e[i]:(Ge[r]=n,n.bind(e))}var Je={childNodes:t=>We("Node",t,"childNodes"),parentNode:t=>We("Node",t,"parentNode"),parentElement:t=>We("Node",t,"parentElement"),textContent:t=>We("Node",t,"textContent"),contains:(t,e)=>Xe("Node",t,"contains")(e),getRootNode:t=>Xe("Node",t,"getRootNode")(),host:t=>t&&"host"in t?We("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?We("Element",t,"shadowRoot"):null,querySelector:(t,e)=>We("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>We("Element",t,"querySelectorAll")(e),mutationObserver:()=>Ye("MutationObserver").constructor};function Ke(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Ke(Je.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Ke(Je.parentNode(t),e,i)}class Qe{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 Qe))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 ti={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ei={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ii={};function ri(t){if(ii[t])return ii[t];var e=globalThis[t],i=e.prototype,r=t in ti?ti[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in ei?ei[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ii[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?ii[t]=u:i}catch(t){return i}}var ni={};function si(t,e,i){var r,n=t+"."+String(i);if(ni[n])return ni[n].call(e);var s=ri(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(ni[n]=o,o.call(e)):e[i]}var oi={};function ai(t,e,i){var r=t+"."+String(i);if(oi[r])return oi[r].bind(e);var n=ri(t)[i];return"function"!=typeof n?e[i]:(oi[r]=n,n.bind(e))}var li={childNodes:t=>si("Node",t,"childNodes"),parentNode:t=>si("Node",t,"parentNode"),parentElement:t=>si("Node",t,"parentElement"),textContent:t=>si("Node",t,"textContent"),contains:(t,e)=>ai("Node",t,"contains")(e),getRootNode:t=>ai("Node",t,"getRootNode")(),host:t=>t&&"host"in t?si("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?si("Element",t,"shadowRoot"):null,querySelector:(t,e)=>si("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>si("Element",t,"querySelectorAll")(e),mutationObserver:()=>ri("MutationObserver").constructor},ui="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.",hi={map:{},getId(){return console.error(ui),-1},getNode(){return console.error(ui),null},removeNodeFromMap(){console.error(ui)},has(){return console.error(ui),!1},reset(){console.error(ui)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hi=new Proxy(hi,{get(t,e,i){return"map"===e&&console.error(ui),Reflect.get(t,e,i)}}));var ci,di=Date.now;function vi(t){return t?t.nodeType===t.ELEMENT_NODE?t:li.parentElement(t):null}function fi(t){var e,i=null;return"getRootNode"in t&&(null==(e=li.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&li.host(li.getRootNode(t))&&(i=li.host(li.getRootNode(t))),i}function pi(t){for(var e,i=t;e=fi(i);)i=e;return i}function gi(t){var e=t.ownerDocument;if(!e)return!1;var i=pi(t);return li.contains(e,i)}/[1-9][0-9]{12}/.test(Date.now().toString())||(di=()=>(new Date).getTime());for(var mi=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){qe(this,"id",1),qe(this,"styleIDMap",new WeakMap),qe(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):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}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 hi},closestElementOfNode:vi,getBaseDimension:function t(e,i){var r,n,s=null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.frameElement;if(!s||s===i)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,i),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function t(e,i){var r=e[i[0]];return 1===i.length?r:t(r.cssRules[i[1]].cssRules,i.slice(2))},getPositionsAndIndex(t){var e=[...t],i=e.pop();return{positions:e,index:i}},getRootShadowHost:pi,getShadowHost:fi,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=li.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=li.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:t=>!!t&&(t instanceof Qe&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(li.shadowRoot(t))),hookSetter:function t(e,i,r,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,i);return s.Object.defineProperty(e,i,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,i,o||{},!0)},inDom(t){var e=t.ownerDocument;return!!e&&(li.contains(e,t)||gi(t))},isAncestorRemoved:function t(e,i){if(n=(r=e)&&"host"in r&&"mode"in r&&Je.host(r)||null,Boolean(n&&"shadowRoot"in n&&Je.shadowRoot(n)===r))return!1;var r,n,s=i.getId(e);if(!i.has(s))return!0;var o=li.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,i))},isBlocked(t,e,i,r){if(!t)return!1;var n=vi(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(Ke(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1},isIgnored:(t,e,i)=>!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t),isSerialized:(t,e)=>-1!==e.getId(t),isSerializedIframe:(t,e)=>Boolean("IFRAME"===t.nodeName&&e.getMeta(t)),isSerializedStylesheet:(t,e)=>Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t)),iterateResolveTree:function t(e,i){i(e.value);for(var r=e.children.length-1;r>=0;r--)t(e.children[r],i)},legacy_isTouchEvent:t=>Boolean(t.changedTouches),get nowTimestamp(){return di},on(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)},patch(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}},polyfill(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(t){var e={},i=(t,i)=>{var r={value:t,parent:i,children:[]};return e[t.node.id]=r,r},r=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,i(n,a.parent))}else{var u=r.indexOf(a);r.splice(u,0,i(n,null))}}else if(o in e){var h=e[o];h.children.push(i(n,h))}else r.push(i(n,null))}return r},shadowHostInDom:gi,throttle(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}},uniqueTextMutations(t){for(var e=new Set,i=[],r=t.length;r--;){var n=t[r];e.has(n.id)||(i.push(n),e.add(n.id))}return i}},Symbol.toStringTag,{value:"Module"}))),yi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),bi=0;64>bi;bi++)yi["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(bi)]=bi;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var wi=document.createElement("iframe");document.body.appendChild(wi),Array.from=(null==(Le=wi.contentWindow)?void 0:Le.Array.from)||Array.from,document.body.removeChild(wi)}}catch(t){console.debug("Unable to override Array.from",t)}new class{constructor(){$e(this,"idNodeMap",new Map),$e(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-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){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(ci||(ci={}));class _i{constructor(t){Be(this,"fileName"),Be(this,"functionName"),Be(this,"lineNumber"),Be(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 Ii=/(^|@)\S+:\d+/,Ci=/^\s*at .*(\S+:\d+|\(native\))/m,Si=/^(eval@)?(\[native code])?$/,ki={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ci)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ci)}),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,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _i({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Si)}),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 _i({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new _i({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new _i({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new _i({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ii)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new _i({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function xi(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Ti(t){return"[object Object]"==={}.toString.call(t)}function Ai(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Ti(t[r])&&Ai(t[r],e-1))return!0;return!1}function Ei(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Ti(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||Ti(o)&&Ai(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Array.isArray(u)?xi(u.length?u[0]:null):u}return a}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 Ri={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 Ni(t,e,i){var r,n=i?Object.assign({},Ri,i):Ri,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=ki.parse(e.error).map((t=>t.toString())),s=[Ei(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Ei("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Ei("Uncaught (in promise)",n.stringifyOptions),Ei(e.reason,n.stringifyOptions)]);var s=ki.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(r,c));return()=>{l.forEach((t=>t()))};function d(e,i){var r=this;return e[i]?mi.patch(e,i,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=ki.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===i?l.slice(1):l).map((t=>Ei(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Ei("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Mi=t=>({name:"rrweb/console@1",observer:Ni,options:t});function Fi(){return(Fi=e((function*(t,e){void 0===e&&(e=!0);try{var i=new Blob([t],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(i).blob()}catch(t){return e&&console.error("Failed to gzip compress data",t),null}}))).apply(this,arguments)}var Oi=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Pi=["$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 Li(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var Di=["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"],Bi=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Di.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function ji(t,e){return-1!==t.indexOf(e)}var qi=function(t){return t.trim()},Zi=function(t){return t.replace(/^\$/,"")},$i=Object.prototype,Hi=$i.hasOwnProperty,Vi=$i.toString,zi=Array.isArray||function(t){return"[object Array]"===Vi.call(t)},Yi=t=>"function"==typeof t,Ui=t=>t===Object(t)&&!zi(t),Wi=t=>{if(Ui(t)){for(var e in t)if(Hi.call(t,e))return!1;return!0}return!1},Gi=t=>void 0===t,Xi=t=>"[object String]"==Vi.call(t),Ji=t=>Xi(t)&&0===t.trim().length,Ki=t=>null===t,Qi=t=>Gi(t)||Ki(t),tr=t=>"[object Number]"==Vi.call(t)&&t==t,er=t=>tr(t)&&t>0,ir=t=>"[object Boolean]"===Vi.call(t),rr=t=>t instanceof FormData;function nr(t){return null===t||"object"!=typeof t}function sr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function or(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var ar=[!0,"true",1,"1","yes"],lr=t=>ji(ar,t),ur=[!1,"false",0,"0","no"];function hr(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),tr(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),hr(n||i,e,i,r))}class cr{constructor(t){this.Pt={},this.Dt=t.Dt,this.jt=hr(t.bucketSize,0,100,t.qt),this.$t=hr(t.refillRate,0,this.jt,t.qt),this.Ht=hr(t.refillInterval,0,864e5,t.qt)}Vt(t,e){var i=Math.floor((e-t.lastAccess)/this.Ht);i>0&&(t.tokens=Math.min(t.tokens+i*this.$t,this.jt),t.lastAccess=t.lastAccess+i*this.Ht)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.Pt[r];return n?this.Vt(n,i):this.Pt[r]=n={tokens:this.jt,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.Dt)||e.call(this,t)),0===n.tokens)}stop(){this.Pt={}}}var dr,vr,fr,pr="Mobile",gr="iOS",mr="Android",yr="Tablet",br=mr+" "+yr,wr="iPad",_r="Apple",Ir=_r+" Watch",Cr="Safari",Sr="BlackBerry",kr="Samsung",xr=kr+"Browser",Tr=kr+" Internet",Ar="Chrome",Er=Ar+" OS",Rr=Ar+" "+gr,Nr="Internet Explorer",Mr=Nr+" "+pr,Fr="Opera",Or=Fr+" Mini",Pr="Edge",Lr="Microsoft "+Pr,Dr="Firefox",Br=Dr+" "+gr,jr="Nintendo",qr="PlayStation",Zr="Xbox",$r=mr+" "+pr,Hr=pr+" "+Cr,Vr="Windows",zr=Vr+" Phone",Yr="Nokia",Ur="Ouya",Wr="Generic",Gr=Wr+" "+pr.toLowerCase(),Xr=Wr+" "+yr.toLowerCase(),Jr="Konqueror",Kr="(\\d+(\\.\\d+)?)",Qr=new RegExp("Version/"+Kr),tn=new RegExp(Zr,"i"),en=new RegExp(qr+" \\w+","i"),rn=new RegExp(jr+" \\w+","i"),nn=new RegExp(Sr+"|PlayBook|BB10","i"),sn={"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"},on=function(t,e){return e=e||"",ji(t," OPR/")&&ji(t,"Mini")?Or:ji(t," OPR/")?Fr:nn.test(t)?Sr:ji(t,"IE"+pr)||ji(t,"WPDesktop")?Mr:ji(t,xr)?Tr:ji(t,Pr)||ji(t,"Edg/")?Lr:ji(t,"FBIOS")?"Facebook "+pr:ji(t,"UCWEB")||ji(t,"UCBrowser")?"UC Browser":ji(t,"CriOS")?Rr:ji(t,"CrMo")||ji(t,Ar)?Ar:ji(t,mr)&&ji(t,Cr)?$r:ji(t,"FxiOS")?Br:ji(t.toLowerCase(),Jr.toLowerCase())?Jr:((t,e)=>e&&ji(e,_r)||function(t){return ji(t,Cr)&&!ji(t,Ar)&&!ji(t,mr)}(t))(t,e)?ji(t,pr)?Hr:Cr:ji(t,Dr)?Dr:ji(t,"MSIE")||ji(t,"Trident/")?Nr:ji(t,"Gecko")?Dr:""},an={[Mr]:[new RegExp("rv:"+Kr)],[Lr]:[new RegExp(Pr+"?\\/"+Kr)],[Ar]:[new RegExp("("+Ar+"|CrMo)\\/"+Kr)],[Rr]:[new RegExp("CriOS\\/"+Kr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Kr)],[Cr]:[Qr],[Hr]:[Qr],[Fr]:[new RegExp("(Opera|OPR)\\/"+Kr)],[Dr]:[new RegExp(Dr+"\\/"+Kr)],[Br]:[new RegExp("FxiOS\\/"+Kr)],[Jr]:[new RegExp("Konqueror[:/]?"+Kr,"i")],[Sr]:[new RegExp(Sr+" "+Kr),Qr],[$r]:[new RegExp("android\\s"+Kr,"i")],[Tr]:[new RegExp(xr+"\\/"+Kr)],[Nr]:[new RegExp("(rv:|MSIE )"+Kr)],Mozilla:[new RegExp("rv:"+Kr)]},ln=function(t,e){var i=on(t,e),r=an[i];if(Gi(r))return null;for(var n=0;r.length>n;n++){var s=t.match(r[n]);if(s)return parseFloat(s[s.length-2])}return null},un=[[new RegExp(Zr+"; "+Zr+" (.*?)[);]","i"),t=>[Zr,t&&t[1]||""]],[new RegExp(jr,"i"),[jr,""]],[new RegExp(qr,"i"),[qr,""]],[nn,[Sr,""]],[new RegExp(Vr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zr,""];if(new RegExp(pr).test(e)&&!/IEMobile\b/.test(e))return[Vr+" "+pr,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=sn[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Vr,r]}return[Vr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gr,[t[3],t[4],t[5]||"0"].join(".")]:[gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Gi(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mr+")","i"),t=>t&&t[2]?[mr,[t[2],t[3],t[4]||"0"].join(".")]:[mr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Er,""]],[/Linux|debian/i,["Linux",""]]],hn=function(t){return rn.test(t)?jr:en.test(t)?qr:tn.test(t)?Zr:new RegExp(Ur,"i").test(t)?Ur:new RegExp("("+zr+"|WPDesktop)","i").test(t)?zr:/iPad/.test(t)?wr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ir:nn.test(t)?Sr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Yr,"i").test(t)?Yr:/(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(pr).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)?mr:br:new RegExp("(pda|"+pr+")","i").test(t)?Gr:new RegExp(yr,"i").test(t)&&!new RegExp(yr+" pc","i").test(t)?Xr:""},cn=function(t,e){var i,r,n,s,o=hn(t);return o===wr||o===br||"Kobo"===o||"Kindle Fire"===o||o===Xr?yr:o===jr||o===Zr||o===qr||o===Ur?"Console":o===Ir?"Wearable":o?pr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pr:yr:"Desktop"};function dn(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return fr&&i.length===vr||(vr=i.length,fr=i.reduce(((i,r)=>{dr||(dr={});var n=dr[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,dr[r]=[l,u];break}}return i}),{})),fr}}class vn{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var i=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&zi(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.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 r,n;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),i({},t,{cause:r,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var i=this;return e((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,e){var r,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,i({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var n=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return i({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,r),next:t=>n(t,r+1)})}}var fn="?";function pn(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?fn:i,in_app:!0};return Gi(r)||(s.lineno=r),Gi(n)||(s.colno=n),s}var gn=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:fn,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},mn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bn=/\((\S*)(?::(\d+))(?::(\d+))\)/,wn=(t,e)=>{var i=mn.exec(t);if(i){var[,r,n,s]=i;return pn(e,r,fn,+n,+s)}var o=yn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=bn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=gn(o[1]||fn,o[2]);return pn(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},_n=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cn=(t,e)=>{var i=_n.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=In.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||fn;return[s,n]=gn(s,n),pn(e,n,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Sn=/\(error: (.*)\)/,kn=50;class xn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Xi(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?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 sr(t,"DOMException")}isDOMError(t){return sr(t,"DOMError")}}class Tn{match(t){return t instanceof Error}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 i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class An{constructor(){}match(t){return sr(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var i;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}var En=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Rn{match(t){return"string"==typeof t}coerce(t,e){var i,[r,n]=this.getInfos(t);return{type:null!=r?r:"Error",value:null!=n?n:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(En);return r&&(e=r[1],i=r[2]),[e,i]}}var Nn=["fatal","error","warning","log","info","debug"];function Mn(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Fn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return or(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 i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Mn(t)}isSeverityLevel(t){return Xi(t)&&!Ji(t)&&Nn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(i instanceof Error)return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class On{match(t){return or(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Mn(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Pn{match(t){return nr(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ln{match(t){return sr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!or(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return nr(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Dn="undefined"!=typeof window?window:void 0,Bn="undefined"!=typeof globalThis?globalThis:Dn;"undefined"==typeof self&&(Bn.self=Bn),"undefined"==typeof File&&(Bn.File=function(){});var jn=null==Bn?void 0:Bn.navigator,qn=null==Bn?void 0:Bn.document,Zn=null==Bn?void 0:Bn.location,$n=null==Bn?void 0:Bn.fetch,Hn=null!=Bn&&Bn.XMLHttpRequest&&"withCredentials"in new Bn.XMLHttpRequest?Bn.XMLHttpRequest:void 0,Vn=null==Bn?void 0:Bn.AbortController,zn=null==Bn?void 0:Bn.CompressionStream,Yn=null==jn?void 0:jn.userAgent,Un=null!=Dn?Dn:{},Wn=t=>t instanceof Document,Gn="1.366.1",Xn={DEBUG:!1,LIB_VERSION:Gn,LIB_NAME:"web",JS_SDK_VERSION:Gn},Jn=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,r={C(e){if(Dn&&(Xn.DEBUG||Un.POSTHOG_DEBUG||i)&&!Gi(Dn.console)&&Dn.console){for(var r=("__rrweb_original__"in Dn.console[e]?Dn.console[e].__rrweb_original__:Dn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];r(t,...s)}},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.C("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>Jn(t+" "+e,i)};return r},Kn=Jn("[PostHog.js]"),Qn=Kn.createLogger;function ts(t,e){zi(t)&&t.forEach(e)}function es(t,e){if(!Qi(t))if(zi(t))t.forEach(e);else if(rr(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)Hi.call(t,i)&&e(t[i],i)}var is=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function rs(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var ns=function(t){try{return t()}catch(t){return}},ss=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){Kn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Kn.critical(t)}}},os=function(t){var e={};return es(t,(function(t,i){(Xi(t)&&t.length>0||tr(t))&&(e[i]=t)})),e};var as=["herokuapp.com","vercel.app","netlify.app"];function ls(t){var e=null==t?void 0:t.hostname;if(!Xi(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of as)if(i===r)return!1;return!0}function us(t,e,i,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:n,passive:s})}function hs(t){return"ph_toolbar_internal"===t.name}var cs=t=>{var e=null==qn?void 0:qn.createElement("a");return Gi(e)?null:(e.href=t,e)},ds=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return es(t,(function(t,e){Gi(t)||Gi(e)||"undefined"===e||(i=encodeURIComponent(t instanceof File?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},vs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!zi(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){Kn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},fs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");zi(c)&&(e.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=n&&(d+="#"+n),d},ps=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null};function gs(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return Yi(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}function ms(t,e){var i,r=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:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var ys="$people_distinct_id",bs="$device_id",ws="__alias",_s="__timers",Is="$autocapture_disabled_server_side",Cs="$heatmaps_enabled_server_side",Ss="$exception_capture_enabled_server_side",ks="$error_tracking_suppression_rules",xs="$error_tracking_capture_extension_exceptions",Ts="$web_vitals_enabled_server_side",As="$dead_clicks_enabled_server_side",Es="$product_tours_enabled_server_side",Rs="$web_vitals_allowed_metrics",Ns="$session_recording_remote_config",Ms="$sesid",Fs="$session_is_sampled",Os="$enabled_feature_flags",Ps="$early_access_features",Ls="$feature_flag_details",Ds="$stored_person_properties",Bs="$stored_group_properties",js="$surveys",qs="$flag_call_reported",Zs="$flag_call_reported_session_id",$s="$feature_flag_errors",Hs="$feature_flag_evaluated_at",Vs="$user_state",zs="$client_session_props",Ys="$capture_rate_limit",Us="$initial_campaign_params",Ws="$initial_referrer_info",Gs="$initial_person_info",Xs="$epp",Js="__POSTHOG_TOOLBAR__",Ks="$posthog_cookieless",Qs=[ys,ws,"__cmpns",_s,"$session_recording_enabled_server_side",Cs,Ms,Os,ks,Vs,Ps,Ls,Bs,Ds,js,qs,Zs,$s,Hs,zs,Ys,Us,Ws,Xs,Gs],to="PostHog loadExternalDependency extension not found.",eo="on_reject",io="always",ro="anonymous",no="identified",so="identified_only",oo="visibilitychange",ao="beforeunload",lo="$pageview",uo="$pageleave",ho="$identify",co="$groupidentify";function vo(t){return t instanceof Element&&(t.id===Js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function fo(t){return!!t&&1===t.nodeType}function po(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function go(t){return!!t&&3===t.nodeType}function mo(t){return!!t&&11===t.nodeType}function yo(t){return t?qi(t).split(/\s+/):[]}function bo(t){var e=null==Dn?void 0:Dn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function wo(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 yo(e)}function _o(t){return Qi(t)?null:qi(t).split(/(\s+)/).filter((t=>jo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(t){var e="";return No(t)&&!Mo(t)&&t.childNodes&&t.childNodes.length&&es(t.childNodes,(function(t){var i;go(t)&&t.textContent&&(e+=null!==(i=_o(t.textContent))&&void 0!==i?i:"")})),qi(e)}function Co(t){return Gi(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var So=["a","button","form","input","select","textarea","label"];function ko(t,e){if(Gi(e))return!0;var i,r=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function xo(t){var e=t.parentNode;return!(!e||!fo(e))&&e}var To=["next","previous","prev",">","<"],Ao=[".ph-no-rageclick",".ph-no-capture"];var Eo=t=>!t||po(t,"html")||!fo(t),Ro=(t,e)=>{if(!Dn||Eo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=xo(n);if(!s)break;if(e||So.indexOf(s.tagName.toLowerCase())>-1)i=!0;else{var o=Dn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function No(t){for(var e=t;e.parentNode&&!po(e,"body");e=e.parentNode){var i=wo(e);if(ji(i,"ph-sensitive")||ji(i,"ph-no-capture"))return!1}if(ji(wo(t),"ph-include"))return!0;var r=t.type||"";if(Xi(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!Xi(n)||!/^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,""))}function Mo(t){return!!(po(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||po(t,"select")||po(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fo="(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})",Oo=new RegExp("^(?:"+Fo+")$"),Po=new RegExp(Fo),Lo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Lo+")$"),Bo=new RegExp("("+Lo+")");function jo(t,e){if(void 0===e&&(e=!0),Qi(t))return!1;if(Xi(t)){if(t=qi(t),(e?Oo:Po).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Do:Bo).test(t))return!1}return!0}function qo(t){var e=Io(t);return jo(e=(e+" "+Zo(t)).trim())?e:""}function Zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&es(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Io(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Zo(t)).trim())}catch(t){Kn.error("[AutoCapture]",t)}})),e}function $o(t){return t.replace(/"|\\"/g,'\\"')}function Ho(t){var e=t.attr__class;return e?zi(e)?e:yo(e):void 0}var Vo={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"]},zo=Qn("[Recorder]"),Yo=t=>"navigation"===t.entryType,Uo=t=>"resource"===t.entryType;function Wo(t,e){return!!e&&(ir(e)||e[t])}function Go(t){var{type:e,recordBody:i,headers:r,url:n}=t;function s(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.includes(t)))}if(!i)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(ir(i))return!0;if(zi(i))return s(i);var o=i[e];return ir(o)?o:s(o)}function Xo(t,e,i,r,n,s){return Jo.apply(this,arguments)}function Jo(){return Jo=e((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return zo.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var o=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(Uo(o=t[s])&&o.initiatorType===e&&(Gi(r)||o.startTime>=r)&&(Gi(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(i));return o||(yield new Promise((t=>setTimeout(t,50*s))),Xo(t,e,i,r,n,s+1))})),Jo.apply(this,arguments)}function Ko(t){var{body:e,options:i,url:r}=t;if(Qi(e))return null;var{hostname:n,isHostDenied:s}=ms(r,i);if(s)return n+" is in deny list";if(Xi(e))return e;if(Wn(e))return e.textContent;if(rr(e))return ds(e);if(Ui(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 Qo=t=>!Ki(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ta(t){var{entry:e,method:r,status:n,networkRequest:s,isInitial:o,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=[i({},e?e.toJSON():{name:u},{startTime:Gi(a)?void 0:Math.round(a),endTime:Gi(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Qo(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 ea=["video/","audio/"];function ia(t){return new Promise((e=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function ra(){return ra=e((function*(t){var{r:e,options:i,url:r}=t,{hostname:n,isHostDenied:s}=ms(r,i);return s?Promise.resolve(n+" is in deny list"):ia(e)})),ra.apply(this,arguments)}function na(){return na=e((function*(t){var{r:e,options:i,url:r}=t,n=function(t){var e,{r:i,options:r,url:n}=t;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ea.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=ms(n,r);return l?a+" is in deny list":null}({r:e,options:i,url:r});return Ki(n)?ia(e):Promise.resolve(n)})),na.apply(this,arguments)}var sa=null;function oa(t,r,n){if(!("performance"in r))return()=>{};if(sa)return zo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Vo,n):Vo,o=e=>{var r=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(i({},e,{requests:r}))},a=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>Yo(t)||Uo(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>ta({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>Yo(t)||Uo(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>ta({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,r,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Wo("request",i.recordHeaders),n=Wo("response",i.recordHeaders),s=gs(e.XMLHttpRequest.prototype,"open",(s=>function(o,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)),r&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Go({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=Ko({body:t,options:i,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var r={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),Go({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=Ko({body:v.response,options:i,url:a})),Xo(e,"xmlhttprequest",f.url,c,d).then((e=>{var i=ta({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,r,s),u=function(t,i,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=Wo("request",r.recordHeaders),s=Wo("response",r.recordHeaders),o=gs(i,"fetch",(o=>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),Go({type:"request",headers:v,url:e,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return ra.apply(this,arguments)}({r:c,options:r,url:e})),u=i.performance.now(),l=yield o(c),h=i.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),Go({type:"response",headers:f,url:e,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return na.apply(this,arguments)}({r:l,options:r,url:e})),l}finally{Xo(i,"fetch",c.url,u,h).then((e=>{var i,r=ta({entry:e,method:c.method,status:null==(i=l)?void 0:i.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,r,s)),sa=()=>{a(),l(),u(),sa=null}}var aa=t=>({name:"rrweb/network@1",observer:oa,options:t});Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Mi,getRecordNetworkPlugin:aa},Un.__PosthogExtensions__.rrweb={record:Pe,version:"v2"},Un.rrweb={record:Pe,version:"v2"},Un.rrwebConsoleRecord={getRecordConsolePlugin:Mi},Un.getRecordNetworkPlugin=aa;var la,ua,ha,ca,da,va,fa,pa,ga,ma,ya,ba,wa={},_a=[],Ia=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ca=Array.isArray;function Sa(t,e){for(var i in e)t[i]=e[i];return t}function ka(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xa(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?la.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Ta(t,o,r,n,null)}function Ta(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ha:n,__i:-1,__u:0};return null==n&&null!=ua.vnode&&ua.vnode(s),s}function Aa(t){return t.children}function Ea(t,e){this.props=t,this.context=e}function Ra(t,e){if(null==e)return t.__?Ra(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Ra(t):null}function Na(t){var e,i;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e){t.__e=t.__c.base=i.__e;break}return Na(t)}}function Ma(t){(!t.__d&&(t.__d=!0)&&ca.push(t)&&!$.__r++||da!=ua.debounceRendering)&&((da=ua.debounceRendering)||va)($)}function $(){for(var t,e,i,r,n,s,o,a=1;ca.length;)ca.length>a&&ca.sort(fa),t=ca.shift(),a=ca.length,t.__d&&(i=void 0,r=void 0,n=(r=(e=t).__v).__e,s=[],o=[],e.__P&&((i=Sa({},r)).__v=r.__v+1,ua.vnode&&ua.vnode(i),ja(e.__P,i,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,s,null==n?Ra(r):n,!!(32&r.__u),o),i.__v=r.__v,i.__.__k[i.__i]=i,Za(s,i,o),r.__e=r.__=null,i.__e!=n&&Na(i)));$.__r=0}function Fa(t,e,i,r,n,s,o,a,l,u,h){var c,d,v,f,p,g,m,y=r&&r.__k||_a,b=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,c=h,d=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Ta(null,o,null,null,null):Ca(o)?o=t.__k[s]=Ta(Aa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Ta(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=Pa(o,i,l,c))&&(c--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?d--:u==l+1?d++:(u>l?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=i[s])&&0==(2&a.__u)&&(a.__e==r&&(r=Ra(a)),Va(a,a));return r}(i,e,y,l,b),c=0;b>c;c++)null!=(v=i.__k[c])&&(d=-1==v.__i?wa:y[v.__i]||wa,v.__i=c,g=ja(t,v,d,n,s,o,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),(m=!!(4&v.__u))||d.__k===v.__k?l=Oa(v,l,t,m):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return i.__e=p,l}function Oa(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Oa(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Ra(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Pa(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Ia.test(e)?i:i+"px"}function Da(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||La(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||La(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(pa,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i.u=r.u:(i.u=ga,t.addEventListener(e,s?ya:ma,s)):t.removeEventListener(e,s?ya:ma,s);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function Ba(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e.t)e.t=ga++;else if(i.u>e.t)return;return i(ua.event?ua.event(e):e)}}}function ja(t,e,i,r,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,k,x=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=ua.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&r[h.__c],w=h?b?b.props.value:h.__:r,i.__c?g=(c=e.__c=i.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new Ea(m,w),c.constructor=x,c.render=za),b&&b.sub(c),c.state||(c.state={}),c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Sa({},c.__s)),Sa(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==i.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(e.__v!=i.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),$=0;c._sb.length>$;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ua.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),C=0;c._sb.length>C;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&&25>++I);c.state=c.__s,null!=c.getChildContext&&(r=Sa(Sa({},r),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Aa&&null==h.key&&(S=$a(h.props.children)),a=Fa(t,Ca(S)?S:[S],e,i,r,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(k=s.length;k--;)ka(s[k]);qa(e)}else e.__e=i.__e,e.__k=i.__k,t.then||qa(e);ua.__e(t,e,i)}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,c,d,v,f,p,g=i.props||wa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ua.__m&&ua.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&la.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)if(v=g[u],"children"==u);else if("dangerouslySetInnerHTML"==u)c=v;else if(!(u in m)){if("value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m)continue;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: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("template"==e.type?t.content:t,Ca(d)?d:[d],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&Ra(i,0),a,l),null!=s)for(u=s.length;u--;)ka(s[u]);a||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Da(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Da(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=ua.diffed)&&h(e),128&e.__u?void 0:a}function qa(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(qa)}function Za(t,e,i){for(var r=0;i.length>r;r++)Ha(i[r],i[++r],i[++r]);ua.__c&&ua.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ua.__e(t,e.__v)}}))}function $a(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ca(t)?t.map($a):Sa({},t)}function Ha(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ua.__e(t,i)}}function Va(t,e,i){var r,n;if(ua.unmount&&ua.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Ha(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){ua.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Va(r[n],e,i||"function"!=typeof t.type);i||ka(t.__e),t.__c=t.__=t.__e=void 0}function za(t,e,i){return this.constructor(t,i)}function Ya(t,e,i){var r,n,s;e==document&&(e=document.documentElement),ua.__&&ua.__(t,e),r=e.__k,n=[],s=[],ja(e,t=e.__k=xa(Aa,null,[t]),r||wa,wa,e.namespaceURI,r?null:e.firstChild?la.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),Za(n,t,s)}la=_a.slice,ua={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ha=0,Ea.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Sa({},this.state),"function"==typeof t&&(t=t(Sa({},i),this.props)),t&&Sa(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ma(this))},Ea.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ma(this))},Ea.prototype.render=Aa,ca=[],va="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,pa=/(PointerCapture)$|Capture$/i,ga=0,ma=Ba(!1),ya=Ba(!0),ba=0;var Ua,Wa,Ga,Xa,Ja=0,Ka=[],Qa=ua,tl=Qa.__b,el=Qa.__r,il=Qa.diffed,rl=Qa.__c,nl=Qa.unmount,sl=Qa.__;function ol(t,e){Qa.__h&&Qa.__h(Wa,t,Ja||e),Ja=0;var i=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function al(t){return Ja=1,function(t,e,i){var r=ol(Ua++,2);if(r.t=t,!r.__c&&(r.__=[yl(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Wa,!Wa.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=r.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,i);var o=r.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,i)||o};Wa.__f=!0;var s=Wa.shouldComponentUpdate,o=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}o&&o.call(this,t,e,i)},Wa.shouldComponentUpdate=n}return r.__N||r.__}(yl,t)}function ll(t,e){var i=ol(Ua++,3);!Qa.__s&&ml(i.__H,e)&&(i.__=t,i.u=e,Wa.__H.__h.push(i))}function ul(t){return Ja=5,hl((function(){return{current:t}}),[])}function hl(t,e){var i=ol(Ua++,7);return ml(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function cl(t){var e=Wa.context[t.__c],i=ol(Ua++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Wa)),e.props.value):t.__}function dl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(pl),t.__H.__h.forEach(gl),t.__H.__h=[]}catch(e){t.__H.__h=[],Qa.__e(e,t.__v)}}Qa.__b=function(t){Wa=null,tl&&tl(t)},Qa.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),sl&&sl(t,e)},Qa.__r=function(t){el&&el(t),Ua=0;var e=(Wa=t.__c).__H;e&&(Ga===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(pl),e.__h.forEach(gl),e.__h=[],Ua=0)),Ga=Wa},Qa.diffed=function(t){il&&il(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===Qa.requestAnimationFrame||((Xa=Qa.requestAnimationFrame)||fl)(dl)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),Ga=Wa=null},Qa.__c=function(t,e){e.some((function(t){try{t.__h.forEach(pl),t.__h=t.__h.filter((function(t){return!t.__||gl(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Qa.__e(i,t.__v)}})),rl&&rl(t,e)},Qa.unmount=function(t){nl&&nl(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{pl(t)}catch(t){e=t}})),i.__H=void 0,e&&Qa.__e(e,i.__v))};var vl="function"==typeof requestAnimationFrame;function fl(t){var e,i=function(){clearTimeout(r),vl&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);vl&&(e=requestAnimationFrame(i))}function pl(t){var e=Wa,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Wa=e}function gl(t){var e=Wa;t.__c=t.__(),Wa=e}function ml(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function yl(t,e){return"function"==typeof e?e(t):e}var bl="events",wl="cancelEvents",_l={Tab:"tab",Selector:"selector"},Il={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Cl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Sl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},xl={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Tl="always",Al={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},El={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Rl="popover",Nl=Qn("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Fl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ol(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Pl="seenSurvey_",Ll="inProgressSurvey_",Dl=(t,e)=>{var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i},Bl=(t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i},jl=t=>Bl(Pl,t),ql=t=>{localStorage.getItem(jl(t))||localStorage.setItem(jl(t),"true")},Zl=[Sl.Popover,Sl.Widget,Sl.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Rl};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return tr(t)&&isFinite(t)&&Math.floor(t)===t});class Hl{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>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|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Hl(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),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;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Vl{constructor(){this.I=0,this.S=0,this.k=new Ul}generate(){var t=this.generateOrAbort();if(Gi(t)){this.I=0;var e=this.generateOrAbort();if(Gi(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Hl.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var zl,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;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Dn&&!Gi(Dn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Ul{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(Yl(this.T),this.N=0),this.T[this.N++]}}var Wl=()=>Gl().toString(),Gl=()=>(zl||(zl=new Vl)).generate(),Xl="gzip-js",Jl="base64",Kl=Uint8Array,Ql=Uint16Array,tu=Uint32Array,eu=new Kl([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]),iu=new Kl([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 Kl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nu=function(t,e){for(var i=new Ql(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new tu(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},su=nu(eu,2),ou=su[1];su[0][28]=258,ou[258]=28;for(var au=nu(iu,0)[1],lu=new Ql(32768),uu=0;32768>uu;++uu){var hu=(43690&uu)>>>1|(21845&uu)<<1;lu[uu]=((65280&(hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4))>>>8|(255&hu)<<8)>>>1}var cu=function(t,e,i){for(var r=t.length,n=0,s=new Ql(e);r>n;++n)++s[t[n]-1];var o,a=new Ql(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Ql(1<<e);var l=15-e;for(n=0;r>n;++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;d>=c;++c)o[lu[c]>>>l]=u}else for(o=new Ql(r),n=0;r>n;++n)o[n]=lu[a[t[n]-1]++]>>>15-t[n];return o},du=new Kl(288);for(uu=0;144>uu;++uu)du[uu]=8;for(uu=144;256>uu;++uu)du[uu]=9;for(uu=256;280>uu;++uu)du[uu]=7;for(uu=280;288>uu;++uu)du[uu]=8;var vu=new Kl(32);for(uu=0;32>uu;++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,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Ql?Ql:t instanceof tu?tu:Kl)(i-e);return r.set(t.subarray(e,i)),r},yu=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},bu=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},wu=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Kl(0),0];if(1==n){var o=new Kl(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(r=1;n>r;++r)s[r].s>d&&(d=s[r].s);var v=new Ql(d+1),f=_u(i[h-1],v,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>v[b]?p-=1<<e-v[b]++-1:++r}for(;r>=0&&p;--r){var w=s[r].s;v[w]==e&&(--v[w],++p)}f=e}return[new Kl(v),f]},_u=function(t,e,i){return-1==t.s?Math.max(_u(t.l,e,i+1),_u(t.r,e,i+1)):e[t.s]=i},Iu=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Ql(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Cu=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Su=function(t,e,i){var r=i.length,n=gu(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},ku=function(t,e,i,r,n,s,o,a,l,u,h){yu(e,h++,i),++n[256];for(var c=wu(n,15),d=c[0],v=c[1],f=wu(s,15),p=f[0],g=f[1],m=Iu(d),y=m[0],b=m[1],w=Iu(p),_=w[0],I=w[1],C=new Ql(19),S=0;y.length>S;++S)C[31&y[S]]++;for(S=0;_.length>S;++S)C[31&_[S]]++;for(var k=wu(C,7),x=k[0],T=k[1],A=19;A>4&&!x[ru[A-1]];--A);var E,R,N,M,F=u+5<<3,O=Cu(n,du)+Cu(s,vu)+o,P=Cu(n,d)+Cu(s,p)+o+14+3*A+Cu(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(O>=F&&P>=F)return Su(e,h,t.subarray(l,l+u));if(yu(e,h,1+(O>P)),h+=2,O>P){E=cu(d,v,0),R=d,N=cu(p,g,0),M=p;var L=cu(x,T,0);for(yu(e,h,b-257),yu(e,h+5,I-1),yu(e,h+10,A-4),h+=14,S=0;A>S;++S)yu(e,h+3*S,x[ru[S]]);h+=3*A;for(var D=[y,_],B=0;2>B;++B){var j=D[B];for(S=0;j.length>S;++S)yu(e,h,L[q=31&j[S]]),h+=x[q],q>15&&(yu(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=fu,R=du,N=pu,M=vu;for(S=0;a>S;++S)if(r[S]>255){var q;bu(e,h,E[257+(q=r[S]>>>18&31)]),h+=R[q+257],q>7&&(yu(e,h,r[S]>>>23&31),h+=eu[q]);var Z=31&r[S];bu(e,h,N[Z]),h+=M[Z],Z>3&&(bu(e,h,r[S]>>>5&8191),h+=iu[Z])}else bu(e,h,E[r[S]]),h+=R[r[S]];return bu(e,h,E[256]),h+R[256]},xu=new tu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tu=function(){for(var t=new tu(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Au=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Eu(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Tu[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new Kl(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?u=Su(l,u,t.subarray(h,c)):(l[h]=!0,u=Su(l,u,t.subarray(h,o)))}else{for(var d=xu[e-1],v=d>>>13,f=8191&d,p=(1<<i)-1,g=new Ql(32768),m=new Ql(p+1),y=Math.ceil(i/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new tu(25e3),I=new Ql(288),C=new Ql(32),S=0,k=0,x=(h=0,0),T=0,A=0;o>h;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,h>=T){var M=o-h;if((S>7e3||x>24576)&&M>423){u=ku(t,l,0,_,I,C,k,x,A,h-A,u),x=S=k=0,A=h;for(var F=0;286>F;++F)I[F]=0;for(F=0;30>F;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),q=Math.min(258,M);j>=D&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var Z=0;q>Z&&t[h+Z]==t[h+Z-D];++Z);if(Z>O){if(O=Z,P=D,Z>B)break;var H=Math.min(D,Z-2),V=0;for(F=0;H>F;++F){var z=h-D+F+32768&32767,Y=z-g[z]+32768&32767;Y>V&&(V=Y,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|ou[O]<<18|au[P];var U=31&ou[O],W=31&au[P];k+=eu[U]+iu[W],++I[257+U],++C[W],T=h+O,++S}else _[x++]=t[h],++I[t[h]]}}u=ku(t,l,!0,_,I,C,k,x,A,h-A,u)}return mu(a,0,r+gu(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Au(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(l,e),Au(l,u-8,i.d()),Au(l,u-4,r),l}var Ru=!!Hn||!!$n,Nu="text/plain",Mu=function(t,e,r){var n;void 0===r&&(r=!0);var[s,o]=t.split("?"),a=i({},e),l=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[i,n]=t.split("="),s=r&&null!==(e=a[i])&&void 0!==e?e:n;return delete a[i],i+"="+s})))&&void 0!==n?n:[],u=ds(a);return u&&l.push(u),s+"?"+l.join("&")},Fu=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Ou=t=>{if(t.zt)return t.zt;var{data:e,compression:i}=t;if(e){if(i===Xl){var r=Eu(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Kl(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new Kl(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return mu(r,0,n)}(Fu(e)),{mtime:0});return{contentType:Nu,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Jl){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Fu(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Fu(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Fu(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Pu=function(){var t=e((function*(t){var e=Fu(t.data),r=yield function(t,e){return Fi.apply(this,arguments)}(e,Xn.DEBUG);if(!r)return t;var n=yield r.arrayBuffer();return i({},t,{zt:{contentType:Nu,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Lu=[];$n&&Lu.push({transport:"fetch",method(t){var e,r,{contentType:n,body:s,estimatedSize:o}=null!==(e=Ou(t))&&void 0!==e?e:{},a=new Headers;es(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(Vn){var h=new Vn;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}$n(l,i({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&52428.8>(o||0),body:s,signal:null==(r=u)?void 0:r.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){Kn.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{Kn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),Hn&&Lu.push({transport:"XHR",method(t){var e,i=new Hn;i.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=null!==(e=Ou(t))&&void 0!==e?e:{};es(t.headers,(function(t,e){i.setRequestHeader(e,t)})),r&&i.setRequestHeader("Content-Type",r),t.timeout&&(i.timeout=t.timeout),t.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(n)}}),null!=jn&&jn.sendBeacon&&Lu.push({transport:"sendBeacon",method(t){var e=Mu(t.url,{beacon:"1"});try{var i,{contentType:r,body:n}=null!==(i=Ou(t))&&void 0!==i?i:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:r});jn.sendBeacon(e,s)}catch(t){}}});var Du=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 Bu(t,e,i){return Fu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ju={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=>Du(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Du(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 i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))},qu=t=>t.toLowerCase();function Zu(t,e){return!t||Object.entries(t).every((t=>{var[i,r]=t,n=null==e?void 0:e[i];if(Gi(n)||Ki(n))return!1;var s=[String(n)],o=ju[r.operator];return!!o&&o(r.values,s)}))}var $u=Qn("[Stylesheet Loader]"),Hu=Dn,Vu=qn;function zu(t){return"$survey_response_"+t}var Yu="#020617",Uu={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:Il.Right,widgetType:_l.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),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:Yu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Wu=[Il.Center,Il.Left,Il.Right];function Gu(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=Uu.backgroundColor),"#"===t[0]&&(e=Gu(t)),t.startsWith("rgb")&&(e=t);var i={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(i&&(e=Gu(i)),!e)return Yu;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Yu:"white"}return Yu}var Ju=(t,e,r)=>{var n=mh(t),s=Vu.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Vu.createElement("div");((t,e,r)=>{var n=i({},Uu,r),s=t.style,o=!Wu.includes(n.position)||e===Sl.Widget&&(null==r?void 0:r.widgetType)===_l.Tab;s.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)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||Xu(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Xu(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Xu(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Xu(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==r?void 0:r.inputTextColor)||Xu(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r,n=t.createElement("style");return n.innerText=':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:2147483645;--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}.rating-options-emoji-2{justify-content:space-around}.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)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.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)}}',null!=i&&null!=(r=i.config)&&r.prepare_external_dependency_stylesheet&&(n=i.config.prepare_external_dependency_stylesheet(n)),n||($u.error("prepare_external_dependency_stylesheet returned null"),null)})(Vu,0,t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Vu.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ku=(t,e)=>{if(!e)return null;var i=t[zu(e)];return zi(i)?[...i]:i},Qu=t=>{var{responses:e,survey:r,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=t;s?(ql(r),s.capture(Al.SENT,i({[El.SURVEY_NAME]:r.name,[El.SURVEY_ID]:r.id,[El.SURVEY_ITERATION]:r.current_iteration,[El.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[El.SURVEY_QUESTIONS]:r.questions.map((t=>({id:t.id,question:t.question,response:Ku(e,t.id)}))),[El.SURVEY_SUBMISSION_ID]:n,[El.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,a,{$set:{[Dl(r,"responded")]:!0}})),o&&(Hu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),gh(r))):Nl.error("[survey sent] event not captured, PostHog instance not found.")},th=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!Qi(t))).length>0,eh=(t,e,r)=>i({[El.SURVEY_NAME]:t.name,[El.SURVEY_ID]:t.id,[El.SURVEY_ITERATION]:t.current_iteration,[El.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[El.SURVEY_PARTIALLY_COMPLETED]:th(e),sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url()},null==e?void 0:e.responses,{[El.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[El.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Ku((null==e?void 0:e.responses)||{},t.id)})))}),ih=(t,e,r)=>{if(e){if(!r){var n=fh(t);e.capture(Al.DISMISSED,i({},eh(t,n,e),{$set:{[Dl(t,"dismissed")]:!0}})),gh(t),ql(t),Hu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Nl.error("[survey dismissed] event not captured, PostHog instance not found.")},rh=(t,e)=>{if(e){var i=(t=>Bl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=fh(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Al.ABANDONED,eh(t,r,e),{transport:"sendBeacon"})}}else Nl.error("[survey abandoned] event not captured, PostHog instance not found.")},nh=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,i)=>t===e[i]))?e.reverse():e,oh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,nh(t.questions)):t.questions,ah=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,i;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})(t))||t.schedule===Tl||ph(t)},lh=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,Ma(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+ba++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0}),uh=()=>cl(lh),hh=t=>{var{component:e,children:i,renderAsHtml:r,style:n}=t;return function(t,e,i){var r,n,s,o,a=Sa({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?la.call(arguments,2):i),Ta(t.type,a,r||t.key,n||t.ref,null)}(e,r?{dangerouslySetInnerHTML:{__html:i},style:n}:{children:i,style:n})};function ch(t){var e,i,r;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Hu||null==(i=Hu.location)?void 0:i.href;if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return ju[o](s,[n])}var dh=t=>{var e=""+Ll+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ll+t.id+"_"+t.current_iteration),e},vh=(t,e)=>{try{localStorage.setItem(dh(t),JSON.stringify(e))}catch(t){Nl.error("Error setting in-progress survey state in localStorage",t)}},fh=t=>{try{var e=localStorage.getItem(dh(t));if(e)return JSON.parse(e)}catch(t){Nl.error("Error getting in-progress survey state from localStorage",t)}return null},ph=t=>{var e=fh(t);return!Qi(null==e?void 0:e.surveySubmissionId)},gh=t=>{try{localStorage.removeItem(dh(t))}catch(t){Nl.error("Error clearing in-progress survey state from localStorage",t)}};function mh(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function yh(t,e,i){if(void 0===e&&(e=Il.Right),t===Sl.ExternalSurvey)return{};switch(e){case Il.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Il.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Il.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Il.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Il.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Il.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Il.Left:return{left:"30px"};case Il.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Sl.Widget&&i===_l.Tab?"60px":"30px"}}}var bh=0;function wh(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ua.vnode&&ua.vnode(u),u}var _h=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"})}),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.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"})}),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:"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"})}),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:"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"})}),xh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wh("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Th=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wh("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Ah=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return wh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[wh("title",{id:"close-survey-title",className:"adam-testing",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:e})]})},Eh=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 Rh(t){var{urlParams:e}=t,i=e?Object.entries(e).map((t=>{var[e,i]=t;return encodeURIComponent(e)+"="+encodeURIComponent(i)})).join("&"):"";return wh("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Eh]})}function Nh(t){var{text:e,submitDisabled:i,appearance:r,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:l}=cl(lh);return wh("div",{className:"bottom-section",children:[!a&&wh("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Dn||Dn.open(s)),l?null==o||o():n()},children:e}),!r.whiteLabel&&wh(Rh,{urlParams:{utm_source:"survey-footer"}})]})}function Mh(t){var{question:e,forceDisableHtml:i,htmlFor:r}=t;return wh("div",{class:"question-header",children:[wh(e.type===kl.Open?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&hh({component:xa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Fh(t){var{onClick:e}=t,{isPreviewMode:i}=cl(lh);return wh("button",{className:"form-cancel",onClick:e,disabled:i,"aria-label":"Close survey",type:"button",children:Ah({fill:"black"})})}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 Oh=Dn;function Ph(t){var{header:e,description:i,contentType:r,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=cl(lh);return ll((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return us(Oh,"keydown",t),()=>{Oh.removeEventListener("keydown",t)}}),[o]),wh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wh(Fh,{onClick:()=>o()}),wh("h3",{className:"thank-you-message-header",children:e}),i&&hh({component:xa("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&wh(Nh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Lh=t=>zi(t)&&t.every((t=>Xi(t)));function Dh(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:l}=uh(),u=ul(null),[h,c]=al((()=>Xi(a)?a:""));ll((()=>{setTimeout((()=>{var t;l||null==(t=u.current)||t.focus()}),100)}),[l]);var d="surveyQuestion"+o,v=hl((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Oi.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case Oi.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Li(e.validation,Oi.MinLength),p=Li(e.validation,Oi.MaxLength),g=hl((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{question:e,forceDisableHtml:i,htmlFor:d}),wh("textarea",{ref:u,id:d,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation()},value:h}),g&&wh("div",{className:"validation-hint",children:g})]}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:r,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function Bh(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s}=t;return wh(Aa,{children:[wh("div",{className:"question-container",children:wh(Mh,{question:e,forceDisableHtml:i})}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function jh(t){var e,{question:i,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=i.scale,h=10===i.scale?0:1,[c,d]=al((()=>tr(l)?l:zi(l)&&l.length>0&&tr(parseInt(l[0]))?parseInt(l[0]):Xi(l)&&tr(parseInt(l))?parseInt(l):null)),v="emoji"===i.display&&2===i.scale,{isPreviewMode:f}=uh(),p=t=>f?a(t):o(t);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{question:i,forceDisableHtml:r}),wh("div",{className:"rating-section",children:[wh("div",{className:"rating-options",children:["emoji"===i.display&&wh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=zh[i.scale])?void 0:e.map(((t,e)=>wh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;d(t),i.skipSubmitButton&&p(t)},children:t},e)))}),"number"===i.display&&wh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-h+1)+", minmax(0, 1fr))"},children:Yh(i.scale).map(((t,e)=>wh(qh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),i.skipSubmitButton&&p(t)}},e)))})]}),!v&&wh("div",{className:"rating-text",children:[wh("div",{children:i.lowerBoundLabel}),wh("div",{children:i.upperBoundLabel})]})]})]}),wh(Nh,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ki(c)&&!i.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:i.skipSubmitButton})]})}function qh(t){var{num:e,active:i,displayQuestionIndex:r,setActiveNumber:n}=t;return wh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+r+"-rating-"+e+" "+(i?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function Zh(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=ul(null),h=hl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=sh(e,nh(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),[c,d]=al((()=>((t,e)=>Xi(t)||Lh(t)?t:e===kl.SingleChoice?null:[])(l,e.type))),[v,f]=al((()=>((t,e)=>{if(Xi(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Lh(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=uh(),g=e.type===kl.SingleChoice,m=e.type===kl.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var r=!v.isSelected;return f((t=>i({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),g&&d(""),void(r&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>i({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&zi(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>i({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>i({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!(e.optional||!Ki(c)&&(!zi(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),C=()=>{v.isSelected&&m?zi(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{question:e,forceDisableHtml:r}),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,i)=>{var r=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+n+"Choice"+i,o=s+"Open",a=r?v.isSelected:g?c===t:zi(c)&&c.includes(t);return wh("label",{className:r?"choice-option-open":"",children:[wh("div",{className:"response-choice",children:[wh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,r),id:s,"aria-controls":o}),wh("span",{children:r?t+":":t})]}),r&&wh("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick(e){v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var $h=[1,2,3,4,5],Hh=[1,2,3,4,5,6,7],Vh=[0,1,2,3,4,5,6,7,8,9,10],zh={2:[xh,Th],3:[Ch,Ih,_h],5:[Sh,Ch,Ih,_h,kh]};function Yh(t){switch(t){case 5:default:return $h;case 7:return Hh;case 10:return Vh}}var Uh=Qn("[Surveys]");function Wh(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?xl.End:s;if(n.branching.type===xl.End)return xl.End;if(n.branching.type===xl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===xl.ResponseBased){if(n.type===kl.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===xl.End?xl.End:s}}else if(n.type===kl.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||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(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,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===xl.End?xl.End:s}}return s}return Uh.warn("Falling back to next question index due to unexpected branching type"),s}var Gh=Dn,Xh=qn,Jh="ph:show_survey_widget",Kh="PHWidgetSurveyClickListener";function Qh(t,e){try{var i=t.getBoundingClientRect(),r=Gh.innerHeight,n=Gh.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:Uu.zIndex}}catch(t){return Nl.warn("Failed to calculate trigger position:",t),null}}class tc{constructor(t){var e=this;this.R=new Map,this.M=new Map,this.O=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(js);if(t)for(var e of t)ph(e)&&rh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var r,n,s,o,a=null!=e&&e.position||null!=e&&e.selector?i({},t,{appearance:i({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.F(a.id);var{properties:l,initialResponses:u}=null!=e?e:{},h=!(!u||0>=Object.keys(u).length)&&this.B(a,u,l);if(!h||null!=(r=a.appearance)&&r.displayThankYouMessage){this.Z(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Il.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var d,v=Xh.querySelector(a.appearance.widgetSelector);v&&(c=Qh(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||Uu.maxWidth))||{})}var f=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:p}=Ju(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.D,properties:l,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(0>=f)return Ya(wh(nc,i({},g)),p);var m=setTimeout((()=>{if(this.R.delete(a.id),!ch(a))return this.D(a);Ya(wh(nc,i({},g,{survey:i({},a,{appearance:i({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.R.set(a.id,m)}},this.V=t=>{var{shadow:e,isNewlyCreated:i}=Ju(t,this._posthog);i&&Ya(wh(oc,{posthog:this._posthog,survey:t},t.id),e)},this.q=t=>{this.j(t);var e=this.M.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Kh),this.M.delete(t.id),Nl.info("Removed click listener for survey "+t.id))},this.H=(t,e)=>{var i=Xh.querySelector(e),r=this.M.get(t.id);if(i){if(this.V(t),r){if(i===r.element)return;Nl.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.q(t)}if(!i.hasAttribute(Kh)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Il.NextToTrigger?Qh(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Uu.maxWidth)):{};Gh.dispatchEvent(new CustomEvent(Jh,{detail:{surveyId:t.id,position:n}}))};us(i,"click",n),i.setAttribute(Kh,"true"),this.M.set(t.id,{element:i,listener:n,survey:t}),Nl.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.q(t)},this.renderPopover=t=>{var{shadow:e}=Ju(t,this._posthog);Ya(wh(nc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.D}),e)},this.renderSurvey=(t,e,i)=>{var r,n=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(n=this.Y(t)),Ya(wh(nc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.D,isPopup:!1,properties:i,isSurveyCompleted:n}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.W(t)&&e.U(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Sl.Popover||t.type===Sl.Widget)),r=e.X(i),n=new Set;r.forEach((t=>{if(t.type===Sl.Widget){var i,r,s,o;if((null==(i=t.appearance)?void 0:i.widgetType)===_l.Tab)return void e.V(t);(null==(r=t.appearance)?void 0:r.widgetType)===_l.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.H(t,null==(o=t.appearance)?void 0:o.widgetSelector))}Ki(e.K)&&t.type===Sl.Popover&&e.handlePopoverSurvey(t)})),e.M.forEach((t=>{var{survey:i}=t;n.has(i.id)||e.q(i)}))}),t)},this.Z=t=>{Ki(this.K)||Nl.error("Survey "+this.K+" already in focus. Cannot add survey "+t.id+"."),this.K=t.id},this.D=t=>{this.K!==t.id&&Nl.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.F(t.id),this.K=null,this.j(t)},this._posthog=t,this.K=null}F(t){var e=this.R.get(t);e&&(clearTimeout(e),this.R.delete(t))}cancelSurvey(t){this.R.has(t)&&(Nl.info("Cancelled pending survey "+t),this.F(t),this.K===t&&(this.K=null))}X(t){return t.sort(((t,e)=>{var i,r,n=ph(t),s=ph(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Tl,a=e.schedule===Tl;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}Y(t){if(this.O.has(t.id))return!1;var{params:e}=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!Gi(a)){var l=decodeURIComponent(o),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 i=!0}}return{params:e,autoSubmit:i}}(Gh.location.search);if(0===Object.keys(e).length)return!1;Nl.info("[Survey Prefill] Detected URL prefill parameters");var i=this.J(t,e);if(!i)return!1;var{responses:r,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=i;return(Object.keys(o).length>0&&t.enable_partial_responses||s)&&Qu({responses:s?r:o,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this.O.add(t.id),s}B(t,e,i){var r={};for(var[n,s]of Object.entries(e))r[parseInt(n)]=zi(s)?s.map(String):[String(s)];Nl.info("[Survey] Processing initial responses");var o=this.J(t,r);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return Qu({responses:a,survey:t,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:i}),u}J(t,e){try{var i=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=zu(t.id);try{switch(t.type){case kl.SingleChoice:if(!t.choices||0===t.choices.length)return void Kn.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Kn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void Kn.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void Kn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&Kn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case kl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Kn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Kn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Kn.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(i).length)return Nl.warn("[Survey Prefill] No valid responses after conversion"),null;var r=Wl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,i){for(var r=0,n={},s=t.questions.length+1;t.questions.length>r&&s>0&&e.includes(r);){var o=t.questions[r];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=zu(o.id);Gi(i[a])||(n[a]=i[a])}var l=Wh(t,r,o.id?i[zu(o.id)]:null);if(l===xl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};r=l}return{startQuestionIndex:r,skippedResponses:n}}(t,n,i),a=s>=t.questions.length;return vh(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:s}),Nl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(t){return Nl.error("[Survey Prefill] Error handling prefill:",t),null}}$(t,e){var i;if(void 0===e&&(e=void 0),!t)return!0;var r,n=!(null==(i=this._posthog.featureFlags)||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(r=this._posthog.featureFlags)?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}G(t){return!t.conditions||ch(t)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!Yn)return!1;var s=cn(Yn,{userAgentDataPlatform:null==jn||null==(i=jn.userAgentData)?void 0:i.platform,maxTouchPoints:null==jn?void 0:jn.maxTouchPoints,screenWidth:null==Dn||null==(r=Dn.screen)?void 0:r.width,screenHeight:null==Dn||null==(n=Dn.screen)?void 0:n.height,devicePixelRatio:null==Dn?void 0:Dn.devicePixelRatio});return ju[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Vu||!Vu.querySelector(t.conditions.selector))}(t)}ee(t){return ah(t)||this.$(t.internal_targeting_flag_key)||ph(t)}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Ml(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Zl.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.$(t.linked_flag_key,n)?this.$(t.targeting_flag_key)?this.ee(t)?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,localStorage.getItem("lastSeenSurveyDate"))?(t=>!!localStorage.getItem(jl(t))&&!ah(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r):(r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r):(r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r)}W(t){var e;if(!Fl(t)&&!Ol(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.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:i}=t;return!e||!i||this.$(i)}))}j(t){try{var e=Xh.querySelector(mh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){Nl.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.D,surveyInFocus:this.K,surveyTimeouts:this.R,handleWidget:this.V,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.H,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.$.bind(this)}}}function ec(t,e){if(Xh&&Gh){var i,r=new tc(t);if(t.config.disable_surveys_automatic_display)return Nl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Nl.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Gi(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),us(Xh,"visibilitychange",(()=>{Xh.hidden?Gi(i)||(clearInterval(i),i=void 0):(r.callSurveysAndEvaluateDisplayLogic(!1),n())})),r}}function ic(t){var{survey:e,removeSurveyFromFocus:i=(()=>{}),setSurveyVisible:r,isPreviewMode:n=!1}=t;ll((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Sl.Widget,s=ch(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===_l.Tab&&n;if(!s)return Nl.info("Hiding survey "+e.id+" because URL does not match"),r(!1),i(e);o&&(Nl.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),r(!0))};us(Gh,"popstate",s),us(Gh,"hashchange",s);var o=Gh.history.pushState,a=Gh.history.replaceState;return Gh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];o.apply(this,e),s()},Gh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];a.apply(this,e),s()},()=>{Gh.removeEventListener("popstate",s),Gh.removeEventListener("hashchange",s),Gh.history.pushState=o,Gh.history.replaceState=a}}}),[n,e,i,r])}function rc(t){switch(void 0===t&&(t=Cl.Right),t){case Cl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Cl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Cl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function nc(t){var e,r,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=ul(null),I=Number.isInteger(d),C=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,i,r,n,s,o,a){var[l,u]=al(r||0===i||t.type===Sl.ExternalSurvey),[h,c]=al(!1),d=()=>{var e=()=>{s&&n(t),u(!1)};Xh.startViewTransition?Xh.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return ll((()=>{if(e){if(!r){var n=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return d();c(!0),null!=(r=t.appearance)&&r.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{ch(t)&&(u(!0),Gh.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Al.SHOWN,{[El.SURVEY_NAME]:t.name,[El.SURVEY_ID]:t.id,[El.SURVEY_ITERATION]:t.current_iteration,[El.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(us(Gh,"PHSurveyClosed",v),us(Gh,"PHSurveySent",n),i>0){var o=setTimeout(s,i);return()=>{clearTimeout(o),Gh.removeEventListener("PHSurveyClosed",v),Gh.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gh.removeEventListener("PHSurveyClosed",v),Gh.removeEventListener("PHSurveySent",n)}}}else Nl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ic({survey:t,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:r}),{isPopupVisible:l,isSurveySent:h,setIsPopupVisible:u,hidePopupWithViewTransition:d}}(l,h,C,I,v,f,_,w),T=k||d===l.questions.length||!0===b,A=hl((()=>{var t=fh(l);return{isPreviewMode:I,previewPageIndex:d,onPopupSurveyDismissed(){ih(l,h,I),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Wl(),onPreviewSubmit:p,posthog:h,properties:y}}),[I,d,f,h,l,g,p,y]);return S?wh(lh.Provider,{value:A,children:wh("div",{className:"ph-survey",style:i({},yh(l.type,null==(r=l.appearance)?void 0:r.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:_,children:T?wh(Ph,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Uu,onClose(){x(),m()}}):wh(sc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function sc(t){var e,{survey:r,forceDisableHtml:n,posthog:s}=t,[o,a]=al((()=>{var t=fh(r);return null!=t&&t.responses&&Nl.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,properties:f}=cl(lh),[p,g]=al((()=>{var t=fh(r);return l||(null==t?void 0:t.lastQuestionIndex)||0})),m=hl((()=>oh(r)),[r]);ll((()=>{v&&!Gi(l)&&g(l)}),[l,v]);var y=m.at(p);return y?wh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=r.appearance)?void 0:e.hideCancelButton)&&wh(Fh,{onClick(){u()}}),wh("div",{className:"survey-box","data-question-index":p,children:ac({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:r.appearance||Uu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(s)if(l){var u=zu(l),h=i({},o,{[u]:e});a(h);var c=Wh(r,n,e),v=c===xl.End;v||(g(c),vh(r,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(r.enable_partial_responses||v)&&Qu({responses:h,survey:r,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f})}else Nl.error("onNextButtonClick called without a questionId.");else Nl.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?o[zu(y.id)]:void 0})})]}):null}function oc(t){var e,i,r,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=al(!0),[f,p]=al(!1),[g,m]=al({}),y=()=>{p(!f)};if(ll((()=>{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,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Nl.info("Received show event for feedback button survey "+l.id),m(i.detail.position||{}),y())};return us(Gh,Jh,e),()=>{Gh.removeEventListener(Jh,e)}}}else Nl.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),ic({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==Tl&&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==(s=l.appearance)?void 0:s.tabPosition)===Cl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:rc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&wh(nc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var ac=t=>{var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:r,appearance:s,onPreviewSubmit(t){a(t)},onSubmit(t){o(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case kl.Open:return xa(Dh,i({},u,{question:e,key:e.id}));case kl.Link:return xa(Bh,i({},u,{question:e,key:e.id}));case kl.Rating:return xa(jh,i({},u,{question:e,key:e.id}));case kl.SingleChoice:case kl.MultipleChoice:return xa(Zh,i({},u,{question:e,key:e.id}));default:return Nl.error("Unsupported question type: "+e.type),null}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.generateSurveys=ec,Un.extendPostHogWithSurveys=ec;class lc{emit(t){}}var uc=new lc,hc=new class{getLogger(t,e,i){return new lc}};class cc{constructor(t,e,i,r){this.te=t,this.name=e,this.version=i,this.options=r}emit(t){this.re().emit(t)}re(){if(this.ne)return this.ne;var t=this.te.ie(this.name,this.version,this.options);return t?(this.ne=t,this.ne):uc}}class dc{getLogger(t,e,i){var r;return null!==(r=this.ie(t,e,i))&&void 0!==r?r:new cc(this,t,e,i)}oe(){var t;return null!==(t=this.ne)&&void 0!==t?t:hc}ae(t){this.ne=t}ie(t,e,i){var r;return null===(r=this.ne)||void 0===r?void 0:r.getLogger(t,e,i)}}var vc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},fc=Symbol.for("io.opentelemetry.js.api.logs"),pc=vc;class gc{constructor(){this.se=new dc}static getInstance(){return this._instance||(this._instance=new gc),this._instance}setGlobalLoggerProvider(t){return pc[fc]?this.getLoggerProvider():(pc[fc]=(1,e=t,i=hc,t=>1===t?e:i),this.se.ae(t),t);var e,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=pc[fc])||void 0===t?void 0:t.call(pc,1))&&void 0!==e?e:this.se}getLogger(t,e,i){return this.getLoggerProvider().getLogger(t,e,i)}disable(){delete pc[fc],this.se=new dc}}var mc=gc.getInstance();class yc{constructor(t){this.ne=void 0,this.ne=t}export(t,e){this.ne.export(t,e)}forceFlush(){return this.ne.forceFlush()}shutdown(){return this.ne.shutdown()}}class bc extends Error{constructor(t,e,i){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=i,this.code=e}}function wc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class _c{constructor(t){this.ue=void 0,this.le=[],this.ue=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.le.push(t);var e=()=>{var e=this.le.indexOf(t);this.le.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.le.length>=this.ue}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.le)}))()}}function Ic(t){return new _c(t.concurrencyLimit)}var Cc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sc="1.9.0",kc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,xc=function(t){var e=new Set([t]),i=new Set,r=t.match(kc);if(!r)return function(){return!1};var n=+r[1],s=+r[2],o=+r[3];if(null!=r[4])return function(e){return e===t};function a(t){return i.add(t),!1}function l(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(i.has(t))return!1;var r=t.match(kc);if(!r)return a(t);var u=+r[2],h=+r[3];return null!=r[4]||n!==+r[1]?a(t):0===n?s!==u||o>h?a(t):l(t):s>u?a(t):l(t)}}(Sc),Tc=Sc.split(".")[0],Ac=Symbol.for("opentelemetry.js.api."+Tc),Ec=Cc;function Rc(t,e,i,r){var n;void 0===r&&(r=!1);var s=Ec[Ac]=null!==(n=Ec[Ac])&&void 0!==n?n:{version:Sc};if(!r&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return i.error(o.stack||o.message),!1}return s.version!==Sc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Sc),i.error(o.stack||o.message),!1):(s[t]=e,i.debug("@opentelemetry/api: Registered a global for "+t+" v"+Sc+"."),!0)}function Nc(t){var e,i,r=null===(e=Ec[Ac])||void 0===e?void 0:e.version;if(r&&xc(r))return null===(i=Ec[Ac])||void 0===i?void 0:i[t]}function Mc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Sc+".");var i=Ec[Ac];i&&delete i[t]}var Fc,Oc=function(){function t(t){this.ce=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("debug",this.ce,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("error",this.ce,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("info",this.ce,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("warn",this.ce,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("verbose",this.ce,t)},t}();function Pc(t,e,i){var r=Nc("diag");if(r)return i.unshift(e),r[t].apply(r,function(t,e,i){if(i||2===arguments.length)for(var r,n=0,s=e.length;s>n;n++)!r&&n in e||(r||(r=[].slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||[].slice.call(e))}([],function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,s=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}(i),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Fc||(Fc={}));var Lc=function(){function t(){function t(t){return function(){for(var e=[],i=0;arguments.length>i;i++)e[i]=arguments[i];var r=Nc("diag");if(r)return r[t].apply(r,function(t,e,i){if(i||2===arguments.length)for(var r,n=0,s=e.length;s>n;n++)!r&&n in e||(r||(r=[].slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||[].slice.call(e))}([],function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,s=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}(e),!1))}}var e=this;e.setLogger=function(t,i){var r,n,s;if(void 0===i&&(i={logLevel:Fc.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(r=o.stack)&&void 0!==r?r:o.message),!1}"number"==typeof i&&(i={logLevel:i});var a=Nc("diag"),l=function(t,e){function i(i,r){var n=e[i];return"function"!=typeof n||r>t?function(){}:n.bind(e)}return Fc.NONE>t?t=Fc.NONE:t>Fc.ALL&&(t=Fc.ALL),e=e||{},{error:i("error",Fc.ERROR),warn:i("warn",Fc.WARN),info:i("info",Fc.INFO),debug:i("debug",Fc.DEBUG),verbose:i("verbose",Fc.VERBOSE)}}(null!==(n=i.logLevel)&&void 0!==n?n:Fc.INFO,t);if(a&&!i.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return Rc("diag",l,e,!0)},e.disable=function(){Mc("diag",e)},e.createComponentLogger=function(t){return new Oc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function Dc(t){return Symbol.for(t)}var Bc,jc=new function t(e){var i=this;i.de=e?new Map(e):new Map,i.getValue=function(t){return i.de.get(t)},i.setValue=function(e,r){var n=new t(i.de);return n.de.set(e,r),n},i.deleteValue=function(e){var r=new t(i.de);return r.de.delete(e),r}},qc=function(){function t(){}return t.prototype.active=function(){return jc},t.prototype.with=function(t,e,i){for(var r=[],n=3;arguments.length>n;n++)r[n-3]=arguments[n];return e.call.apply(e,function(t,e,i){if(i||2===arguments.length)for(var r,n=0,s=e.length;s>n;n++)!r&&n in e||(r||(r=[].slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||[].slice.call(e))}([i],function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,s=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),Zc="context",$c=new qc,Hc=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Rc(Zc,t,Lc.instance())},t.prototype.active=function(){return this.he().active()},t.prototype.with=function(t,e,i){for(var r,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(r=this.he()).with.apply(r,function(t,e,i){if(i||2===arguments.length)for(var r,n=0,s=e.length;s>n;n++)!r&&n in e||(r||(r=[].slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||[].slice.call(e))}([t,e,i],function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,s=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},t.prototype.bind=function(t,e){return this.he().bind(t,e)},t.prototype.he=function(){return Nc(Zc)||$c},t.prototype.disable=function(){this.he().disable(),Mc(Zc,Lc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Bc||(Bc={}));var Vc="0000000000000000",zc="00000000000000000000000000000000",Yc={traceId:zc,spanId:Vc,traceFlags:Bc.NONE},Uc=function(){function t(t){void 0===t&&(t=Yc),this.ve=t}return t.prototype.spanContext=function(){return this.ve},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),Wc=Dc("OpenTelemetry Context Key SPAN");function Gc(t){return t.getValue(Wc)||void 0}function Xc(){return Gc(Hc.getInstance().active())}function Jc(t,e){return t.setValue(Wc,e)}function Kc(t){return t.deleteValue(Wc)}function Qc(t,e){return Jc(t,new Uc(e))}function td(t){var e;return null===(e=Gc(t))||void 0===e?void 0:e.spanContext()}var ed=/^([0-9a-f]{32})$/i,id=/^[0-9a-f]{16}$/i;function rd(t){return ed.test(i=t.traceId)&&i!==zc&&id.test(e=t.spanId)&&e!==Vc;var e,i}function nd(t){return new Uc(t)}var sd=Hc.getInstance(),od=function(){function t(){}return t.prototype.startSpan=function(t,e,i){if(void 0===i&&(i=sd.active()),Boolean(null==e?void 0:e.root))return new Uc;var r,n=i&&td(i);return"object"==typeof(r=n)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&rd(n)?new Uc(n):new Uc},t.prototype.startActiveSpan=function(t,e,i,r){var n,s,o;if(arguments.length>=2){2===arguments.length?o=e:3===arguments.length?(n=e,o=i):(n=e,s=i,o=r);var a=null!=s?s:sd.active(),l=this.startSpan(t,n,a),u=Jc(a,l);return sd.with(u,o,void 0,l)}},t}(),ad=new od,ld=function(){function t(t,e,i,r){this.te=t,this.name=e,this.version=i,this.options=r}return t.prototype.startSpan=function(t,e,i){return this.fe().startSpan(t,e,i)},t.prototype.startActiveSpan=function(t,e,i,r){var n=this.fe();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.fe=function(){if(this.ne)return this.ne;var t=this.te.getDelegateTracer(this.name,this.version,this.options);return t?(this.ne=t,this.ne):ad},t}(),ud=new(function(){function t(){}return t.prototype.getTracer=function(t,e,i){return new od},t}()),hd=function(){function t(){}return t.prototype.getTracer=function(t,e,i){var r;return null!==(r=this.getDelegateTracer(t,e,i))&&void 0!==r?r:new ld(this,t,e,i)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ne)&&void 0!==t?t:ud},t.prototype.setDelegate=function(t){this.ne=t},t.prototype.getDelegateTracer=function(t,e,i){var r;return null===(r=this.ne)||void 0===r?void 0:r.getTracer(t,e,i)},t}(),cd=Hc.getInstance(),dd=Lc.instance(),vd="trace",fd=function(){function t(){this.pe=new hd,this.wrapSpanContext=nd,this.isSpanContextValid=rd,this.deleteSpan=Kc,this.getSpan=Gc,this.getActiveSpan=Xc,this.getSpanContext=td,this.setSpan=Jc,this.setSpanContext=Qc}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Rc(vd,this.pe,Lc.instance());return e&&this.pe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return Nc(vd)||this.pe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){Mc(vd,Lc.instance()),this.pe=new hd},t}().getInstance(),pd=Dc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function gd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var i of t)if(null!=i){var r=typeof i;if(r!==e){if(!e){if(md(r)){e=r;continue}return!1}return!1}}return!0}(t):md(typeof t))}function md(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function yd(t){try{(t=>{dd.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},i=t;null!==i;)Object.getOwnPropertyNames(i).forEach((t=>{if(!e[t]){var r=i[t];r&&(e[t]=String(r))}})),i=Object.getPrototypeOf(i);return e}(t))}(t))})(t)}catch(t){}}var bd,wd=performance,_d="telemetry.sdk.language",Id="telemetry.sdk.name",Cd="telemetry.sdk.version",Sd={[Id]:"opentelemetry","process.runtime.name":"browser",[_d]:"webjs",[Cd]:"2.2.0"},kd=Math.pow(10,6),xd=Math.pow(10,9);function Td(t){return[Math.trunc(t/1e3),Math.round(t%1e3*kd)]}function Ad(){var t=wd.timeOrigin;return"number"!=typeof t&&(t=wd.timing&&wd.timing.fetchStart),t}function Ed(t){if(s=t,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return t;if("number"==typeof t)return t<Ad()?(e=t,i=Td(Ad()),r=Td("number"==typeof e?e:wd.now()),xd>(n=[i[0]+r[0],i[1]+r[1]])[1]||(n[1]-=xd,n[0]+=1),n):Td(t);var e,i,r,n,s;if(t instanceof Date)return Td(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(bd||(bd={}));var Rd="[object Object]",Nd="[object Null]",Md="[object Undefined]",Fd=function(){}.toString,Od=Fd.call(Object),Pd=Object.getPrototypeOf,Ld=Object.prototype,Dd=Ld.hasOwnProperty,Bd=Symbol?Symbol.toStringTag:void 0,jd=Ld.toString;function qd(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?Md:Nd:Bd&&Bd in Object(t)?function(t){var e=Dd.call(t,Bd),i=t[Bd],r=!1;try{t[Bd]=void 0,r=!0}catch(t){}var n=jd.call(t);return r&&(e?t[Bd]=i:delete t[Bd]),n}(t):function(t){return jd.call(t)}(t)}(t)!==Rd)return!1;var e=Pd(t);if(null===e)return!0;var i=Dd.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Fd.call(i)===Od}function Zd(t){return Vd(t)?t.slice():t}function $d(t,e,i,r){var n;if(void 0===i&&(i=0),20>=i){if(i++,Ud(t)||Ud(e)||zd(e))n=Zd(e);else if(Vd(t)){if(n=t.slice(),Vd(e))for(var s=0,o=e.length;o>s;s++)n.push(Zd(e[s]));else if(Yd(e))for(var a=Object.keys(e),l=0,u=a.length;u>l;l++){var h=a[l];n[h]=Zd(e[h])}}else if(Yd(t))if(Yd(e)){if(!function(t,e){return!(!qd(t)||!qd(e))}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;v>d;d++){var f=c[d],p=e[f];if(Ud(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Hd(t,f,r)||Hd(e,f,r))delete n[f];else{if(Yd(g)&&Yd(m)){var y=r.get(g)||[],b=r.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),r.set(g,y),r.set(m,b)}n[f]=$d(n[f],p,i,r)}}}}else n=e;return n}}function Hd(t,e,i){for(var r=i.get(t[e])||[],n=0,s=r.length;s>n;n++){var o=r[n];if(o.key===e&&o.obj===t)return!0}return!1}function Vd(t){return Array.isArray(t)}function zd(t){return"function"==typeof t}function Yd(t){return!Ud(t)&&!Vd(t)&&!zd(t)&&"object"==typeof t}function Ud(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Wd extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Wd.prototype)}}function Gd(t,e){var i,r=new Promise((function(t,r){i=setTimeout((function(){r(new Wd("Operation timed out."))}),e)}));return Promise.race([t,r]).then((t=>(clearTimeout(i),t)),(t=>{throw clearTimeout(i),t}))}class Xd{constructor(){this.me=void 0,this.ye=void 0,this.ge=void 0,this.me=new Promise(((t,e)=>{this.ye=t,this.ge=e}))}get promise(){return this.me}resolve(t){this.ye(t)}reject(t){this.ge(t)}}class Jd{constructor(t,e){this.be=void 0,this.we=void 0,this.Ce=!1,this.Ie=new Xd,this.be=t,this.we=e}get isCalled(){return this.Ce}get promise(){return this.Ie.promise}call(){if(!this.Ce){this.Ce=!0;try{for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];Promise.resolve(this.be.call(this.we,...e)).then((t=>this.Ie.resolve(t)),(t=>this.Ie.reject(t)))}catch(t){this.Ie.reject(t)}}return this.Ie.promise}}var Kd={Se:(t,e)=>new Promise((i=>{cd.with(function(t){return t.setValue(pd,!0)}(cd.active()),(()=>{t.export(e,(t=>{i(t)}))}))}))};class Qd{constructor(t,e,i,r,n){this.ke=void 0,this.xe=void 0,this.Ae=void 0,this.Te=void 0,this.Ne=void 0,this.Re=void 0,this.ke=t,this.xe=e,this.Ae=i,this.Te=r,this.Ne=n,this.Re=dd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Re.debug("items to be sent",t),this.Te.hasReachedLimit())e({code:bd.FAILED,error:new Error("Concurrent export limit reached")});else{var i=this.xe.serializeRequest(t);null!=i?this.Te.pushPromise(this.ke.send(i,this.Ne).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:bd.FAILED,error:t.error}:"retryable"===t.status?{code:bd.FAILED,error:new bc("Export failed with retryable status")}:{code:bd.FAILED,error:new bc("Export failed with unknown error")});else{if(null!=t.data)try{this.Ae.handleResponse(this.xe.deserializeResponse(t.data))}catch(e){this.Re.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:bd.SUCCESS})}}),(t=>e({code:bd.FAILED,error:t})))):e({code:bd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Te.awaitAll()}shutdown(){var t=this;return e((function*(){t.Re.debug("shutdown started"),yield t.forceFlush(),t.ke.shutdown()}))()}}function tv(t,e,i){return r={transport:i,serializer:e,promiseHandler:Ic(t)},new Qd(r.transport,r.serializer,{handleResponse(t){null!=t&&function(t){return{}.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&dd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},r.promiseHandler,{timeout:t.timeoutMillis}.timeout);var r}function ev(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function iv(t){for(var e=new Uint8Array(t.length/2),i=0,r=0;t.length>r;r+=2){var n=ev(t.charCodeAt(r)),s=ev(t.charCodeAt(r+1));e[i++]=n<<4|s}return e}function rv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function nv(t){var e;return e=rv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var sv="undefined"!=typeof BigInt?function(t){return rv(t).toString()}:function(t){return t[0]*xd+t[1]};function ov(t){return t}function av(t){if(void 0!==t)return iv(t)}var lv={encodeHrTime:nv,encodeSpanContext:iv,encodeOptionalSpanContext:av};function uv(t,e){return{key:t,value:hv(e)}}function hv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(hv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,i]=t;return uv(e,i)}))}}:{}}function cv(t,e){var i=function(t){var e=new Map;for(var i of t){var{resource:r,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=i,a=e.get(r);a||(a=new Map,e.set(r,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(i)}return e}(t);return Array.from(i,(t=>{var[i,r]=t,n=function(t){var e,i={attributes:(e=t.attributes,Object.keys(e).map((t=>uv(t,e[t])))),droppedAttributesCount:0},r=t.schemaUrl;return r&&""!==r&&(i.schemaUrl=r),i}(i);return{resource:n,scopeLogs:Array.from(r,(t=>{var i,[,r]=t;return{scope:(i=r[0].instrumentationScope,{name:i.name,version:i.version}),logRecords:r.map((t=>function(t,e){var i,r,n,s;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:hv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>uv(t,s[t])))),droppedAttributesCount:t.droppedAttributesCount,flags:null==(i=t.spanContext)?void 0:i.traceFlags,traceId:e.encodeOptionalSpanContext(null==(r=t.spanContext)?void 0:r.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:r[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var dv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class vv{static FromAttributeList(t,e){var i=new vv({},e);return i.Me=pv(t),i._e=t.filter((t=>{var[e,i]=t;return dv(i)})).length>0,i}constructor(t,e){var i;this.Me=void 0,this._e=!1,this.Ee=void 0,this.Oe=void 0;var r=null!==(i=t.attributes)&&void 0!==i?i:{};this.Me=Object.entries(r).map((t=>{var[e,i]=t;return dv(i)&&(this._e=!0),[e,i]})),this.Me=pv(this.Me),this.Ee=function(t){if("string"==typeof t||void 0===t)return t;dd.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this._e}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;t.Me.length>e;e++){var[i,r]=t.Me[e];t.Me[e]=[i,dv(r)?yield r:r]}t._e=!1}}))()}get attributes(){if(this.asyncAttributesPending&&dd.error("Accessing resource attributes before async attributes settled"),this.Oe)return this.Oe;var t={};for(var[e,i]of this.Me){var r;dv(i)?dd.debug("Unsettled resource attribute "+e+" skipped"):null!=i&&(null!==(r=t[e])&&void 0!==r||(t[e]=i))}return this._e||(this.Oe=t),t}getRawAttributes(){return this.Me}get schemaUrl(){return this.Ee}merge(t){if(null==t)return this;var e,i,r,n,s=(n=null==(i=t)?void 0:i.schemaUrl,void 0===(r=null==(e=this)?void 0:e.schemaUrl)||""===r?n:void 0===n||""===n||r===n?r:void dd.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)),o=s?{schemaUrl:s}:void 0;return vv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function fv(t,e){return vv.FromAttributeList(Object.entries(t),e)}function pv(t){return t.map((t=>{var[e,i]=t;return dv(i)?[e,i.catch((t=>{dd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,i]}))}var gv={serializeRequest(t){var e,i,r=(e=t,i=function(t){var e,i;if(void 0===t)return lv;var r=null===(e=t.useLongBits)||void 0===e||e,n=null!==(i=t.useHex)&&void 0!==i&&i;return{encodeHrTime:r?nv:sv,encodeSpanContext:n?ov:iv,encodeOptionalSpanContext:n?ov:av}}({useHex:!0,useLongBits:!1}),{resourceLogs:cv(e,i)});return(new TextEncoder).encode(JSON.stringify(r))},deserializeResponse(t){if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class mv{constructor(t){this.ke=void 0,this.ke=t}retry(t,e,i){return new Promise(((r,n)=>{setTimeout((()=>{this.ke.send(t,e).then(r,n)}),i)}))}send(t,i){var r=this;return e((function*(){for(var e=Date.now()+i,n=yield r.ke.send(t,i),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,h=e-Date.now();if(u>h)return n;n=yield r.retry(t,h,u)}return n}))()}shutdown(){return this.ke.shutdown()}}function yv(t){return new mv(t.transport)}function bv(t){return[429,502,503,504].includes(t)}function wv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var i=new Date(t).getTime()-Date.now();return 0>i?0:i}}class _v{constructor(t){this.Fe=void 0,this.Fe=t}send(t,i){var r=this;return e((function*(){var e=yield r.Fe.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=i,s.open("POST",r.Fe.url),Object.entries(e).forEach((t=>{var[e,i]=t;s.setRequestHeader(e,i)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&bv(s.status)?n({status:"retryable",retryInMillis:wv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(dd.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Iv{constructor(t){this.Le=void 0,this.Le=t}send(t){var i=this;return e((function*(){var e=(yield i.Le.headers())["Content-Type"];return new Promise((r=>{navigator.sendBeacon(i.Le.url,new Blob([t],{type:e}))?(dd.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Cv{constructor(t){this.Fe=void 0,this.Fe=t}send(t,i){var r=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),i);try{var s,o=!!globalThis.location,a=new URL(r.Fe.url),l=yield fetch(a.href,{method:"POST",headers:yield r.Fe.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?bv(l.status)?{status:"retryable",retryInMillis:wv(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(dd.debug("response success"),{status:"success"})}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Sv(t,e){return tv(t,e,yv({transport:(i=t,new _v(i))}));var i}function kv(t,e){return tv(t,e,yv({transport:(i=t,new Cv(i))}));var i}function xv(t,e){return tv(t,e,yv({transport:(i={url:t.url,headers:t.headers},new Iv(i))}));var i}function Tv(t){if(null!=t)try{var e,i=null==(e=globalThis.location)?void 0:e.href;return new URL(t,i).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function Av(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function Ev(t,r,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:Av(t),concurrencyLimit:t.concurrencyLimit},o={},a=function(t,r){return i({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+r});var n}(n,r),i({},function(t,e,i){var r,n,s,o,a,l;return{timeoutMillis:wc(null!==(r=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==r?r:i.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:i.concurrencyLimit,compression:null!==(a=null!==(l=t.compression)&&void 0!==l?l:e.compression)&&void 0!==a?a:i.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,e((function*(){var t=i({},yield d()),e={};return null!=c&&Object.assign(e,yield c()),null!=h&&Object.assign(e,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[i,r]=t;void 0!==r?e[i]=String(r):dd.warn('Header "'+i+'" has invalid value ('+r+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(l=null!==(u=Tv(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,h,c,d}function Rv(t,e,i,r){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?kv:Sv:xv)(Ev(t,i,r),e)}class Nv extends yc{constructor(t){void 0===t&&(t={}),super(Rv(t,gv,"v1/logs",{"Content-Type":"application/json"}))}}class Mv{set severityText(t){this.Be()||(this.Ze=t)}get severityText(){return this.Ze}set severityNumber(t){this.Be()||(this.De=t)}get severityNumber(){return this.De}set body(t){this.Be()||(this.Pe=t)}get body(){return this.Pe}get eventName(){return this.Ve}set eventName(t){this.Be()||(this.Ve=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,i){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Ze=void 0,this.De=void 0,this.Pe=void 0,this.Ve=void 0,this.totalAttributesCount=0,this.qe=!1,this.je=void 0;var{timestamp:r,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:h}=i,c=Date.now();if(this.hrTime=Ed(null!=r?r:c),this.hrTimeObserved=Ed(null!=n?n:c),h){var d=fd.getSpanContext(h);d&&rd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=t.resource,this.instrumentationScope=e,this.je=t.logRecordLimits,this.Ve=s,this.setAttributes(u)}setAttribute(t,e){return this.Be()||null===e?this:0===t.length?(dd.warn("Invalid attribute key: "+t),this):gd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.je.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,t)?(this.attributes[t]=gd(e)?this.He(e):e,this):(1===this.droppedAttributesCount&&dd.warn("Dropping extra attributes."),this)):(dd.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,i]of Object.entries(t))this.setAttribute(e,i);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Ye(){this.qe=!0}He(t){var e=this.je.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Ge(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Ge(t,e):t)):t:(dd.warn("Attribute value limit must be positive, got "+e),t)}Ge(t,e){return t.length>e?t.substring(0,e):t}Be(){return this.qe&&dd.warn("Can not execute the operation on emitted log record"),this.qe}}class Fv{constructor(t,e){this.instrumentationScope=void 0,this.We=void 0,this.instrumentationScope=t,this.We=e}emit(t){var e=t.context||cd.active(),r=new Mv(this.We,this.instrumentationScope,i({context:e},t));this.We.activeProcessor.onEmit(r,e),r.Ye()}}class Ov{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class Pv{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>Gd(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((i=>i.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class Lv{constructor(t,e,i,r){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=i,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new Pv(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Ov}}class Dv{constructor(t){var e,i,r;void 0===t&&(t={}),this.Ue=void 0,this.We=void 0;var n,s,o,a,l,u,h,c=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];for(var r=e.shift(),n=new WeakMap;e.length>0;)r=$d(r,e.shift(),0,n);return r}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:fv({"service.name":"unknown_service",[_d]:Sd[_d],[Id]:Sd[Id],[Cd]:Sd[Cd]});this.We=new Lv(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(i=null==(r=t)?void 0:r.processors)&&void 0!==i?i:[]),this.Ue=new Jd(this.ze,this)}getLogger(t,e,i){if(this.Ue.isCalled)return dd.warn("A shutdown LoggerProvider cannot provide a Logger"),uc;t||dd.warn("Logger requested without instrumentation scope name.");var r=t||"unknown",n=r+"@"+(e||"")+":"+((null==i?void 0:i.schemaUrl)||"");return this.We.loggers.has(n)||this.We.loggers.set(n,new Fv({name:r,version:e,schemaUrl:null==i?void 0:i.schemaUrl},this.We)),this.We.loggers.get(n)}forceFlush(){return this.Ue.isCalled?(dd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Ue.promise):this.We.activeProcessor.forceFlush()}shutdown(){return this.Ue.isCalled?(dd.warn("shutdown may only be called once per LoggerProvider"),this.Ue.promise):this.Ue.call()}ze(){return this.We.activeProcessor.shutdown()}}class Bv{constructor(t,e){var i,r,n,s,o,a,l,u;this.Xe=void 0,this.Ke=void 0,this.Je=void 0,this.Qe=void 0,this.$e=void 0,this.et=!1,this.tt=[],this.rt=void 0,this.Ue=void 0,this.Xe=t,this.Ke=null!==(i=null!==(r=null==e?void 0:e.maxExportBatchSize)&&void 0!==r?r:void 0)&&void 0!==i?i:512,this.Je=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.Qe=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.$e=null!==(l=null!==(u=null==e?void 0:e.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this.Ue=new Jd(this.ze,this),this.Ke>this.Je&&(dd.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.Ke=this.Je)}onEmit(t){this.Ue.isCalled||this.nt(t)}forceFlush(){return this.Ue.isCalled?this.Ue.promise:this.it()}shutdown(){return this.Ue.call()}ze(){var t=this;return e((function*(){t.onShutdown(),yield t.it(),yield t.Xe.shutdown()}))()}nt(t){this.Je>this.tt.length&&(this.tt.push(t),this.ot())}it(){return new Promise(((t,e)=>{for(var i=[],r=Math.ceil(this.tt.length/this.Ke),n=0;r>n;n++)i.push(this.st());Promise.all(i).then((()=>{t()})).catch(e)}))}st(){return this.ut(),0===this.tt.length?Promise.resolve():new Promise(((t,e)=>{Gd(this.Se(this.tt.splice(0,this.Ke)),this.$e).then((()=>t())).catch(e)}))}ot(){if(!this.et){var t=()=>{this.et=!0,this.st().then((()=>{this.et=!1,this.tt.length>0&&(this.ut(),this.ot())})).catch((t=>{this.et=!1,yd(t)}))};if(this.tt.length>=this.Ke)return t();void 0===this.rt&&(this.rt=setTimeout((()=>t()),this.Qe),"number"!=typeof this.rt&&this.rt.unref())}}ut(){void 0!==this.rt&&(clearTimeout(this.rt),this.rt=void 0)}Se(t){var e=()=>Kd.Se(this.Xe,t).then((t=>{var e;t.code!==bd.SUCCESS&&yd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(yd),i=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===i.length?e():Promise.all(i.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,yd)}}class jv extends Bv{constructor(t,e){super(t,e),this.ct=void 0,this.dt=void 0,this.ht(e)}onShutdown(){"undefined"!=typeof document&&(this.ct&&document.removeEventListener("visibilitychange",this.ct),this.dt&&document.removeEventListener("pagehide",this.dt))}ht(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.ct=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.dt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.ct),document.addEventListener("pagehide",this.dt))}}var qv=1e4,Zv=function(t,e,i,r,n,s){if(void 0===e&&(e=""),void 0===i&&(i={}),void 0===r&&(r=50),void 0===n&&(n=qv),void 0===s&&(s=new WeakSet),s.has(t))return i[e||"circular"]="[Circular]",i;for(var o in s.add(t),t)if({}.hasOwnProperty.call(t,o)){var a=t[o],l=e?e+"."+o:o;if(Ui(a))Zv(a,l,i,r,n,s);else{if(r-=1,n-=String(a).length,n-=l.length,0>=r||0>=n)return void(i.attributes_truncated=!0);i[l]=a}}return i},$v={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,r={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:Un.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);r=i({},r,{"session.id":n,"window.id":s})}mc.setGlobalLoggerProvider(new Dv({resource:fv(r),processors:[new jv(new Nv({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=mc.getLogger("console"),r={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);r={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;Un.console[n]=(s=Un.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,r)=>{if(r instanceof Error)return i({},r,{name:r.name,message:r.message,stack:r.stack});if("object"==typeof r&&!Ki(r)){if(e.has(r))return"[Circular]";e.add(r)}return r}));var e})).join(" ");u.length>qv&&(u=u.slice(0,qv)+"...",r.body_truncated="true"),e.emit({severityText:$v[n],body:u,attributes:i({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":Un.location.href},r,Ui(a[0])?Zv(a[0]):{})}),s.apply(Un.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var Hv=Qn("[Error tracking]");function Vv(){return new vn([new xn,new Ln,new An,new Tn,new On,new Fn,new Rn,new Pn],function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Sn.test(l)?l.replace(Sn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of r){var c=h(u,t);if(c){s.push(c);break}}if(s.length>=kn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,kn).map((t=>{return i({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||fn});var r}))}(s)}}("web:javascript",wn,Cn))}var zv=Qn("[ExceptionAutocapture]"),Yv=Vv(),Uv={wrapOnError(t){var e=Dn;e||zv.info("window not available, cannot wrap onerror");var i=e.onerror;return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];var o=Yv.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return t(o),null!==(e=null==i?void 0:i(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=i}},wrapUnhandledRejection(t){var e=Dn;e||zv.info("window not available, cannot wrap onUnhandledRejection");var i=e.onunhandledrejection;return e.onunhandledrejection=function(r){var n,s=Yv.buildFromUnknown(r,{mechanism:{handled:!1}});return t(s),null!==(n=null==i?void 0:i.apply(e,[r]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=i}},wrapConsoleError(t){var e=console;e||zv.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Yv.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==i?void 0:i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.errorWrappingFunctions=Uv,Un.posthogErrorWrappingFunctions=Uv;var Wv=(t,e,i,r)=>{var n;try{n=new URL(r.url).hostname}catch(t){return}if(!zi(t)||t.includes(n)){if(i){var{sessionId:s,windowId:o}=i.checkAndGetSessionAndWindowId(!0);r.headers.set("X-POSTHOG-SESSION-ID",s),r.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==Ks&&r.headers.set("X-POSTHOG-DISTINCT-ID",e)}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{};var Gv={_patchFetch:(t,i,r)=>gs(Dn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Wv(t,i,r,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,i)=>gs(Dn.XMLHttpRequest.prototype,"open",(r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return Wv(t,e,i,u),r.call(this,n,u.url,o,a,l)}))};Un.__PosthogExtensions__.tracingHeadersPatchFns=Gv,Un.postHogTracingHeadersPatchFns=Gv;var Xv=-1,Jv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Xv=e.timeStamp,t(e))}),!0)},Kv=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Qv=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},tf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ef=()=>{var t,e=tf();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},rf=function(t,e){void 0===e&&(e=-1);var i=tf(),r="navigate";return 0>Xv?i&&(document.prerendering||ef()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},nf=new WeakMap;function sf(t,e){return nf.get(t)||nf.set(t,new e),nf.get(t)}class of{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var af,lf=function(t,e,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(i({type:t,buffered:!0},r)),n}}catch(t){}},uf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},hf=-1,cf=new Set,df=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,vf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of cf)e();isFinite(hf)||(hf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",vf,!0))}},ff=()=>{if(0>hf){var t,e=ef(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;hf=null!=i?i:df(),addEventListener("visibilitychange",vf,!0),addEventListener("prerenderingchange",vf,!0),Jv((()=>{setTimeout((()=>{hf=df()}))}))}return{get firstHiddenTime(){return hf},onHidden(t){cf.add(t)}}},pf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},gf=[1800,3e3],mf=function(t,e){void 0===e&&(e={}),pf((()=>{var i,r=ff(),n=rf("FCP"),s=lf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-ef(),0),n.entries.push(e),i(!0)))}));s&&(i=Kv(t,n,gf,e.reportAllChanges),Jv((r=>{n=rf("FCP"),i=Kv(t,n,gf,e.reportAllChanges),Qv((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},yf=[.1,.25],bf=0,wf=1/0,_f=0,If=t=>{for(var e of t)e.interactionId&&(wf=Math.min(wf,e.interactionId),_f=Math.max(_f,e.interactionId),bf=_f?(_f-wf)/7+1:0)},Cf=()=>{var t;return af?bf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Sf=0;class kf{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Sf=Cf(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Cf()-Sf)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.l.get(t.interactionId);if(r||10>this.u.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.l.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}}var xf=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=uf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Tf=[200,500];class Af{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Ef=[2500,4e3],Rf={onLCP(t,e){void 0===e&&(e={}),pf((()=>{var i,r=ff(),n=rf("LCP"),s=sf(e,Af),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),r.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-ef(),0),n.entries=[o],i())},a=lf("largest-contentful-paint",o);if(a){i=Kv(t,n,Ef,e.reportAllChanges);var l=uf((()=>{o(a.takeRecords()),a.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(xf(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Jv((r=>{n=rf("LCP"),i=Kv(t,n,Ef,e.reportAllChanges),Qv((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var i=ff();mf(uf((()=>{var r,n=rf("CLS",0),s=sf(e,of),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},a=lf("layout-shift",o);a&&(r=Kv(t,n,yf,e.reportAllChanges),i.onHidden((()=>{o(a.takeRecords()),r(!0)})),Jv((()=>{s.i=0,n=rf("CLS",0),r=Kv(t,n,yf,e.reportAllChanges),Qv((()=>r()))})),setTimeout(r))})))},onFCP:mf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=ff();pf((()=>{var r;"interactionCount"in performance||af||(af=lf("event",If,{type:"event",buffered:!0,durationThreshold:0}));var n,s=rf("INP"),o=sf(e,kf),a=t=>{xf((()=>{for(var e of t)o.h(e);var i=o.L();i&&i.P!==s.value&&(s.value=i.P,s.entries=i.entries,n())}))},l=lf("event",a,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Kv(t,s,Tf,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{a(l.takeRecords()),n(!0)})),Jv((()=>{o.v(),s=rf("INP"),n=Kv(t,s,Tf,e.reportAllChanges)})))}))}}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.postHogWebVitalsCallbacks=Rf,Un.postHogWebVitalsCallbacks=Rf,Un.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Rf;class Nf{constructor(t){this.disabled=!1===t;var e=Ui(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,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var Mf="$copy_autocapture",Ff=Qn("[AutoCapture]");function Of(t,e){return e.length>t?e.slice(0,t)+"...":e}function Pf(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!fo(e));return e}function Lf(t,e){for(var r,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,h=[t],c=t;c.parentNode&&!po(c,"body");)mo(c.parentNode)?(h.push(c.parentNode.host),c=c.parentNode.host):(h.push(c.parentNode),c=c.parentNode);var d,v,f=[],p={},g=!1,m=!1;if(es(h,(t=>{var e=No(t);"a"===t.tagName.toLowerCase()&&(g=t.getAttribute("href"),g=e&&g&&jo(g)&&g),ji(wo(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,i,r){var n=t.tagName.toLowerCase(),s={tag_name:n};So.indexOf(n)>-1&&!i&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Of(1024,qo(t)):Of(1024,Io(t)));var o=wo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),es(t.attributes,(function(i){var n;if((!Mo(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&jo(i.value)&&(!Xi(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=yo(o).join(" ")),s["attr__"+i.name]=Of(1024,o)}}));for(var a=1,l=1,u=t;u=Pf(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(t,o,a,l));var i=function(t){if(!No(t))return{};var e={};return es(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&jo(r)&&(e[i]=r)}})),e}(t);is(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text="a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?qo(t):Io(t)),g){var y,b;f[0].attr__href=g;var w=null==(y=cs(g))?void 0:y.host,_=null==Dn||null==(b=Dn.location)?void 0:b.host;w&&_&&w!==_&&(d=g)}return{props:is({$event_type:s.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:(v=f,function(t){var e=t.map((t=>{var e,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=i({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return rs(o).sort(((t,e)=>{var[i]=t,[r]=e;return i.localeCompare(r)})).forEach((t=>{var[e,i]=t;return a[$o(e.toString())]=$o(i.toString())})),(n+=":")+rs(a).map((t=>{var[e,i]=t;return e+'="'+i+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Ho(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return rs(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,i]=t;return r.attributes[e]=i})),r}))}(v)))},null!=(r=f[0])&&r.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var Df={};function Bf(t){return function(t,e){var i=Df[t];if(i)return i;var r,n=e[t];if(Yi(r=n)&&-1!==r.toString().indexOf("[native code]")&&!Dn.Zone)return Df[t]=n.bind(e);var s=e.document;if(s&&Yi(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[t]&&(n=a[t]),s.head.removeChild(o)}catch(e){Kn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&Yi(n)?Df[t]=n.bind(e):n}("MutationObserver",t)}function jf(t,e){return tr(t)&&t>=e}class qf{vt(t){var e,i,r,n,s,o=this.ft((null==t?void 0:t.__onCapture)||this.yt.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.bt=[],this.ft=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.wt=t=>{var e=function(t){var e=Co(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);Ki(e)||this.Ct(e)||this.bt.push(e),this.bt.length&&Gi(this.It)&&(this.It=Un.setTimeout((()=>{this.St()}),1e3))},this.kt=()=>{var t=Date.now();t%50==0&&this.bt.forEach((e=>{Gi(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.xt=()=>{this.At=Date.now()},this.Tt=()=>{"visible"===(null==qn?void 0:qn.visibilityState)&&(this.Nt=Date.now())},this.instance=t,this.Rt=this.vt(e),this._onCapture=this.Rt.__onCapture}start(t){this.Mt(),this._t(),this.Et(),this.Ot(),this.Ft(t)}Ft(t){if(!this.Lt){var e=Bf(Un);this.Lt=new e((t=>{this.Bt(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,Un.removeEventListener("click",this.wt),Un.removeEventListener("scroll",this.kt,{capture:!0}),Un.removeEventListener("selectionchange",this.xt),null==qn||qn.removeEventListener("visibilitychange",this.Tt)}Bt(t){this.Zt=Date.now()}Mt(){us(Un,"click",this.wt)}_t(){us(Un,"scroll",this.kt,{capture:!0})}Et(){us(Un,"selectionchange",this.xt)}Ot(){us(qn,"visibilitychange",this.Tt)}Ct(t){if(!t)return!0;if(!this.Rt.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(vo(t.node))return!0;var i=this.bt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!!i||!(!po(t.node,"html")&&fo(t.node)&&!So.includes(t.node.tagName.toLowerCase()))}St(){if(this.bt.length){clearTimeout(this.It),this.It=void 0;var t=this.bt;for(var e of(this.bt=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Zt&&this.Zt>=e.timestamp?this.Zt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.At&&this.At>=e.timestamp?this.At-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Nt?Math.abs(e.timestamp-this.Nt):void 0;var r=jf(e.scrollDelayMs,this.Rt.scroll_threshold_ms),n=jf(e.selectionChangedDelayMs,this.Rt.selection_change_threshold_ms),s=jf(e.mutationDelayMs,this.Rt.mutation_threshold_ms),o=jf(e.absoluteDelayMs,1.1*this.Rt.mutation_threshold_ms),a=tr(e.scrollDelayMs)&&this.Rt.scroll_threshold_ms>e.scrollDelayMs,l=tr(e.mutationDelayMs)&&this.Rt.mutation_threshold_ms>e.mutationDelayMs,u=tr(e.selectionChangedDelayMs)&&this.Rt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=tr(e.visibilityChangedDelayMs)&&this.Rt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var c=jf(e.visibilityChangedDelayMs,this.Rt.selection_change_threshold_ms);r||s||o||n||c?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Zt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.Rt.mutation_threshold_ms>e.absoluteDelayMs&&this.bt.push(e)}}this.bt.length&&Gi(this.It)&&(this.It=Un.setTimeout((()=>{this.St()}),1e3))}}yt(t,e){this.instance.capture("$dead_click",i({},e,Lf(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.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,$dead_click_visibility_changed_delay_ms:t.visibilityChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new qf(t,e);var Zf=Qn("[ExternalScriptsLoader]"),$f=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Zf.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==qn?void 0:qn.querySelectorAll("script");if(r)for(var n,s=function(){if(r[o].src===e){var t=r[o];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},o=0;r.length>o;o++)if(n=s())return n.v;var a=()=>{if(!qn)return i("document not found");var r=qn.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)qn.head.appendChild(r);else{var n,s=qn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):qn.body.appendChild(r)}};null!=qn&&qn.body?a():null==qn||qn.addEventListener("DOMContentLoaded",a)};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{var r="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(r="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",r);$f(t,s,i)},Un.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);$f(t,r,i)};var Hf="",Vf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var zf={Yt:()=>!!qn,Ut(t){Kn.error("cookieStore error: "+t)},Wt(t){if(qn){try{for(var e=t+"=",i=qn.cookie.split(";").filter((t=>t.length)),r=0;i.length>r;r++){for(var n=i[r];" "==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}},Gt(t){var e;try{e=JSON.parse(zf.Wt(t))||{}}catch(t){}return e},Xt(t,e,i,r,n){if(qn)try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=qn),Hf)return Hf;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Wl();!Hf&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Hf=s)}return Hf}(t);if(!i){var r=(t=>{var e=t.match(Vf);return e?e[0]:""})(t);r!==i&&Kn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(qn.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Kn.warn("cookieStore warning: large cookie, len="+u.length),qn.cookie=u,u}catch(t){return}},Jt(t,e){if(null!=qn&&qn.cookie)try{zf.Xt(t,"",-1,e)}catch(t){return}}},Yf=null,Uf={Yt(){if(!Ki(Yf))return Yf;var t=!0;if(Gi(Dn))t=!1;else try{var e="__mplssupport__";Uf.Xt(e,"xyz"),'"xyz"'!==Uf.Wt(e)&&(t=!1),Uf.Jt(e)}catch(e){t=!1}return t||Kn.error("localStorage unsupported; falling back to cookie store"),Yf=t,t},Ut(t){Kn.error("localStorage error: "+t)},Wt(t){try{return null==Dn?void 0:Dn.localStorage.getItem(t)}catch(t){Uf.Ut(t)}return null},Gt(t){try{return JSON.parse(Uf.Wt(t))||{}}catch(t){}return null},Xt(t,e){try{null==Dn||Dn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Uf.Ut(t)}},Jt(t){try{null==Dn||Dn.localStorage.removeItem(t)}catch(t){Uf.Ut(t)}}},Wf=[bs,"distinct_id",Ms,Fs,Xs,Gs,Vs],Gf={},Xf={Yt:()=>!0,Ut(t){Kn.error("memoryStorage error: "+t)},Wt:t=>Gf[t]||null,Gt:t=>Gf[t]||null,Xt(t,e){Gf[t]=e},Jt(t){delete Gf[t]}},Jf=null,Kf={Yt(){if(!Ki(Jf))return Jf;if(Jf=!0,Gi(Dn))Jf=!1;else try{var t="__support__";Kf.Xt(t,"xyz"),'"xyz"'!==Kf.Wt(t)&&(Jf=!1),Kf.Jt(t)}catch(t){Jf=!1}return Jf},Ut(t){Kn.error("sessionStorage error: ",t)},Wt(t){try{return null==Dn?void 0:Dn.sessionStorage.getItem(t)}catch(t){Kf.Ut(t)}return null},Gt(t){try{return JSON.parse(Kf.Wt(t))||null}catch(t){}return null},Xt(t,e){try{null==Dn||Dn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Kf.Ut(t)}},Jt(t){try{null==Dn||Dn.sessionStorage.removeItem(t)}catch(t){Kf.Ut(t)}}};class Qf{constructor(t){this._instance=t}get Rt(){return this._instance.config}get consent(){return this.Kt()?0:this.Qt}isOptedOut(){return this.Rt.cookieless_mode===io||0===this.consent||-1===this.consent&&(this.Rt.opt_out_capturing_by_default||this.Rt.cookieless_mode===eo)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}optInOut(t){this.ti.Xt(this.ei,t?1:0,this.Rt.cookie_expiration,this.Rt.cross_subdomain_cookie,this.Rt.secure_cookie)}reset(){this.ti.Jt(this.ei,this.Rt.cross_subdomain_cookie)}get ei(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get Qt(){var t=this.ti.Wt(this.ei);return lr(t)?1:ji(ur,t)?0:-1}get ti(){var t=this.Rt.opt_out_capturing_persistence_type,e="localStorage"===t?Uf:zf;if(!this.ii||this.ii!==e){this.ii=e;var i="localStorage"===t?zf:Uf;i.Wt(this.ei)&&(this.ii.Wt(this.ei)||this.optInOut(lr(i.Wt(this.ei))),i.Jt(this.ei,this.Rt.cross_subdomain_cookie))}return this.ii}Kt(){return!!this.Rt.respect_dnt&&[null==jn?void 0:jn.doNotTrack,null==jn?void 0:jn.msDoNotTrack,Un.doNotTrack].some((t=>lr(t)))}}var tp=Qn("[Dead Clicks]"),ep=()=>!0,ip=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(As)),r=t.instance.config.capture_dead_clicks;return ir(r)?r:!!Ui(r)||i};class rp{get lazyLoadedDeadClicksAutocapture(){return this.ri}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[As]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ni((()=>{this.si()})):this.stop()}ni(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?tp.error("failed to load script",e):t()}))}si(){var t;if(qn){if(!this.ri&&null!=(t=Un.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ui(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ri=Un.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ri.start(qn),tp.info("starting...")}}else tp.error("`document` not found. Cannot start.")}stop(){this.ri&&(this.ri.stop(),this.ri=void 0,tp.info("stopping..."))}}var np=Qn("[SegmentIntegration]");var sp="posthog-js";function op(t,e){var{organization:r,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if("*"!==o&&!o.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,p=(null==(l=e.exception)?void 0:l.values)||[],g=p.map((t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>i({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||e.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),a&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class ap{constructor(t,e,i,r,n,s){this.name=sp,this.setupOnce=function(o){o(op(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class lp{constructor(t){this.oi=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(Kn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ai=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.li()}li(){var t;this.ui=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.oi)}destroy(){var t;null==(t=this.ui)||t.call(this),this.ui=void 0}doPageView(t,e){var i,r=this.hi(t,e);return this.ai={pathname:null!==(i=null==Dn?void 0:Dn.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.hi(t,null==(e=this.ai)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ai)?void 0:t.pageViewId}}hi(t,e){var i=this.ai;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(Gi(s)||Gi(o)||Gi(a)||Gi(l)||Gi(u)||Gi(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=s>1?hr(o/s,0,1,Kn):1,d=s>1?hr(a/s,0,1,Kn):1,v=l>1?hr(u/l,0,1,Kn):1,f=l>1?hr(h/l,0,1,Kn):1;r=is(r,{$prev_pageview_last_scroll:o,$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 i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var up="https?://(.*)",hp=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hp],dp="<masked>",vp=["li_fat_id"];function fp(t,e,i){if(!qn)return{};var r,n=e?[...hp,...i||[]]:[],s=pp(fs(qn.URL,n,dp),t),o=(r={},es(vp,(function(t){var e=zf.Wt(t);r[t]=e||null})),r);return is(o,s)}function pp(t,e){var i=cp.concat(e||[]),r={};return es(i,(function(e){var i=vs(t,e);r[e]=i||null})),r}function gp(t){var e=function(t){return t?0===t.search(up+"google.([^/?]*)")?"google":0===t.search(up+"bing.com")?"bing":0===t.search(up+"yahoo.com")?"yahoo":0===t.search(up+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Ki(e)){r.$search_engine=e;var n=qn?vs(qn.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function mp(){return navigator.language||navigator.userLanguage}var yp="$direct";function bp(){return(null==qn?void 0:qn.referrer)||yp}function wp(t,e){var i=t?[...hp,...e||[]]:[],r=null==Zn?void 0:Zn.href.substring(0,1e3);return{r:bp().substring(0,1e3),u:r?fs(r,i,dp):void 0}}function _p(t){var e,{r:i,u:r}=t,n={$referrer:i,$referring_domain:null==i?void 0:i==yp?yp:null==(e=cs(i))?void 0:e.host};if(r){n.$current_url=r;var s=cs(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=pp(r);is(n,o)}if(i){var a=gp(i);is(n,a)}return n}function Ip(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Cp(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Sp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class kp{constructor(t,e){this.Rt=t,this.props={},this.ci=!1,this.di=(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.ti=this.vi(t),this.load(),t.debug&&Kn.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.fi}vi(t){-1===Sp.indexOf(t.persistence.toLowerCase())&&(Kn.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=[...Wf,...t];return i({},Uf,{Gt(t){try{var e={};try{e=zf.Gt(t)||{}}catch(t){}var i=is(e,JSON.parse(Uf.Wt(t)||"{}"));return Uf.Xt(t,i),i}catch(t){}return null},Xt(t,i,r,n,s,o){try{Uf.Xt(t,i,void 0,void 0,o);var a={};e.forEach((t=>{i[t]&&(a[t]=i[t])})),Object.keys(a).length&&zf.Xt(t,a,r,n,s,o)}catch(t){Uf.Ut(t)}},Jt(t,e){try{null==Dn||Dn.localStorage.removeItem(t),zf.Jt(t,e)}catch(t){Uf.Ut(t)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return"localstorage"===r&&Uf.Yt()?Uf:"localstorage+cookie"===r&&e.Yt()?e:"sessionstorage"===r&&Kf.Yt()?Kf:"memory"===r?Xf:"cookie"===r?zf:e.Yt()?e:zf}pi(t){var e=null!=t?t:this.Rt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[Hs];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return es(this.props,((e,i)=>{if(i===Os&&Ui(e)){if(!this.pi())for(var r=Object.keys(e),n=0;r.length>n;n++)t["$feature/"+r[n]]=e[r[n]]}else-1===Qs.indexOf(i)&&(t[i]=e)})),t}load(){if(!this.fi){var t=this.ti.Gt(this.di);t&&(this.props=is({},t))}}save(){this.fi||this.ti.Xt(this.di,this.props,this.gi,this.mi,this.yi,this.Rt.debug)}remove(){this.ti.Jt(this.di,!1),this.ti.Jt(this.di,!0)}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ui(t)){Gi(e)&&(e="None"),this.gi=Gi(i)?this.bi:i;var r=!1;if(es(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Ui(t)){this.gi=Gi(e)?this.bi:e;var i=!1;if(es(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ci){var t=fp(this.Rt.custom_campaign_params,this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties);Wi(os(t))||this.register(t),this.ci=!0}}update_search_keyword(){var t;this.register((t=null==qn?void 0:qn.referrer)?gp(t):{})}update_referrer_info(){var t;this.register_once({$referrer:bp(),$referring_domain:null!=qn&&qn.referrer&&(null==(t=cs(qn.referrer))?void 0:t.host)||yp},void 0)}set_initial_person_info(){this.props[Us]||this.props[Ws]||this.register_once({[Gs]:wp(this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};es([Ws,Us],(e=>{var i=this.props[e];i&&es(i,(function(e,i){t["$initial_"+Zi(i)]=e}))}));var e,i,r=this.props[Gs];if(r){var n=(e=_p(r),i={},es(e,(function(t,e){i["$initial_"+Zi(e)]=t})),i);is(t,n)}return t}safe_merge(t){return es(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){if(this.bi=this.gi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),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 i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var r=this.vi(t),n=this.props;this.clear(),this.ti=r,this.props=n,this.save()}}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.mi&&(this.mi=t,this.remove(),this.save())}set_secure(t){t!==this.yi&&(this.yi=t,this.remove(),this.save())}set_event_timer(t,e){var i=this.props[_s]||{};i[t]=e,this.props[_s]=i,this.save()}remove_event_timer(t){var e=(this.props[_s]||{})[t];return Gi(e)||(delete this.props[_s][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var xp=Qn("[RateLimiter]");class Tp{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{xp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void xp.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Ys))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ys,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Ap=Qn("[RemoteConfig]");class Ep{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Un._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}wi(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Ii(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 Ap.info("Using preloaded remote config",this.remoteConfig),this.Ci(this.remoteConfig),void this.Si();if(this._instance.ki())return void Ap.warn("Remote config is disabled. Falling back to local config.");this.wi((t=>{if(!t)return Ap.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ii((t=>{this.Ci(t),this.Si()}));this.Ci(t),this.Si()}))}catch(t){Ap.error("Error loading remote config",t)}}stop(){this.xi&&(clearInterval(this.xi),this.xi=void 0)}refresh(){this._instance.ki()||"hidden"===(null==qn?void 0:qn.visibilityState)||this._instance.reloadFeatureFlags()}Si(){var t;if(!this.xi){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.xi=setInterval((()=>{this.refresh()}),e))}}Ci(t){var e;t||Ap.error("Failed to fetch remote config from PostHog."),this._instance.Ci(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var Rp=3e3;class Np{constructor(t,e){this.Ti=!0,this.Ai=[],this.Ei=hr((null==e?void 0:e.flush_interval_ms)||Rp,250,5e3,Kn.createLogger("flush interval"),Rp),this.Ri=t}enqueue(t){this.Ai.push(t),this.Ni||this.Mi()}unload(){this.Fi();var t=this.Ai.length>0?this.Oi():{},e=Object.values(t),r=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];r.map((t=>{this.Ri(i({},t,{transport:"sendBeacon"}))}))}enable(){this.Ti=!1,this.Mi()}Mi(){var t=this;this.Ti||(this.Ni=setTimeout((()=>{if(this.Fi(),this.Ai.length>0){var e=this.Oi(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&zi(i.data)&&es(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Ri(i)};for(var r in e)i()}}),this.Ei))}Fi(){clearTimeout(this.Ni),this.Ni=void 0}Oi(){var t={};return es(this.Ai,(e=>{var r,n=e,s=(n?n.batchKey:null)||n.url;Gi(t[s])&&(t[s]=i({},n,{data:[]})),null==(r=t[s].data)||r.push(n.data)})),this.Ai=[],t}}var Mp=["retriesPerformedSoFar"];class Fp{constructor(t){this.Pi=!1,this.Li=3e3,this.Ai=[],this._instance=t,this.Ai=[],this.Di=!0,!Gi(Dn)&&"onLine"in Dn.navigator&&(this.Di=Dn.navigator.onLine,this.Bi=()=>{this.Di=!0,this.ji()},this.qi=()=>{this.Di=!1},us(Dn,"online",this.Bi),us(Dn,"offline",this.qi))}get length(){return this.Ai.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=r(t,Mp);er(e)&&(n.url=Mu(n.url,{retry_count:e})),this._instance._send_request(i({},n,{callback:t=>{200===t.statusCode||t.statusCode>=400&&500>t.statusCode||(null!=e?e:0)>=10?null==n.callback||n.callback(t):this.Zi(i({retriesPerformedSoFar:e},n))}}))}Zi(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.Ai.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Kn.warn(n),this.Pi||(this.Pi=!0,this.$i())}$i(){if(this.Hi&&clearTimeout(this.Hi),0===this.Ai.length)return this.Pi=!1,void(this.Hi=void 0);this.Hi=setTimeout((()=>{this.Di&&this.Ai.length>0&&this.ji(),this.$i()}),this.Li)}ji(){var t=Date.now(),e=[],i=this.Ai.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Ai=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.Hi&&(clearTimeout(this.Hi),this.Hi=void 0),this.Pi=!1,Gi(Dn)||(this.Bi&&(Dn.removeEventListener("online",this.Bi),this.Bi=void 0),this.qi&&(Dn.removeEventListener("offline",this.qi),this.qi=void 0)),this.Ai))try{this._instance._send_request(i({},t,{transport:"sendBeacon"}))}catch(t){Kn.error(t)}this.Ai=[]}}class Op{constructor(t){this.Vi=()=>{var t,e,i,r;this.zi||(this.zi={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.zi.lastScrollY=Math.ceil(s),this.zi.maxScrollY=Math.max(s,null!==(t=this.zi.maxScrollY)&&void 0!==t?t:0),this.zi.maxScrollHeight=Math.max(o,null!==(e=this.zi.maxScrollHeight)&&void 0!==e?e:0),this.zi.lastContentY=a,this.zi.maxContentY=Math.max(a,null!==(i=this.zi.maxContentY)&&void 0!==i?i:0),this.zi.maxContentHeight=Math.max(l,null!==(r=this.zi.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Yi(){return this._instance.config.scroll_root_selector}getContext(){return this.zi}resetContext(){var t=this.zi;return setTimeout(this.Vi,0),t}startMeasuringScrollPosition(){us(Dn,"scroll",this.Vi,{capture:!0}),us(Dn,"scrollend",this.Vi,{capture:!0}),us(Dn,"resize",this.Vi)}scrollElement(){if(!this.Yi)return null==Dn?void 0:Dn.document.documentElement;var t=zi(this.Yi)?this.Yi:[this.Yi];for(var e of t){var i=null==Dn?void 0:Dn.document.querySelector(e);if(i)return i}}scrollY(){if(this.Yi){var t=this.scrollElement();return t&&t.scrollTop||0}return Dn&&(Dn.scrollY||Dn.pageYOffset||Dn.document.documentElement.scrollTop)||0}scrollX(){if(this.Yi){var t=this.scrollElement();return t&&t.scrollLeft||0}return Dn&&(Dn.scrollX||Dn.pageXOffset||Dn.document.documentElement.scrollLeft)||0}}var Pp=t=>wp(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Lp{constructor(t,e,i,r){this.Ui=t=>{var e=this.Wi();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Gi(this._instance)};this.Xi.register({[zs]:i})}},this._instance=t,this.Ji=e,this.Xi=i,this.Gi=r||Pp,this.Ji.onSessionId(this.Ui)}Wi(){return this.Xi.props[zs]}getSetOnceProps(){var t,e=null==(t=this.Wi())?void 0:t.props;return e?"r"in e?_p(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 es(os(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+Zi(i)]=e})),t}}class Dp{constructor(){this.Ki={}}on(t,e){return this.Ki[t]||(this.Ki[t]=[]),this.Ki[t].push(e),()=>{this.Ki[t]=this.Ki[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Ki[t]||[])i(e);for(var r of this.Ki["*"]||[])r(t,e)}}var Bp=Qn("[SessionId]");class jp{on(t,e){return this.Qi.on(t,e)}constructor(t,e,i){var r;if(this.tr=[],this.er=void 0,this.Qi=new Dp,this.ir=(t,e)=>!(!er(t)||!er(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===io)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rt=t.config,this.Xi=t.persistence,this.rr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.sr=e||Wl,this.ar=i||Wl;var n=this.Rt.persistence_name||this.Rt.token;if(this._sessionTimeoutMs=1e3*hr(this.Rt.session_idle_timeout_seconds||1800,60,36e3,Bp.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+n+"_window_id",this.hr="ph_"+n+"_primary_window_exists",this.cr()){var s=Kf.Gt(this.ur),o=Kf.Gt(this.hr);s&&!o?this.rr=s:Kf.Jt(this.ur),Kf.Xt(this.hr,!0)}if(null!=(r=this.Rt.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Rt.bootstrap.sessionID.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.dr(this.Rt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){Bp.error("Invalid sessionID in bootstrap",t)}this.vr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Gi(this.tr)&&(this.tr=[]),this.tr.push(t),this.nr&&t(this.nr,this.rr),()=>{this.tr=this.tr.filter((e=>e!==t))}}cr(){return"memory"!==this.Rt.persistence&&!this.Xi.fi&&Kf.Yt()}pr(t){t!==this.rr&&(this.rr=t,this.cr()&&Kf.Xt(this.ur,t))}gr(){return this.rr?this.rr:this.cr()?Kf.Gt(this.ur):null}dr(t,e,i){t===this.nr&&e===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.nr=t,this.Xi.register({[Ms]:[e,t,i]}))}mr(){var t=this.Xi.props[Ms];return zi(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.dr(null,null,null)}destroy(){clearTimeout(this.yr),this.yr=void 0,this.er&&Dn&&(Dn.removeEventListener(ao,this.er,{capture:!1}),this.er=void 0),this.tr=[]}vr(){this.er=()=>{this.cr()&&Kf.Jt(this.hr)},us(Dn,ao,this.er,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Rt.cookieless_mode===io)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[r,n,s]=this.mr(),o=this.gr(),a=er(s)&&Math.abs(i-s)>864e5,l=!1,u=!n,h=!u&&!t&&this.ir(i,r);u||h||a?(n=this.sr(),o=this.ar(),Bp.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=i,l=!0):o||(o=this.ar(),l=!0);var c=er(r)&&t&&!a?r:i,d=er(s)?s:(new Date).getTime();return this.pr(o),this.dr(n,c,d),t||this.lr(),l&&this.tr.forEach((t=>t(n,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}lr(){clearTimeout(this.yr),this.yr=setTimeout((()=>{var[t]=this.mr();if(this.ir((new Date).getTime(),t)){var e=this.nr;this.resetSessionId(),this.Qi.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var qp=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Bi(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>Bi(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Zp="custom",$p="i.posthog.com";class Hp{constructor(t){this.br={},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("."+$p,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.br[this.apiHost]||(this.br[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Zp),this.br[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===Zp)return this.apiHost+e;var i=$p+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Vp=Qn("[PostHog ExternalIntegrations]"),zp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Yp{constructor(t){this._instance=t}ni(t,e){var i;null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Vp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,n,s;!r||null!=(i=Un.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.ni(zp[e],(()=>{var i;null==(i=Un.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(n=Un.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=Un.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[i,r]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(i)}}}var Up={},Wp=0,Gp=()=>{},Xp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Jp="Surveys module not available",Kp="sanitize_properties is deprecated. Use before_send instead",Qp="Invalid value for property_denylist config: ",tg="posthog",eg=!Ru&&-1===(null==Yn?void 0:Yn.indexOf("MSIE"))&&-1===(null==Yn?void 0:Yn.indexOf("Mozilla")),ig=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ls(null==qn?void 0:qn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Gp,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:Zn&&Xi(null==Zn?void 0:Zn.search)&&-1!==Zn.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:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Dn||null==(e=Dn.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_feature_flags_dedup_per_session:!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){Kn.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:so,before_send:void 0,request_queue_config:{flush_interval_ms:Rp},error_tracking:{},_onCapture:Gp,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},rg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],ng=t=>{var e={};for(var[i,r]of rg)Gi(t[i])||(e[r]=t[i]);var n=is({},e,t);return zi(t.property_blacklist)&&(Gi(t.property_denylist)?n.property_denylist=t.property_blacklist:zi(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Kn.error(Qp+t.property_denylist)),n};class sg{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(t){Kn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class og{_r(t,e){if(t){var i=this.Ir.indexOf(t);-1!==i&&this.Ir.splice(i,1)}return this.Ir.push(e),null==e.initialize||e.initialize(),e}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(){var t;this.webPerformance=new sg,this.Cr=!1,this.version=Xn.LIB_VERSION,this.Sr=new Dp,this.Ir=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ig(),this.SentryIntegration=ap,this.sentryIntegration=t=>function(t,e){var i=op(t,e);return{name:sp,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.kr=!1,this.Tr=null,this.Ar=null,this.Er=null,this.scrollManager=new Op(this),this.pageViewManager=new lp(this),this.rateLimiter=new Tp(this),this.requestRouter=new Hp(this),this.consent=new Qf(this),this.externalIntegrations=new Yp(this);var e=null!==(t=og.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Xi(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Xi(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Kn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==tg){var r,n=null!==(r=Up[i])&&void 0!==r?r:new og;return n._init(t,e,i),Up[i]=n,Up[tg][i]=n,n}return this._init(t,e,i)}_init(t,e,r){var n,s;if(void 0===e&&(e={}),Gi(t)||Ji(t))return Kn.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.Rr(e.debug),this.Nr=e,this.Mr=[],e.person_profiles?this.Ar=e.person_profiles:e.process_person&&(this.Ar=e.process_person),this.set_config(is({},ig(e.defaults),ng(e),{name:r,token:t})),this.config.on_xhr_error&&Kn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Xl;var o=this.Fr();this.persistence=new kp(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new kp(i({},this.config,{persistence:"sessionStorage"}),o);var a=i({},this.persistence.props),l=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Or=new Np((t=>this.Pr(t)),this.config.request_queue_config),this.Lr=new Fp(this),this.__request_queue=[];var u=this.config.cookieless_mode===io||this.config.cookieless_mode===eo&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new jp(this),this.sessionPropsManager=new Lp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Kn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(u)}),0)):(Kn.info("Initializing extensions synchronously"),this.Dr(u)),Xn.DEBUG=Xn.DEBUG||this.config.debug,Xn.DEBUG&&Kn.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=i({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var h=e.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(Vs);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===ro)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===no)Kn.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Wl()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Vs,e.bootstrap.isIdentifiedID?no:ro),this.register({distinct_id:h,$device_id:f})}}if(u)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Wl());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Vs,ro)}return us(Dn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||Wl();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Vs,no)),e()},n=i.user();"then"in n&&Yi(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||np.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(np.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(np.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,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,lo),identify:t=>e(t,ho),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Br())):this.Br(),Yi(this.config._onCapture)&&this.config._onCapture!==Gp&&(Kn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Kn.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}Dr(t){var e,r,n,s,o,a,l,u=performance.now(),h=i({},og.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ir.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.Ir.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new h.exceptions(this)),h.historyAutocapture&&this.Ir.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ir.push(new h.tracingHeaders(this)),h.siteApps&&this.Ir.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.Ir.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Ir.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ir.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Ir.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Ir.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Ir.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ir.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ir.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ir.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ir.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,ip)),h.toolbar&&this.Ir.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Ir.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Ir.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.jr){var t=this.jr;this.jr=void 0,this.Ci(t)}})),this.qr(c,u)}qr(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.qr(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Kn.error("Error initializing extension:",t)}}var r=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:r}),this.config.__preview_deferred_init_extensions&&Kn.info("PostHog extensions initialized ("+r+"ms)")}Ci(t){var e;if(!qn||!qn.body)return Kn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.jr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ji(t.supportedCompression,Xl)?Xl:ji(t.supportedCompression,Jl)?Jl:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ar?this.Ar:so}),this.Ir.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Br(){try{this.config.loaded(this)}catch(t){Kn.critical("`loaded` function failed",t)}if(this.Zr(),this.config.internal_or_test_user_hostname&&null!=Zn&&Zn.hostname){var t=Zn.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===io)&&this.$r()}),1),this.Hr=new Ep(this),this.Hr.load()}Zr(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Or)||t.enable())}_dom_loaded(){this.is_capturing()&&ts(this.__request_queue,(t=>this.Pr(t))),this.__request_queue=[],this.Zr()}_handle_unload(){var t,e,i;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Vr()&&this.capture(uo),null==(e=this.Or)||e.unload(),null==(i=this.Lr)||i.unload()):this.Vr()&&this.capture(uo,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(eg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Mu(t.url,{ip:this.config.ip?1:0}),t.headers=i({},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,r,n,s=i({},t);s.timeout=s.timeout||6e4,s.url=Mu(s.url,{_:(new Date).getTime().toString(),ver:Xn.JS_SDK_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Lu.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),l=null!==(r=null==(n=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==r?r:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Xl&&zn?Pu(s).then((t=>{l(t)})).catch((()=>{l(s)})):l(s)})(i({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))))}Pr(t){this.Lr?this.Lr.retriableRequest(t):this._send_request(t)}_execute_array(t){Wp++;try{var e,i=[],r=[],n=[];ts(t,(t=>{t&&(zi(e=t[0])?n.push(t):Yi(t)?t.call(this):zi(t)&&"alias"===e?i.push(t):zi(t)&&-1!==e.indexOf("capture")&&Yi(this[e])?n.push(t):r.push(t))}));var s=function(t,e){ts(t,(function(t){if(zi(t[0])){var i=e;es(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}))};s(i,this),s(r,this),s(n,this)}finally{Wp--}}push(t){if(Wp>0&&zi(t)&&Xi(t[0])){var e=og.prototype[t[0]];Yi(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,r){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Or){if(this.is_capturing())if(!Gi(t)&&Xi(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=e&&e.$current_url&&!Xi(null==e?void 0:e.$current_url)&&(Kn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=r&&r.zr||Kn.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 c=new Date,d=(null==r?void 0:r.timestamp)||c,v=Wl(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===lo&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==r?void 0:r.$set)&&(f.$set=null==r?void 0:r.$set);var p=this.Yr(null==r?void 0:r.$set_once,t!==co,t===ho);if(p&&(f.$set_once=p),null!=r&&r._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>Xi(t)?t.slice(0,s):t,l=new Set,f=function t(e,i){return e!==Object(e)?a?a(e):e:l.has(e)?void 0:(l.add(e),zi(e)?(r=[],ts(e,(e=>{r.push(t(e))}))):(r={},es(e,((e,i)=>{l.has(e)||(r[i]=t(e,i))}))),r);var r}(o)),f.timestamp=d,Gi(null==r?void 0:r.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===Al.DISMISSED||t===Al.SENT){var g=null==e?void 0:e[El.SURVEY_ID],m=null==e?void 0:e[El.SURVEY_ITERATION];ql({id:g,current_iteration:m}),f.$set=i({},f.$set,{[Dl({id:g,current_iteration:m},t===Al.SENT?"responded":"dismissed")]:!0})}else t===Al.SHOWN&&(f.$set=i({},f.$set,{[El.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var y=null==e?void 0:e.$product_tour_type;y&&(f.$set=i({},f.$set,{["$product_tour_last_seen_date/"+y]:(new Date).toISOString()}))}var b=i({},f.properties.$set,f.$set);if(Wi(b)||this.setPersonPropertiesForFlags(b),!Qi(this.config.before_send)){var w=this.Ur(f);if(!w)return;f=w}this.Sr.emit("eventCaptured",f);var _={method:"POST",url:null!==(n=null==r?void 0:r._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.Pr(_):this.Or.enqueue(_),f}Kn.critical("This capture call is ignored due to client rate limiting.")}}else Kn.error("No event name provided to posthog.capture")}else Kn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,r,n,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=i({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode==io||this.config.cookieless_mode==eo&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=i({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Xi(a.distinct_id)&&!tr(a.distinct_id)||Ji(a.distinct_id))&&Kn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e){var i,r,n,s;if(!Yn)return{};var o,a=t?[...hp,...e||[]]:[],[l,u]=function(t){for(var e=0;un.length>e;e++){var[i,r]=un[e],n=i.exec(t),s=n&&(Yi(r)?r(n,t):r);if(s)return s}return["",""]}(Yn);return is(os({$os:l,$os_version:u,$browser:on(Yn,navigator.vendor),$device:hn(Yn),$device_type:cn(Yn,{userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(r=navigator)?void 0:r.maxTouchPoints,screenWidth:null==Dn||null==(n=Dn.screen)?void 0:n.width,screenHeight:null==Dn||null==(s=Dn.screen)?void 0:s.height,devicePixelRatio:null==Dn?void 0:Dn.devicePixelRatio}),$timezone:Ip(),$timezone_offset:Cp()}),{$current_url:fs(null==Zn?void 0:Zn.href,a,dp),$host:null==Zn?void 0:Zn.host,$pathname:null==Zn?void 0:Zn.pathname,$raw_user_agent:Yn.length>1e3?Yn.substring(0,997)+"...":Yn,$browser_version:ln(Yn,navigator.vendor),$browser_language:mp(),$browser_language_prefix:(o=mp(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==Dn?void 0:Dn.screen.height,$screen_width:null==Dn?void 0:Dn.screen.width,$viewport_height:null==Dn?void 0:Dn.innerHeight,$viewport_width:null==Dn?void 0:Dn.innerWidth,$lib:Xn.LIB_NAME,$lib_version:Xn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&is(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&is(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Lr)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Zp&&(a.$lib_custom_api_host=this.config.api_host),u=t!==lo||s?t!==uo||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),a=is(a,u),t===lo&&qn&&(a.title=qn.title),!Gi(o)){var f=r.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Yn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=is({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),zi(this.config.property_denylist)?es(this.config.property_denylist,(function(t){delete a[t]})):Kn.error(Qp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Kn.error(Kp),a=p(a,t));var g=this.Wr();return a.$process_person_profile=g,g&&!s&&this.Gr("_calculate_event_properties"),a}Yr(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Wr())return t;if(this.Cr&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=is({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(Kn.error(Kp),o=a(o,"$set_once")),e&&(this.Cr=!0),Wi(o)?void 0:o}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}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)}Xr(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Sr.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Jp}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Jp})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Jp})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=$l),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Jp}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Jp})}Jr(t){return!t||Ji(t)?(Kn.critical("Unique user id has not been set in posthog.identify"),!1):t===Ks?(Kn.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Kn.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.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return Kn.uninitializedWarning("posthog.identify");if(tr(t)&&(t=t.toString(),Kn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jr(t)&&this.Gr("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(bs)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(ws)&&(this.unregister(ws),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Vs)||ro)===ro;t!==r&&s?(this.persistence.set_property(Vs,no),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(ho,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.Er=Bu(t,e,i),null==(n=this.featureFlags)||n.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(qs))}}setPersonProperties(t,e){if((t||e)&&this.Gr("posthog.setPersonProperties")){var i=Bu(this.get_distinct_id(),t,e);this.Er!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Er=i):Kn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,r){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),s||r){var o={$group_type:t,$group_key:e};r&&(o.$group_set=r),this.capture(co,o)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else Kn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Gr("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,i,r,n,s,o,a,l;if(Kn.info("reset"),!this.__loaded)return Kn.uninitializedWarning("posthog.reset");var u=this.get_property(bs);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),null==(r=this.surveys)||r.reset(),null==(n=this.Hr)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Vs,ro),null==(l=this.sessionManager)||l.resetSessionId(),this.Er=null,this.config.cookieless_mode===io)this.register_once({distinct_id:Ks,$device_id:null},"");else{var h=this.config.get_device_id(Wl());this.register_once({distinct_id:h,$device_id:t?h:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Kr()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qr()}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:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(ys)?(Kn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Gr("posthog.alias")?(Gi(e)&&(e=this.get_distinct_id()),t!==e?(this.Xr(ws,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Kn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(Ui(t)){var r,n,s,o,a,l,u,h,c;is(this.config,ng(t));var d=this.Fr();null==(r=this.persistence)||r.update_config(this.config,e,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new kp(i({},this.config,{persistence:"sessionStorage"}),d);var v=this.Rr(this.config.debug);ir(v)&&(this.config.debug=v),ir(this.config.debug)&&(this.config.debug?(Xn.DEBUG=!0,Uf.Yt()&&Uf.Xt("ph_debug",!0),Kn.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(Xn.DEBUG=!1,Uf.Yt()&&Uf.Jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.tn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Xn.LIB_NAME=t,Xn.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.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){if(this.exceptions){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(i({},n,e))}}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}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:tg;return e!==tg&&(e=tg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Vs))===no||(null==(e=this.sessionPersistence)?void 0:e.get_property(Vs))===no}Wr(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===so&&!this._isIdentified()&&Wi(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ws])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Xs]))}Vr(){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.Wr()||this.Gr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Gr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Gr(t){return"never"===this.config.person_profiles?(Kn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Xr(Xs,!0),!0)}Fr(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==eo)}tn(){var t,e,i,r,n=this.Fr();return(null==(t=this.persistence)?void 0:t.fi)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.fi)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==io){if(this.config.cookieless_mode===eo&&this.consent.isExplicitlyOptedOut()){var i,r,n,s,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new jp(this),this.pageViewManager=new lp(this),this.persistence&&(this.sessionPropsManager=new Lp(this,this.sessionManager,this.persistence));var a=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=og.__defaultExtensionClasses)?void 0:o.sessionRecording;a&&(this.sessionRecording=this._r(this.sessionRecording,new a(this)))}var l,u;this.consent.optInOut(!0),this.tn(),this.Zr(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==eo&&(null==(l=this.surveys)||l.loadIfEnabled()),(Gi(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(u=null==t?void 0:t.captureEventName)&&void 0!==u?u:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$r()}else Kn.warn(Xp)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==io?(this.config.cookieless_mode===eo&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===eo&&(this.register({distinct_id:Ks,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.$r())):Kn.warn(Xp)}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 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===io||(this.config.cookieless_mode===eo?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return jn?qp(jn,this.config.custom_blocked_useragents):void 0}$r(){qn&&("visible"===qn.visibilityState?this.kr||(this.kr=!0,this.capture(lo,{title:qn.title},{send_instantly:!0}),this.Tr&&(qn.removeEventListener(oo,this.Tr),this.Tr=null)):this.Tr||(this.Tr=this.$r.bind(this),us(qn,oo,this.Tr)))}debug(t){!1===t?(null==Dn||Dn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Dn||Dn.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}))}ki(){var t,e,i,r,n,s,o=this.Nr||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Kn.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):(i="advanced_disable_decide",!1,r=Kn,n=(e="advanced_disable_flags")in(t=o)&&!Qi(t[e]),s=i in t&&!Qi(t[i]),n?t[e]:!!s&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]))}Ur(t){if(Qi(this.config.before_send))return t;var e=zi(this.config.before_send)?this.config.before_send:[this.config.before_send],i=t;for(var r of e){if(i=r(i),Qi(i)){var n="Event '"+t.event+"' was rejected in beforeSend function";return ji(Pi,t.event)?Kn.warn(n+". This can cause unexpected behavior."):Kn.info(n),null}i.properties&&!Wi(i.properties)||Kn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var t;return null==(t=this.pageViewManager.ai)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Rr(t){var e=ir(t)&&!t,i=Uf.Yt()&&"true"===Uf.Wt("ph_debug");return!e&&(!!i||t)}}og.__defaultExtensionClasses={},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=ss(t.prototype[e[i]])}(og,["identify"]);var ag=Qn("[ExceptionAutocapture]"),lg=Qn("[TracingHeaders]"),ug=Qn("[Web Vitals]"),hg=9e5,cg="disabled",dg="lazy_loading",vg="awaiting_config",fg="missing_config";Qn("[SessionRecording]");var pg="[SessionRecording]",gg=Qn(pg),mg=Qn("[Heatmaps]");function yg(t){return Ui(t)&&"clientX"in t&&"clientY"in t&&tr(t.clientX)&&tr(t.clientY)}var bg=Qn("[Product Tours]"),wg="ph_product_tours",_g=["$set_once","$set"],Ig=Qn("[SiteApps]"),Cg="Error while initializing PostHog app with config id ";function Sg(t,e,i){if(Qi(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class kg{constructor(t){this.en=new Dp,this.rn=(t,e)=>this.nn(t,e)&&this.sn(t,e)&&this.an(t,e)&&this.ln(t,e),this.nn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.un=new Set,this.hn=new Set}init(){var t,e;Gi(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,i;if(!Gi(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,i;null==(e=this.hn)||e.add(t),null==(i=t.steps)||i.forEach((t=>{var e;null==(e=this.un)||e.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r,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==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(t,e){var i;null!=e&&0!=t.length&&(this.un.has(t)||this.un.has(null==e?void 0:e.event))&&this.hn&&(null==(i=this.hn)?void 0:i.size)>0&&this.hn.forEach((t=>{this.cn(e,t)&&this.en.emit("actionCaptured",t.name)}))}dn(t){this.onAction("actionCaptured",(e=>t(e)))}cn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.rn(t,i))return!0;return!1}onAction(t,e){return this.en.on(t,e)}sn(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Sg(r,e.url,e.url_matching||"contains"))return!1}return!0}an(t,e){return!!this.vn(t,e)&&!!this.fn(t,e)&&!!this.pn(t,e)}vn(t,e){var i;if(null==e||!e.href)return!0;var r=this.gn(t);if(r.length>0)return r.some((t=>Sg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Sg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}fn(t,e){var i;if(null==e||!e.text)return!0;var r=this.gn(t);if(r.length>0)return r.some((t=>Sg(t.text,e.text,e.text_matching||"exact")||Sg(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Qi(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Sg(t,s,o))))}pn(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}gn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ln(t,e){return null==e||!e.properties||0===e.properties.length||Zu(e.properties.reduce(((t,e)=>{var i=zi(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class xg{constructor(t){this._instance=t,this.mn=new Map,this.yn=new Map,this.bn=new Map}wn(t,e){return!!t&&Zu(t.propertyFilters,null==e?void 0:e.properties)}_n(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}In(t,e,i){var r=(i===bl?this.mn:this.yn).get(t),n=[];return this.Cn((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.wn(s,e)}))}register(t){var e;Gi(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Sn(t),this.kn(t))}kn(t){var e=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));0!==e.length&&(null==this.xn&&(this.xn=new kg(this._instance),this.xn.init(),this.xn.dn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,i,r,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(i=t.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.xn)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var i=this.bn.get(e.name);i&&i.push(t.id),this.bn.set(e.name,i||[t.id])}})))})))}Sn(t){var e,i=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),r=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}));0===i.length&&0===r.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.mn=this._n(t,bl),this.yn=this._n(t,wl))}onEvent(t,e){var i,r=this.re(),n=this.Tn(),s=this.An(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[n])||[];if(s===t&&e&&o.length>0){var a,l;r.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});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=o.indexOf(u);0>h||(o.splice(h,1),this.En(o))}}else{if(this.yn.has(t)){var c=this.In(t,e,wl);c.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);0>e||o.splice(e,1),this.Rn(t.id)})),this.En(o))}if(this.mn.has(t)){r.info("event name matched",{event:t,eventPayload:e,items:this.mn.get(t)});var d=this.In(t,e,bl);this.En(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,i=this.Tn(),r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[i])||[];this.bn.has(t)&&this.En(r.concat(this.bn.get(t)||[]))}En(t){var e,i=this.re(),r=this.Tn(),n=[...new Set(t)].filter((t=>!this.Nn(t)));i.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[r]:n})}getActivatedIds(){var t,e=this.Tn();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.mn}Mn(){return this.xn}}class Tg extends xg{constructor(t){super(t)}Tn(){return"$surveys_activated"}An(){return Al.SHOWN}Cn(t){var e;null==(e=this._instance)||e.getSurveys(t)}Rn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}re(){return Nl}Nn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Ag="SDK is not enabled or survey functionality is not yet loaded",Eg="Disabled. Not loading surveys.",Rg=null!=Dn&&Dn.location?ps(Dn.location.hash,"__posthog")||ps(location.hash,"state"):null,Ng="_postHogToolbarParams",Mg=Qn("[Toolbar]"),Fg=Qn("[FeatureFlags]"),Og=Qn("[FeatureFlags]",{debugEnabled:!0}),Pg="\" failed. Feature flags didn't load in time.",Lg="$active_feature_flags",Dg="$override_feature_flags",Bg="$feature_flag_payloads",jg="$override_feature_flag_payloads",qg="$feature_flag_request_id",Zg=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},$g=t=>{var e={};for(var[i,r]of rs(t||{}))r&&(e[i]=r);return e},Hg="Refusing to render web experiment since the viewer is a likely bot",Vg={icontains:(t,e)=>!!Dn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Dn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Dn&&Du(e.href,t),not_regex:(t,e)=>!!Dn&&!Du(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class zg{get Rt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{zg.Fn("retrieved web experiments from the server"),e.On=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.On&&(zg.Fn("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.On)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Xi(r)&&t.variants[r]&&e.Pn(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];zg.Ln(s)&&e.Pn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())zg.Fn(Hg);else if(!this.Rt.disable_web_experiments){if(Qi(this.On))return this.On=new Map,this.loadIfEnabled(),void this.previewWebExperiment();zg.Fn("applying feature flags",t),t.forEach((t=>{var e;if(this.On&&null!=(e=this.On)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.On)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Pn(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=zg.getWindowLocation();if(null!=t&&t.search){var e=vs(null==t?void 0:t.search,"__experiment_id"),i=vs(null==t?void 0:t.search,"__experiment_variant");e&&i&&(zg.Fn("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Dn(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.Rt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Rt.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Rt.token),method:"GET",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Dn(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(zg.Fn("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Pn(r[0].name,e,r[0].variants[e].transforms))}static Ln(t){return!Qi(t.conditions)&&zg.Bn(t)&&zg.jn(t)}static Bn(t){var e;if(Qi(t.conditions)||Qi(null==(e=t.conditions)?void 0:e.url))return!0;var i,r,n,s=zg.getWindowLocation();return!!s&&(null==(i=t.conditions)||!i.url||Vg[null!==(r=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Dn?void 0:Dn.location}static jn(t){var e;if(Qi(t.conditions)||Qi(null==(e=t.conditions)?void 0:e.utm))return!0;var i=fp();if(i.utm_source){var r,n,s,o,a,l,u,h,c=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,d=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.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)==i.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)==i.utm_term;return c&&v&&f&&d}return!1}static Fn(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Kn.info("[WebExperiments] "+t,i)}Pn(t,e,i){this._is_bot()?zg.Fn(Hg):"control"!==e?i.forEach((i=>{if(i.selector){var r;zg.Fn("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):zg.Fn("Control variants leave the page unmodified.")}_is_bot(){return jn&&this._instance?qp(jn,this.Rt.custom_blocked_useragents):void 0}}var Yg,Ug,Wg=Qn("[Conversations]"),Gg="Conversations not available yet.",Xg={featureFlags:class{constructor(t){this.qn=!1,this.Zn=!1,this.$n=!1,this.Hn=!1,this.Vn=!1,this.zn=!1,this.Yn=!1,this.Un=!1,this._instance=t,this.featureFlagEventHandlers=[]}get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}Wn(t){return this._instance.get_property(t)}Gn(){var t,e;return null!==(t=null==(e=this.Xi)?void 0:e.pi(this.Rt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}Xn(){return!!this.Gn()&&(this.Un||this.$n||(this.Un=!0,Fg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Jn(){var t,e=null!==(t=this.Rt.evaluation_contexts)&&void 0!==t?t:this.Rt.evaluation_environments;return!this.Rt.evaluation_environments||this.Rt.evaluation_contexts||this.Yn||(Fg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yn=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Fg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Kn(){return this.Jn().length>0}initialize(){var t,e,{config:i}=this._instance,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,r){var n=null!=r&&r.merge?this.getFlagVariants():{},s=null!=r&&r.merge?this.getFlagPayloads():{},o=i({},n,t),a=i({},s,e),l={};for(var[u,h]of Object.entries(o)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:Gi(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Zn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Wn(Ls),e=this.Wn(Dg),r=this.Wn(jg);if(!r&&!e)return t||{};var n=is({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],c=Gi(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=Gi(h)?u.variant:"string"==typeof h?h:void 0,v=null==r?void 0:r[o],f=i({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});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=i({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.qn||(Fg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.qn=!0),n}getFlagVariants(){var t=this.Wn(Os),e=this.Wn(Dg);if(!e)return t||{};for(var i=is({},t),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.qn||(Fg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.qn=!0),i}getFlagPayloads(){var t=this.Wn(Bg),e=this.Wn(jg);if(!e)return t||{};for(var i=is({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.qn||(Fg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.qn=!0),i}reloadFeatureFlags(){this.Hn||this.Rt.advanced_disable_feature_flags||this.Qn||(this._instance.Sr.emit("featureFlagsReloading",!0),this.Qn=setTimeout((()=>{this.ts()}),5))}es(){clearTimeout(this.Qn),this.Qn=void 0}ensureFlagsLoaded(){this.Zn||this.$n||this.Qn||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Hn=t}ts(t){var e;if(this.es(),!this._instance.ki())if(this.$n)this.Vn=!0;else{var r=this.Rt.token,n=this.Wn(bs),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i({},(null==(e=this.Xi)?void 0:e.get_initial_props())||{},this.Wn(Ds)||{}),group_properties:this.Wn(Bs),timezone:Ip()};Ki(n)||Gi(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Rt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Kn()&&(s.evaluation_contexts=this.Jn());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Rt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$n=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Rt.disable_compression?void 0:Jl,timeout:this.Rt.feature_flag_request_timeout_ms,callback:t=>{var e,i,r,n=!0;if(200===t.statusCode&&(this.Vn||(this.$anon_distinct_id=void 0),n=!1),this.$n=!1,!s.disable_flags||this.Vn){this.zn=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(i=t.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(r=this.Xi)||r.register({[$s]:o}),l)Fg.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 s.disable_flags||this.receivedFeatureFlags(null!==(a=t.json)&&void 0!==a?a:{},n),this.Vn&&(this.Vn=!1,this.ts())}}})}}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.zn)if(this.Zn||this.getFlags()&&this.getFlags().length>0){if(!this.Xn()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else Fg.warn('getFeatureFlag for key "'+t+Pg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.zn)if(this.Zn||this.getFlags()&&this.getFlags().length>0){if(!this.Xn()){var i=this.getFlagVariants(),r=t in i,n=i[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Wn(qg)||void 0,l=this.Wn(Hs)||void 0,u=this.Wn(qs)||{};if(this.Rt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.Wn(Zs);c&&c!==d&&(u={},null==(h=this.Xi)||h.register({[qs]:u,[Zs]:c}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,w,_,I;zi(u[t])?u[t].push(o):u[t]=[o],null==(v=this.Xi)||v.register({[qs]:u});var C=this.getFeatureFlagDetails(t),S=[...null!==(f=this.Wn($s))&&void 0!==f?f:[]];Gi(n)&&S.push("flag_missing");var k={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Rt.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Rt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.zn};Gi(null==C||null==(m=C.metadata)?void 0:m.version)||(k.$feature_flag_version=C.metadata.version);var x,T=null!==(y=null==C||null==(b=C.reason)?void 0:b.description)&&void 0!==y?y:null==C||null==(w=C.reason)?void 0:w.code;T&&(k.$feature_flag_reason=T),null!=C&&null!=(_=C.metadata)&&_.id&&(k.$feature_flag_id=C.metadata.id),Gi(null==C?void 0:C.original_variant)&&Gi(null==C?void 0:C.original_enabled)||(k.$feature_flag_original_response=Gi(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(I=C.metadata)&&I.original_payload&&(k.$feature_flag_original_payload=null==C||null==(x=C.metadata)?void 0:x.original_payload),S.length&&(k.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",k)}if(r){var A=s;if(!Gi(s))try{A=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:A}}}}else Fg.warn('getFeatureFlagResult for key "'+t+Pg)}getRemoteConfigPayload(t,e){var i=this.Rt.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.Kn()&&(r.evaluation_contexts=this.Jn()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Rt.disable_compression?void 0:Jl,timeout:this.Rt.feature_flag_request_timeout_ms,callback(i){var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),!e.fresh||this.zn){if(this.Zn||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(t,e);return Gi(i)?void 0:!!i}Fg.warn('isFeatureEnabled for key "'+t+Pg)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this.Xi){this.Zn=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,r,n,s){void 0===r&&(r={}),void 0===n&&(n={}),void 0===s&&(s={});var o=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload})).map((t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]})))):Fg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(zi(l)){Fg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;l.length>v;v++)d[l[v]]=!0;e&&e.register({[Lg]:l,[Os]:d})}else{var f=l,p=u,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=i({},r,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=i({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=i({},s,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=i({},r,f),p=i({},n,p),g=i({},s,g);e&&e.register(i({[Lg]:Object.keys($g(f)),[Os]:f||{},[Bg]:p||{},[Ls]:g||{}},h?{[qg]:h}:{},c?{[Hs]:c}:{}))}}}(t,this.Xi,r,n,s),e||(this.Un=!1),this.rs(e)}}override(t,e){void 0===e&&(e=!1),Fg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Xi)return Fg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Xi.unregister(Dg),this.Xi.unregister(jg),this.rs(),Og.info("All overrides cleared");if(zi(t)){var e=Zg(t);return this.Xi.register({[Dg]:e}),this.rs(),Og.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var i,r=t;if(this.qn=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i),"flags"in r)if(!1===r.flags)this.Xi.unregister(Dg),Og.info("Flag overrides cleared");else if(r.flags){if(zi(r.flags)){var n=Zg(r.flags);this.Xi.register({[Dg]:n})}else this.Xi.register({[Dg]:r.flags});Og.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this.Xi.unregister(jg),Og.info("Payload overrides cleared")):r.payloads&&(this.Xi.register({[jg]:r.payloads}),Og.info("Payload overrides set",{payloads:r.payloads}))),void this.rs()}if(t&&"object"==typeof t)return this.Xi.register({[Dg]:t}),this.rs(),Og.info("Flag overrides set",{flags:t});Fg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Zn){var{flags:e,flagVariants:i}=this.ns();t(e,i)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this.Wn(Ps)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=i({},this.getFlagVariants(),{[t]:e});null==(n=this.Xi)||n.register({[Lg]:Object.keys($g(l)),[Os]:l}),this.rs()}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Wn(Ps),n=i?"&"+i.map((t=>"stage="+t)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Rt.token+n),method:"GET",callback:e=>{var i,r;if(e.json){var n=e.json.earlyAccessFeatures;return null==(i=this.Xi)||i.unregister(Ps),null==(r=this.Xi)||r.register({[Ps]:n}),t(n)}}})}ns(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}rs(t){var{flags:e,flagVariants:i}=this.ns();this.featureFlagEventHandlers.forEach((r=>r(e,i,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.Wn(Ds)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in r||(o[a]=s[a]));this._instance.register({[Ds]:i({},r,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ds)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.Wn(Bs)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((e=>{r[e]=i({},r[e],t[e]),delete t[e]})),this._instance.register({[Bs]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wn(Bs)||{};this._instance.register({[Bs]:i({},e,{[t]:{}})})}else this._instance.unregister(Bs)}reset(){this.Zn=!1,this.$n=!1,this.Hn=!1,this.Vn=!1,this.zn=!1,this.$anon_distinct_id=void 0,this.es(),this.qn=!1}}},Jg={sessionRecording:class{get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}get started(){var t;return!(null==(t=this.ss)||!t.isStarted)}get status(){var t,e;return this.os===vg||this.os===fg?this.os:null!==(t=null==(e=this.ss)?void 0:e.status)&&void 0!==t?t:this.os}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.os=cg,this.ls=void 0,this._instance=t,!this._instance.sessionManager)throw gg.error("started without valid sessionManager"),new Error(pg+" started without valid sessionManager. This is a bug.");if(this.Rt.cookieless_mode===io)throw new Error(pg+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get us(){var t,e=!(null==(t=this._instance.get_property(Ns))||!t.enabled),i=!this.Rt.disable_session_recording,r=this.Rt.disable_session_recording||this._instance.consent.isOptedOut();return Dn&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!this.us||null==(e=this.ss)||!e.isStarted){var i=!Gi(Object.assign)&&!Gi(Array.from);this.us&&i?(this.hs(t),gg.info("starting")):(this.os=cg,this.stopRecording())}}hs(t){var e,i,r;this.us&&(this.os!==vg&&this.os!==fg&&(this.os=dg),null!=Un&&null!=(e=Un.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=Un.__PosthogExtensions__)&&i.initSessionRecording?this.cs(t):null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.ds,(e=>{if(e)return gg.error("could not load recorder",e);this.cs(t)})))}stopRecording(){var t,e;null==(t=this.ls)||t.call(this),this.ls=void 0,null==(e=this.ss)||e.stop()}vs(){var t,e;null==(t=this.ls)||t.call(this),this.ls=void 0,null==(e=this.ss)||e.discard()}fs(){var t;null==(t=this.Xi)||t.unregister(Fs)}ps(t,e){if(Qi(t))return null;var i,r=tr(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(gg.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}gs(t){if(this.Xi){var e,r,n=this.Xi,s=()=>{var e,r=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.ps(null==(e=this.Rt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.ps(null==r?void 0:r.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Qi(a)&&this.fs();var l=null==r?void 0:r.minimumDurationMilliseconds;n.register({[Ns]:i({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:i({capturePerformance:t.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Gi(l)?null:l,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers})})};s(),null==(e=this.ls)||e.call(this),this.ls=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.gs(t),void this.vs()):(this.gs(t),void this.startIfEnabledOrStop()):(this.os===vg&&(this.os=fg,gg.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.ss)&&i.log?this.ss.log(t,e):gg.warn("log called before recorder was ready")}get ds(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Ns);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}ys(){var t,e=this._instance.get_property(Ns);if(!e)return!1;var i=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}cs(t){var e,i;if(null==(e=Un.__PosthogExtensions__)||!e.initSessionRecording)return gg.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.ss||(this.ss=null==(i=Un.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.ss._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ys()){if(this.os===fg||this.os===vg)return;return this.os=vg,gg.info("persisted remote config is stale, requesting fresh config before starting"),void new Ep(this._instance).load()}this.os=dg,this.ss.start(t)}onRRwebEmit(t){var e;null==(e=this.ss)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.ss||null==(e=this.Xi)||e.register({$replay_override_linked_flag:!0}),null==(t=this.ss)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ss||null==(e=this.Xi)||e.register({$replay_override_sampling:!0}),null==(t=this.ss)||t.overrideSampling()}overrideTrigger(t){var e,i;this.ss||null==(i=this.Xi)||i.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(e=this.ss)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.ss)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.ss)||!i.tryAddCustomEvent(t,e))}}},Kg={autocapture:class{constructor(t){this.bs=!1,this.ws=null,this._s=!1,this.instance=t,this.rageclicks=new Nf(t.config.rageclick),this.Is=null}initialize(){this.startIfEnabled()}get Rt(){var t,e,i=Ui(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(t=i.url_allowlist)?void 0:t.map((t=>new RegExp(t))),i.url_ignorelist=null==(e=i.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),i}Cs(){if(this.isBrowserSupported()){if(Dn&&qn){var t=t=>{t=t||(null==Dn?void 0:Dn.event);try{this.Ss(t)}catch(t){Ff.error("Failed to capture event",t)}};if(us(qn,"submit",t,{capture:!0}),us(qn,"change",t,{capture:!0}),us(qn,"click",t,{capture:!0}),this.Rt.capture_copied_text){var e=t=>{this.Ss(t=t||(null==Dn?void 0:Dn.event),Mf)};us(qn,"copy",e,{capture:!0}),us(qn,"cut",e,{capture:!0})}}}else Ff.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.bs&&(this.Cs(),this.bs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._s=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Is]:!!t.autocapture_opt_out}),this.ws=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Is=t}getElementSelectors(t){var e,i=[];return null==(e=this.Is)||e.forEach((e=>{var r=null==qn?void 0:qn.querySelectorAll(e);null==r||r.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e,i=null==(t=this.instance.persistence)?void 0:t.props[Is];if(Ki(this.ws)&&!ir(i)&&!this.instance.ki())return!1;var r=null!==(e=this.ws)&&void 0!==e?e:!!i;return!!this.instance.config.autocapture&&!r}Ss(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var i,r=Co(t);go(r)&&(r=r.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&function(t,e){if(!Dn||Eo(t))return!1;var i,r,n;if(ir(e)?(i=!!e&&Ao,r=void 0):(i=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ao,r=null==e?void 0:e.content_ignorelist),!1===i)return!1;var{targetElementList:s}=Ro(t,!1);return!function(t,e){if(!1===t||Gi(t))return!1;var i;if(!0===t)i=To;else{if(!zi(t))return!1;if(t.length>10)return Kn.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:r}=t;return i.some((t=>e.includes(t)||r.includes(t)))}))}(r,s.map((t=>{var e;return{safeText:Io(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!ko(s,i)}(r,this.instance.config.rageclick)&&this.Ss(t,"$rageclick");var n=e===Mf;if(r&&function(t,e,i,r,n){var s,o,a,l;if(void 0===i&&(i=void 0),!Dn||Eo(t))return!1;if(null!=(s=i)&&s.url_allowlist&&!bo(i.url_allowlist))return!1;if(null!=(o=i)&&o.url_ignorelist&&bo(i.url_ignorelist))return!1;if(null!=(a=i)&&a.dom_event_allowlist){var u=i.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Ro(t,r);if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Gi(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(c,i))return!1;if(!ko(c,null==(l=i)?void 0:l.css_selector_allowlist))return!1;var d=Dn.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&&(So.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,this.Rt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Lf(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.element_attribute_ignorelist,elementsChainAsString:this._s});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),e===Mf){var l,u=_o(null==Dn||null==(l=Dn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Yi(null==qn?void 0:qn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ks=(null==Dn||null==(e=Dn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Kn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.xs&&this.xs(),this.xs=void 0,Kn.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Dn&&Dn.history){var i=this;null!=(t=Dn.history.pushState)&&t.__posthog_wrapped__||gs(Dn.history,"pushState",(t=>function(e,r,n){t.call(this,e,r,n),i.Ts("pushState")})),null!=(e=Dn.history.replaceState)&&e.__posthog_wrapped__||gs(Dn.history,"replaceState",(t=>function(e,r,n){t.call(this,e,r,n),i.Ts("replaceState")})),this.As()}}Ts(t){try{var e,i=null==Dn||null==(e=Dn.location)?void 0:e.pathname;if(!i)return;i!==this.ks&&this.isEnabled&&this._instance.capture(lo,{navigation_type:t}),this.ks=i}catch(e){Kn.error("Error capturing "+t+" pageview",e)}}As(){if(!this.xs){var t=()=>{this.Ts("popstate")};us(Dn,"popstate",t),this.xs=()=>{Dn&&Dn.removeEventListener("popstate",t)}}}},heatmaps:class{get Rt(){return this.instance.config}constructor(t){var e;this.Es=!1,this.bs=!1,this.Rs=null,this.instance=t,this.Es=!(null==(e=this.instance.persistence)||!e.props[Cs]),this.rageclicks=new Nf(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ui(this.Rt.capture_heatmaps)&&this.Rt.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qi(this.Rt.capture_heatmaps)?Qi(this.Rt.enable_heatmaps)?this.Es:this.Rt.enable_heatmaps:!1!==this.Rt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.bs)return;mg.info("starting..."),this.Ns(),this.Tt()}else{var t;clearInterval(null!==(t=this.Rs)&&void 0!==t?t:void 0),this.Ms(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Cs]:e}),this.Es=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.T;return this.T=void 0,t}Fs(t){this.wt(t.originalEvent,"deadclick")}Tt(){this.Rs&&clearInterval(this.Rs),this.Rs=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(qn)?setInterval(this.ji.bind(this),this.flushIntervalMilliseconds):null}Ns(){Dn&&qn&&(this.Os=this.ji.bind(this),us(Dn,ao,this.Os),this.Ps=t=>this.wt(t||(null==Dn?void 0:Dn.event)),us(qn,"click",this.Ps,{capture:!0}),this.Ls=t=>this.Ds(t||(null==Dn?void 0:Dn.event)),us(qn,"mousemove",this.Ls,{capture:!0}),this.Bs=new rp(this.instance,ep,this.Fs.bind(this)),this.Bs.startIfEnabledOrStop(),this.js=this.Tt.bind(this),us(qn,oo,this.js),this.bs=!0)}Ms(){var t;Dn&&qn&&(this.Os&&Dn.removeEventListener(ao,this.Os),this.Ps&&qn.removeEventListener("click",this.Ps,{capture:!0}),this.Ls&&qn.removeEventListener("mousemove",this.Ls,{capture:!0}),this.js&&qn.removeEventListener(oo,this.js),clearTimeout(this.qs),null==(t=this.Bs)||t.stop(),this.bs=!1)}Zs(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&fo(r)&&!po(r,"body");){if(r===i)return!1;if(ji(e,null==Dn?void 0:Dn.getComputedStyle(r).position))return!0;r=xo(r)}return!1}(Co(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}wt(t,e){var r;if(void 0===e&&(e="click"),!vo(t.target)&&yg(t)){var n=this.Zs(t,e);null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.$s(i({},n,{type:"rageclick"})),this.$s(n)}}Ds(t){!vo(t.target)&&yg(t)&&(clearTimeout(this.qs),this.qs=setTimeout((()=>{this.$s(this.Zs(t,"mousemove"))}),500))}$s(t){if(Dn){var e=Dn.location.href,i=this.Rt.custom_personal_data_properties,r=this.Rt.mask_personal_data_properties?[...hp,...i||[]]:[],n=fs(e,r,dp);this.T=this.T||{},this.T[n]||(this.T[n]=[]),this.T[n].push(t)}}ji(){this.T&&!Wi(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rp,webVitalsAutocapture:class{constructor(t){var e;this.Es=!1,this.bs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hs=()=>{clearTimeout(this.Vs),0!==this.T.metrics.length&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((t,e)=>i({},t,{["$web_vitals_"+e.name+"_event"]:i({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.nt=t=>{var e,r=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(Gi(r))ug.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.zs();Gi(n)||(Qi(null==t?void 0:t.name)||Qi(null==t?void 0:t.value)?ug.error("Invalid metric received",t):!this.Ys||this.Ys>t.value?(this.T.url!==n&&(this.Hs(),this.Vs=setTimeout(this.Hs,this.flushToCaptureTimeoutMs)),Gi(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=Gi(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.T.metrics.push(i({},t,{$current_url:n,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.Hs()):ug.error("Ignoring metric with value >= "+this.Ys,t))}},this.Us=()=>{if(!this.bs){var t,e,i,r,n=Un.__PosthogExtensions__;Gi(n)||Gi(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:i,onINP:r}=n.postHogWebVitalsCallbacks),t&&e&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.nt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.nt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.nt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.nt.bind(this)),this.bs=!0):ug.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Es=!(null==(e=this._instance.persistence)||!e.props[Ts]),this.startIfEnabled()}get Ws(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Ui(this.Ws)?null==(t=this.Ws)?void 0:t.web_vitals_allowed_metrics:void 0;return Qi(i)?(null==(e=this._instance.persistence)?void 0:e.props[Rs])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Ui(this.Ws)?this.Ws.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ui(this.Ws)?this.Ws.web_vitals_attribution:void 0;return null!=t&&t}get Ys(){var t=Ui(this.Ws)&&tr(this.Ws.__web_vitals_max_value)?this.Ws.__web_vitals_max_value:hg;return t>0&&6e4>=t?hg:t}get isEnabled(){var t=null==Zn?void 0:Zn.protocol;if("http:"!==t&&"https:"!==t)return ug.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ui(this.Ws)?this.Ws.web_vitals:ir(this.Ws)?this.Ws:void 0;return ir(e)?e:this.Es}startIfEnabled(){this.isEnabled&&!this.bs&&(ug.info("enabled, starting..."),this.ni(this.Us))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ui(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Ui(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ts]:e}),this._instance.persistence.register({[Rs]:i})),this.Es=e,this.startIfEnabled()}}ni(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?ug.error("failed to load script",e):t()}))}zs(){var t=Dn?Dn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...hp,...e||[]]:[];return fs(t,i,dp)}ug.error("Could not determine current URL")}}},Qg={exceptionObserver:class{constructor(t){var e,i,r;this.Us=()=>{var t;if(Dn&&this.isEnabled&&null!=(t=Un.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Un.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Un.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=Un.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Gs&&this.Rt.capture_unhandled_errors&&(this.Gs=e(this.captureException.bind(this))),!this.Xs&&this.Rt.capture_unhandled_rejections&&(this.Xs=i(this.captureException.bind(this))),!this.Js&&this.Rt.capture_console_errors&&(this.Js=r(this.captureException.bind(this)))}catch(t){ag.error("failed to start",t),this.Ks()}}},this._instance=t,this.Qs=!(null==(e=this._instance.persistence)||!e.props[Ss]),this.eo=new cr({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,qt:ag}),this.Rt=this.io(),this.startIfEnabledOrStop()}io(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ui(t)?e=i({},e,t):(Gi(t)?this.Qs:t)&&(e=i({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rt.capture_console_errors||this.Rt.capture_unhandled_errors||this.Rt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ag.info("enabled"),this.Ks(),this.ni(this.Us)):this.Ks()}ni(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return ag.error("failed to load script",e);t()}))}Ks(){var t,e,i;null==(t=this.Gs)||t.call(this),this.Gs=void 0,null==(e=this.Xs)||e.call(this),this.Xs=void 0,null==(i=this.Js)||i.call(this),this.Js=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Qs=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ss]:this.Qs}),this.Rt=this.io(),this.startIfEnabledOrStop())}onConfigChange(){this.Rt=this.io()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.eo.consumeRateLimit(n)?ag.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.ro=[],this.no=Vv(),this._instance=t,this.ro=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(ks))&&void 0!==e?e:[]}onRemoteConfig(t){var e,i,r;if("errorTracking"in t){var n=null!==(e=null==(i=t.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],s=null==(r=t.errorTracking)?void 0:r.captureExtensionExceptions;this.ro=n,this._instance.persistence&&this._instance.persistence.register({[ks]:this.ro,[xs]:s})}}get so(){var t,e=!!this._instance.get_property(xs),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.no.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.oo(e)){if(this.ao(e))return void Hv.info("Skipping exception capture because a suppression rule matched");if(!this.so&&this.lo(e))return void Hv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.uo(e))return void Hv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",zr:!0})}ao(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:i,value:r}=e;return Xi(i)&&i.length>0&&t.$exception_types.push(i),Xi(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.ro.some((t=>{var i=t.values.map((t=>{var i,r=ju[t.operator],n=zi(t.value)?t.value:[t.value],s=null!==(i=e[t.key])&&void 0!==i?i:[];return n.length>0&&r(n,s)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}lo(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}uo(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}oo(t){return!Qi(t)&&zi(t)}}},tm=i({productTours:class{get Xi(){return this._instance.persistence}constructor(t){this.ho=null,this.co=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.Xi&&this.Xi.register({[Es]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.ho||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Es)||this.ni((()=>this.do()))}ni(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?bg.error("Could not load product tours script",e):t()}))}do(){var t;!this.ho&&null!=(t=Un.__PosthogExtensions__)&&t.generateProductTours&&(this.ho=Un.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!zi(this.co)||e){var i=this.Xi;if(i){var r=i.props[wg];if(zi(r)&&!e)return this.co=r,void t(r,{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 r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return bg.error(n),void t([],{isLoaded:!1,error:n})}var s=zi(e.json.product_tours)?e.json.product_tours:[];this.co=s,i&&i.register({[wg]:s}),t(s,{isLoaded:!0})}})}else t(this.co,{isLoaded:!0})}getActiveProductTours(t){Qi(this.ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ho)||e.showTourById(t)}previewTour(t){this.ho?this.ho.previewTour(t):this.ni((()=>{var e;this.do(),null==(e=this.ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ho)||t.nextStep()}previousStep(){var t;null==(t=this.ho)||t.previousStep()}clearCache(){var t;this.co=null,null==(t=this.Xi)||t.unregister(wg)}resetTour(t){var e;null==(e=this.ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ho)||e.cancelPendingTour(t)}}},Xg),em={siteApps:class{constructor(t){this._instance=t,this.vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}fo(t,e){if(e){var i=this.globalsForEvent(e);this.vo.push(i),this.vo.length>1e3&&(this.vo=this.vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Un._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.fo.bind(this));this.po=()=>{t(),this.vo=[],this.po=void 0}}}globalsForEvent(t){var e,n,s,o,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:i({},r(t,_g),{properties:i({},t.properties,g?{$set:i({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:i({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},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],i=()=>{var i;!e.errored&&this.vo.length&&(Ig.info("Processing "+this.vo.length+" events for site app with id "+t.id),this.vo.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.po)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Ig.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var{processEvent:s}=t.init({posthog:this._instance,callback(t){n(t)}});s&&(e.processEvent=s),r=!0}catch(e){Ig.error(Cg+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Ig.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}mo(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}yo(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(e)}catch(e){Ig.error("Error while processing event "+t.event+" for site app "+i.id,e)}}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.mo(),void this._instance.on("eventCaptured",(t=>this.yo(t)))):void Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.po)||i.call(this),null!=(r=t.siteApps)&&r.length)if(this.isEnabled){var s=function(t){var e;Un["__$$ph_site_app_"+t]=n._instance,null==(e=Un.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Ig.error(Cg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},im={tracingHeaders:class{constructor(t){this.bo=void 0,this.wo=void 0,this.Us=()=>{var t,e;Gi(this.bo)&&(null==(t=Un.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Gi(this.wo)&&(null==(e=Un.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}initialize(){this.startIfEnabledOrStop()}ni(t){var e,i;null!=(e=Un.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return lg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.ni(this.Us):(null==(t=this.bo)||t.call(this),null==(e=this.wo)||e.call(this),this.bo=void 0,this.wo=void 0)}}},rm=i({surveys:class{get Rt(){return this._instance.config}constructor(t){this._o=void 0,this._surveyManager=null,this.Io=!1,this.Co=[],this.So=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Rt.disable_surveys){var e=t.surveys;if(Qi(e))return Nl.warn("Flags not loaded yet. Not loading surveys.");var i=zi(e);this._o=i?e.length>0:e,Nl.info("flags response received, isSurveysEnabled: "+this._o),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var i=localStorage.key(e);(null!=i&&i.startsWith(Pl)||null!=i&&i.startsWith(Ll))&&t.push(i)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Io)Nl.info("Already initializing surveys, skipping...");else if(this.Rt.disable_surveys)Nl.info(Eg);else if(this.Rt.cookieless_mode&&this._instance.consent.isOptedOut())Nl.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Un?void 0:Un.__PosthogExtensions__;if(t){if(!Gi(this._o)||this.Rt.advanced_enable_surveys){var e=this._o||this.Rt.advanced_enable_surveys;this.Io=!0;try{var i=t.generateSurveys;if(i)return void this.ko(i,e);var r=t.loadExternalDependency;if(!r)return void this.xo(to);r(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.xo("Could not load surveys script",i):this.ko(t.generateSurveys,e)}))}catch(t){throw this.xo("Error initializing surveys",t),t}finally{this.Io=!1}}}else Nl.error("PostHog Extensions not found.")}}ko(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Tg(this._instance),Nl.info("Surveys loaded successfully"),this.To({isLoaded:!0})}xo(t,e){Nl.error(t,e),this.To({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Co.push(t),this._surveyManager&&this.To({isLoaded:!0}),()=>{this.Co=this.Co.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Rt.disable_surveys)return Nl.info(Eg),t([]);var i,r=this._instance.get_property(js);if(r&&!e)return t(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.So?this.So.then((e=>{var{surveys:i,context:r}=e;return t(i,r)})):("undefined"!=typeof Promise&&(this.So=new Promise((t=>{i=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Rt.token),method:"GET",timeout:this.Rt.surveys_request_timeout_ms,callback:e=>{var r;this.So=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Nl.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==i||i({surveys:[],context:o}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Fl(t)||Ol(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(r=this._instance.persistence)||r.register({[js]:l});var h={isLoaded:!0};t(l,h),null==i||i({surveys:l,context:h})}}))}To(t){for(var e of this.Co)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Nl.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Qi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Nl.warn("init was not called")}Ao(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}Eo(t){if(Qi(this._surveyManager))return{eligible:!1,reason:Ag};var e="string"==typeof t?this.Ao(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qi(this._surveyManager))return Nl.warn("init was not called"),{visible:!1,disabledReason:Ag};var e=this.Eo(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qi(this._surveyManager)?(Nl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ag})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.Eo(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var r;if(Qi(this._surveyManager))Nl.warn("init was not called");else{var n="string"==typeof t?this.Ao(t):t;if(null!=n&&n.id)if(Zl.includes(n.type)){var s=null==qn?void 0:qn.querySelector(e);if(s)return null!=(r=n.appearance)&&r.surveyPopupDelaySeconds?(Nl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Nl.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Nl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,i);Nl.warn("Survey element not found")}else Nl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Nl.warn("Survey not found")}}displaySurvey(t,e){var r;if(Qi(this._surveyManager))Nl.warn("init was not called");else{var n=this.Ao(t);if(n){var s=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=i({},n,{appearance:i({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Rl&&e.initialResponses&&Nl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Nl.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Nl.warn("Survey not found")}}cancelPendingSurvey(t){Qi(this._surveyManager)?Nl.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Xg),nm={toolbar:class{constructor(t){this.instance=t}Ro(t){Un.ph_toolbar_state=t}No(){var t;return null!==(t=Un.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),hs(this.instance.config))return!1;if(!Dn||!qn)return!1;t=null!=t?t:Dn.location,i=null!=i?i:Dn.history;try{if(!e){try{Dn.localStorage.setItem("test","test"),Dn.localStorage.removeItem("test")}catch(t){return!1}e=null==Dn?void 0:Dn.localStorage}var r,n=Rg||ps(t.hash,"__posthog")||ps(t.hash,"state"),s=n?ns((()=>JSON.parse(atob(decodeURIComponent(n)))))||ns((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Ng)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Mo(t){var e=Un.ph_load_toolbar||Un.ph_load_editor;!Qi(e)&&Yi(e)?e(t,this.instance):Mg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==qn||!qn.getElementById(Js));if(!Dn||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=i({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Dn.localStorage.setItem(Ng,JSON.stringify(i({},n,{source:void 0}))),2===this.No())this.Mo(n);else if(0===this.No()){var s;this.Ro(1),null==(s=Un.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Mg.error("[Toolbar] Failed to load",t),void this.Ro(0);this.Ro(2),this.Mo(n)})),us(Dn,"turbolinks:load",(()=>{this.Ro(0),this.loadToolbar(n)}))}return!0}Fo(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},sm=i({experiments:zg},Xg),om={conversations:class{constructor(t){this.Oo=void 0,this._conversationsManager=null,this.Po=!1,this.Lo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Qi(e)||(ir(e)?this.Oo=e:(this.Oo=e.enabled,this.Lo=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Oo=void 0,this.Lo=null}loadIfEnabled(){if(!(this._conversationsManager||this.Po||this._instance.config.disable_conversations||hs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Un?void 0:Un.__PosthogExtensions__;if(t&&!Gi(this.Oo)&&this.Oo)if(this.Lo&&this.Lo.token){this.Po=!0;try{var e=t.initConversations;if(e)return this.Do(e),void(this.Po=!1);var i=t.loadExternalDependency;if(!i)return void this.Bo(to);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Bo("Could not load conversations script",e):this.Do(t.initConversations),this.Po=!1}))}catch(t){this.Bo("Error initializing conversations",t),this.Po=!1}}else Wg.error("Conversations enabled but missing token in remote config.")}}Do(t){if(this.Lo)try{this._conversationsManager=t(this.Lo,this._instance),Wg.info("Conversations loaded successfully")}catch(t){this.Bo("Error completing conversations initialization",t)}else Wg.error("Cannot complete initialization: remote config is null")}Bo(t,e){Wg.error(t,e),this._conversationsManager=null,this.Po=!1}show(){this._conversationsManager?this._conversationsManager.show():Wg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Oo&&!Ki(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,i,r){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,i,r):(Wg.warn(Gg),null)}))()}getMessages(t,i){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,i):(Wg.warn(Gg),null)}))()}markAsRead(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.markAsRead(t):(Wg.warn(Gg),null)}))()}getTickets(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getTickets(t):(Wg.warn(Gg),null)}))()}requestRestoreLink(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.requestRestoreLink(t):(Wg.warn(Gg),null)}))()}restoreFromToken(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.restoreFromToken(t):(Wg.warn(Gg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Wg.warn(Gg),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}Kr(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qr(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},am={logs:class{constructor(t){var e;this.jo=!1,this.qo=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.jo=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,i=null==(e=t.logs)?void 0:e.captureConsoleLogs;!Qi(i)&&i&&(this.jo=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.jo&&!this.qo){var t=Qn("[logs]"),e=null==Un?void 0:Un.__PosthogExtensions__;if(e){var i=e.loadExternalDependency;i?i(this._instance,"logs",(i=>{var r;i||null==(r=e.logs)||!r.initializeLogs?t.error("Could not load logs script",i):(e.logs.initializeLogs(this._instance),this.qo=!0)})):t.error(to)}else t.error("PostHog Extensions not found.")}}}},lm=i({},Xg,Jg,Kg,Qg,tm,em,rm,im,nm,sm,om,am);og.__defaultExtensionClasses=i({},lm),Yg=Up[tg]=new og,(Ug=Un.posthog)&&es(Ug._i,(function(t){if(t&&zi(t)){var e=Yg.init(t[0],t[1],t[2]),i=Ug[t[2]]||Ug;e&&(e._execute_array.call(e.people,i.people),e._execute_array(i))}})),Un.posthog=Yg,function(){function t(){t.done||(t.done=!0,eg=!1,es(Up,(function(t){t._dom_loaded()})))}null!=qn&&qn.addEventListener?"complete"===qn.readyState?t():us(qn,"DOMContentLoaded",t,{capture:!1}):Dn&&Kn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";function t(t,e,r,i,n,s,o){try{var a=t[s](o),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,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;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,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(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"]},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]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)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 s=f(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.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:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),contains:(t,e)=>y("Node",t,"contains")(e),getRootNode:t=>y("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>g("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>g("Element",t,"querySelectorAll")(e),mutationObserver:()=>f("MutationObserver").constructor};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(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]"==={}.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;return e?((r=Array.from(e,(e=>S(e,t.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(t){return null}var r}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(3>e.split('"').length)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=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?L(i,e):i}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){this.idNodeMap.set(e.id,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 T(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&A(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function A(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?A(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 M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,r,i,n,s,o)=>{var a,l=i||s||o,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,j=1,q=new RegExp("[^a-z0-9-_:]"),Z=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function U(t,e){return e&&""!==e.trim()?W(t,e):e}function W(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function G(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?U(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?(r+=(i=n[0]).length,i):""}for(var n=[];i(z),e.length>r;){var s=i(V);if(","===s.slice(-1))s=U(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=U(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?U(t,i):i:U(t,i):i}function X(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function J(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&J(b.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&J(b.parentNode(t),e,r)}function K(t,e,r,i){var n;if(w(t)){if(!b.childNodes(n=t).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(J(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 Q(t){return null==t?"":t.toLowerCase()}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,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:S,iframeLoadTimeout:x=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:O=(()=>!1),newlyAddedElement:P=!1}=e,{needsMask:j}=e,{preserveWhiteSpace:V=!0}=e;j||(j=K(t,o,a,void 0===j));var z,Y=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,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)){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:s,inlineStylesheet:o,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--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=A(t.tagName);return q.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;w>_;_++){var I=t.attributes[_];X(m,I.name)||(y[I.name]=G(i,m,A(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);!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 M=C(t.sheet);M&&(y._cssText=M)}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=T({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}if("option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected),"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;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((E in n?n[E]:n).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 j=t,Z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+Z+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop)),g){var{width:Y,height:U}=t.getBoundingClientRect();y={class:y.class,rr_width:Y+"px",rr_height:U+"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,Boolean("svg"===W.tagName||W.ownerSVGElement)||void 0),needBlock:g,rootId:p,isCustom:r};var W}(t,{doc:r,blockClass:n,blockSelector:s,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:s}=e,o=b.parentNode(t),a=o&&o.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=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,W(e.doc))}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*")),{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:o,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}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:O,newlyAddedElement:P});if(!Y)return console.warn(t,"not serialized"),null;z=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&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(Y,f)&&(V||Y.type!==h.Text||Y.isStyle||Y.textContent.replace(/^\s+|\s+$/gm,"").length)?H():Z;var U=Object.assign(Y,{id:z});if(i.add(t,U),z===Z)return null;y&&y(t);var J=!l;if(U.type===h.Element){J=J&&!U.needBlock,delete U.needBlock;var et=b.shadowRoot(t);et&&I(et)&&(U.isShadowHost=!0)}if((U.type===h.Document||U.type===h.Element)&&J){f.headWhitespace&&U.type===h.Element&&"head"===U.tagName&&(V=!1);var rt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O};if(U.type===h.Element&&"textarea"===U.tagName&&void 0!==U.attributes.value);else for(var it of Array.from(b.childNodes(t))){var nt=tt(it,rt);nt&&U.childNodes.push(nt)}var st=null;if(w(t)&&(st=b.shadowRoot(t)))for(var ot of Array.from(b.childNodes(st))){var at=tt(ot,rt);at&&(I(st)&&(at.isShadow=!0),U.childNodes.push(at))}}var lt=b.parentNode(t);return lt&&_(lt)&&I(lt)&&(U.isShadow=!0),U.type===h.Element&&"iframe"===U.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&S){var r=tt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});r&&S(t,r)}}),x),U.type===h.Element&&"link"===U.tagName&&"string"==typeof U.attributes.rel&&("stylesheet"===U.attributes.rel||"preload"===U.attributes.rel&&"string"==typeof U.attributes.href&&"css"===N(U.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(M){var e=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});e&&M(t,e)}}),F),U}let et=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 rt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},it={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},nt={};function st(t){if(nt[t])return nt[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 rt?rt[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]"))}))),s=t in it?it[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return nt[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?nt[t]=u:r}catch(t){return r}}var ot={};function at(t,e,r){var i,n=t+"."+String(r);if(ot[n])return ot[n].call(e);var s=st(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ot[n]=o,o.call(e)):e[r]}var lt={};function ut(t,e,r){var i=t+"."+String(r);if(lt[i])return lt[i].bind(e);var n=st(t)[r];return"function"!=typeof n?e[r]:(lt[i]=n,n.bind(e))}function ht(){return st("MutationObserver").constructor}var ct={childNodes:t=>at("Node",t,"childNodes"),parentNode:t=>at("Node",t,"parentNode"),parentElement:t=>at("Node",t,"parentElement"),textContent:t=>at("Node",t,"textContent"),contains:(t,e)=>ut("Node",t,"contains")(e),getRootNode:t=>ut("Node",t,"getRootNode")(),host:t=>t&&"host"in t?at("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?at("Element",t,"shadowRoot"):null,querySelector:(t,e)=>at("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>at("Element",t,"querySelectorAll")(e),mutationObserver:ht};function dt(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 vt="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.",ft={map:{},getId(){return console.error(vt),-1},getNode(){return console.error(vt),null},removeNodeFromMap(){console.error(vt)},has(){return console.error(vt),!1},reset(){console.error(vt)}};function pt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function gt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>gt(t,e,s||{},!0)}function mt(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&&(ft=new Proxy(ft,{get(t,e,r){return"map"===e&&console.error(vt),Reflect.get(t,e,r)}}));var yt=Date.now;function bt(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=ct.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=ct.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function wt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _t(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t){return t?t.nodeType===t.ELEMENT_NODE?t:ct.parentElement(t):null}function Ct(t,e,r,i){if(!t)return!1;var n=It(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(J(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 St(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Z}function kt(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=ct.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||kt(i,e))}function xt(t){return Boolean(t.changedTouches)}function Tt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function At(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Et(t){return!!t&&(t instanceof et&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(ct.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(yt=()=>(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 Nt(t){var e,r=null;return"getRootNode"in t&&(null==(e=ct.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ct.host(ct.getRootNode(t))&&(r=ct.host(ct.getRootNode(t))),r}function Mt(t){var e=t.ownerDocument;return!!e&&(ct.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Nt(r);)r=e;return r}(t);return ct.contains(e,r)}(t))}var Ft=(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))(Ft||{}),Ot=(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))(Ot||{}),Pt=(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))(Pt||{}),Lt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Lt||{}),Dt=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Dt||{}),Bt=(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))(Bt||{});function jt(t){return"__ln"in t}class qt{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;t>r;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&&jt(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&&jt(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 Zt,$t=(t,e)=>t+"@"+e;class Ht{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 qt,i=t=>{for(var e=t,r=Z;r===Z;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=ct.parentNode(n);if(s&&Mt(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Nt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=tt(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=>{Tt(t,this.mirror)&&this.iframeManager.addIframe(t),At(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Et(n)&&this.shadowDomManager.addShadowRoot(ct.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:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)zt(this.removes,s,this.mirror)&&!this.movedSet.has(ct.parentNode(s))||n(s);for(var o of this.addedSet)Yt(this.droppedSet,o)||zt(this.removes,o,this.mirror)?Yt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(ct.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(ct.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=ct.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ct.host(f);if(-1!==this.mirror.getId(p)){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 g={texts:this.texts.map((t=>{var e=t.node,r=ct.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);e.style.length>r.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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e)),e.attributes.value=Array.from(ct.childNodes(t),(t=>ct.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!St(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=ct.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:K(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,It(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 s=R(r);n=T({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!X(r.tagName,i))if(o.attributes[i]=G(this.doc,A(r.tagName),A(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)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(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=_(t.target)?this.mirror.getId(ct.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||St(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Vt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||kt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[$t(r,i)]?Vt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(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(St(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[$t(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(ct.childNodes(t).forEach((t=>this.genAdds(t))),Et(t)&&ct.childNodes(ct.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 Vt(t,e){t.delete(e),ct.childNodes(e).forEach((e=>Vt(t,e)))}function zt(t,e,r){return 0!==t.length&&function(t,e,r){for(var i,n=ct.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=ct.parentNode(n)};n;)if(i=s())return i.v;return!1}(t,e,r)}function Yt(t,e){return 0!==t.size&&Ut(t,e)}function Ut(t,e){var r=ct.parentNode(e);return!!r&&(!!t.has(r)||Ut(t,r))}var Wt=t=>Zt?function(){try{return t(...arguments)}catch(t){if(Zt&&!0===Zt(t))return;throw t}}:t,Gt=[];function Xt(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 Jt(t,e){var r=new Ht;Gt.push(r),r.init(t);var i=new(ht())(Wt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Kt(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return dt("scroll",Wt(pt(Wt((t=>{var o=Xt(t);if(o&&!Ct(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=bt(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Qt=["INPUT","TEXTAREA","SELECT"],te=new WeakMap;function ee(t){return function(t,e){if(se("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||se("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||se("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||se("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 re(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ie(t,e){var r,i,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:ct.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!==s&&-1!==s&&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!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),Wt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function ne(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:s,viewportResizeCb:o,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),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...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=Jt(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=pt(Wt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),h=Wt(pt(Wt((t=>{var e=Xt(t),{clientX:r,clientY:i}=xt(t)?t.changedTouches[0]:t;s||(s=yt()),l.push({x:r,y:i,id:n.getId(e),timeOffset:yt()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Ot.Drag:t instanceof MouseEvent?Ot.MouseMove:Ot.TouchMove)})),o,{trailing:!1})),c=[dt("mousemove",h,i),dt("touchmove",h,i),dt("drag",h,i)];return Wt((()=>{c.forEach((t=>t()))}))}(t),o=function(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,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(Pt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=A(t),l=(t=>i=>{var a=Xt(i);if(!Ct(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Lt.Mouse;break;case"touch":l=Lt.Touch;break;case"pen":l=Lt.Pen}l===Lt.Touch&&(Pt[t]===Pt.MouseDown?u="TouchStart":Pt[t]===Pt.MouseUp&&(u="TouchEnd"))}else xt(i)&&(l=Lt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Lt.Touch||u.startsWith("Mouse")&&l===Lt.Mouse)&&(l=null)):Pt[t]===Pt.Click&&(l=h,h=null);var c=xt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Wt(e)(r({type:Pt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Pt[t]){case Pt.MouseDown:case Pt.MouseUp:a=a.replace("mouse","pointer");break;case Pt.TouchStart:case Pt.TouchEnd:return}u.push(dt(a,l,i))})),Wt((()=>{u.forEach((t=>t()))}))}(t),a=Kt(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return dt("resize",Wt(pt(Wt((()=>{var t=wt(),e=_t();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n}),u=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Xt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=ct.parentElement(e)),e&&n&&Qt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=T({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 s=te.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){te.set(t,i);var o=n.getId(t);Wt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>dt(t,Wt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((t=>gt(t[0],t[1],{set(){Wt(v)({target:this,isTrusted:!1})}},!1,g)))),Wt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Wt((t=>pt(Wt((s=>{var o=Xt(s);if(o&&!Ct(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[dt("play",a(Bt.Play),o),dt("pause",a(Bt.Pause),o),dt("seeked",a(Bt.Seeked),o),dt("volumechange",a(Bt.VolumeChange),o),dt("ratechange",a(Bt.RateChange),o)];return Wt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Wt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=re(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=re(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=re(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=re(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};oe("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(oe("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),oe("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),oe("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Wt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=re(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...ee(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Wt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=re(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...ee(e),o]}]}),t.apply(e,s)}))})})),Wt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.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=ie(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Wt(((t,e,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=re(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:h,priority:c},index:ee(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Wt(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=re(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:ee(e.parentRule)}),t.apply(e,o)}))}),Wt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.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=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.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=mt(r.fonts,"add",(function(t){return function(r){return setTimeout(Wt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Wt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Wt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ct(c,i,n,!0)||Ct(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),dt("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?mt(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 Wt((()=>{Gt.forEach((t=>t.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function se(t){return void 0!==window[t]}function oe(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ae{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),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}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);return"number"!=typeof e?e:i.get(e)||-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||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class le{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ae(H)),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 ae(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 Ft.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:Ft.IncrementalSnapshot,data:{source:Ot.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return e;case Ft.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ft.IncrementalSnapshot:switch(e.data.source){case Ot.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 Ot.Drag:case Ot.TouchMove:case Ot.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Ot.ViewportResize:return!1;case Ot.MediaInteraction:case Ot.MouseInteraction:case Ot.Scroll:case Ot.CanvasMutation:case Ot.Input:return this.replaceIds(e.data,t,["id"]),e;case Ot.StyleSheetRule:case Ot.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Ot.Font:return e;case Ot.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Ot.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])&&(e[n]=Array.isArray(e[n])?t.getIds(r,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 ue{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=Jt(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(Kt(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(ct.host(t))),this.restoreHandlers.push(ie({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(mt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=ct.shadowRoot(this);return s&&Mt(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce="undefined"==typeof Uint8Array?[]:new Uint8Array(256),de=0;64>de;de++)ce[he.charCodeAt(de)]=de;var ve=new Map,fe=(t,e,r)=>{if(t&&(me(t,e)||"object"==typeof t)){var i=function(t,e){var r=ve.get(t);return r||ve.set(t,r=new Map),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 pe(t,e,r){if(t instanceof Array)return t.map((t=>pe(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;i>e;e+=3)n+=he[r[e]>>2],n+=he[(3&r[e])<<4|r[e+1]>>4],n+=he[(15&r[e+1])<<2|r[e+2]>>6],n+=he[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:[pe(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}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pe(t.data,e,r),t.width,t.height]}:me(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fe(t,e,r)}:t}var ge=(t,e,r)=>t.map((t=>pe(t,e,r))),me=(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 ye(t,e,r,i){var n=[];try{var s=mt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ct(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(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function be(t,e,r,i,n,s){var o=[],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=mt(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=t.apply(this,l);if(fe(h,s,this),"tagName"in this.canvas&&!Ct(this.canvas,i,n,!0)){var c=ge(l,s,this);r(this.canvas,{type:e,property:a,args:c})}return h}}));o.push(l)}catch(i){var u=gt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var we,_e,Ie,Ce,Se="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ke="undefined"!=typeof window&&window.Blob&&new Blob([(we=Se,Uint8Array.from(atob(we),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function xe(t){var e;try{if(!(e=ke&&(window.URL||window.webkitURL).createObjectURL(ke)))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,"+Se,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Te{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:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}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,s){var o=this,a=ye(r,i,n,!0),l=new Map,u=new xe;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:s}=t.data;this.mutationCb({id:e,type:Dt["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{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&&c>t-d||(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{Ct(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=o.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:s.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=ye(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=mt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ct(this.canvas,r,i,!0)||setTimeout((()=>{var r=ge(a,e,this);t(this.canvas,{type:Dt["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=gt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:Dt["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...be(e.WebGLRenderingContext.prototype,Dt.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...be(e.WebGL2RenderingContext.prototype,Dt.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}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,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Ae{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=[],s=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 o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ee{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 Re=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ne=document.createElement("iframe");document.body.appendChild(Ne),Array.from=(null==(n=Ne.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ne)}}catch(t){console.debug("Unable to override Array.from",t)}var Me,Fe,Oe=new x;function Pe(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:A=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Zt=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!==_&&void 0===b.mousemove&&(b.mousemove=_),Oe.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=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var j=0,q=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};_e=(t,r)=>{var s,o=t;if(o.timestamp=yt(),!(null==(s=Gt[0])?void 0:s.isFrozen())||o.type===Ft.FullSnapshot||o.type===Ft.IncrementalSnapshot&&o.data.source===Ot.Mutation||Gt.forEach((t=>t.unfreeze())),O)null==e||e(q(o),r);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Ft.FullSnapshot)L=o,j=0;else if(o.type===Ft.IncrementalSnapshot){if(o.data.source===Ot.Mutation&&o.data.isAttachIframe)return;j++,(n&&j>=n||i&&o.timestamp-L.timestamp>i)&&Ie(!0)}};var Z=t=>{_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.Mutation},t)})},H=t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.Scroll},t)}),V=t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.CanvasMutation},t)}),z=new Ae({mutationCb:Z,adoptedStyleSheetCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.AdoptedStyleSheet},t)})}),Y=new le({mirror:Oe,mutationCb:Z,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:_e});for(var U of R||[])U.getMirror&&U.getMirror({nodeMirror:Oe,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});var W=new Ee;Ce=new Te({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Oe,sampling:b.canvas,dataURLOptions:w});var G=new ue({mutationCb:Z,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:Y,stylesheetManager:z,canvasManager:Ce,keepIframeSrcFn:N,processedNodeManager:W},mirror:Oe});Ie=function(t){if(void 0===t&&(t=!1),I){_e({type:Ft.Meta,data:{href:window.location.href,width:_t(),height:wt()}},t),z.reset(),G.init(),Gt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return tt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Oe,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize(t){Tt(t,Oe)&&Y.addIframe(t),At(t,Oe)&&z.trackLinkElement(t),Et(t)&&G.addShadowRoot(ct.shadowRoot(t),document)},onIframeLoad(t,e){Y.attachIframe(t,e),G.observeAttachShadow(t)},onStylesheetLoad(t,e){z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");_e({type:Ft.FullSnapshot,data:{node:e,initialOffset:bt(window)}},t),Gt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))}};try{var X=[],J=t=>{var e;return Wt(ne)({mutationCb:Z,mousemoveCb:(t,e)=>_e({type:Ft.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.ViewportResize},t)}),inputCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.Input},t)}),mediaInteractionCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.MediaInteraction},t)}),styleSheetRuleCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.StyleSheetRule},t)}),styleDeclarationCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.Font},t)}),selectionCb(t){_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.Selection},t)})},customElementCb(t){_e({type:Ft.IncrementalSnapshot,data:r({source:Ot.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:A,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Oe,iframeManager:Y,stylesheetManager:z,shadowDomManager:G,processedNodeManager:W,canvasManager:Ce,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>_e({type:Ft.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};Y.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{Ie(),X.push(J(document)),Re=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(dt("DOMContentLoaded",(()=>{_e({type:Ft.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(dt("load",(()=>{_e({type:Ft.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Re=!1,Zt=void 0}}catch(t){console.warn(t)}}Pe.addCustomEvent=(t,e)=>{if(!Re)throw new Error("please add custom event after start recording");_e({type:Ft.Custom,data:{tag:t,payload:e}})},Pe.freezePage=()=>{Gt.forEach((t=>t.freeze()))},Pe.takeFullSnapshot=t=>{if(!Re)throw new Error("please take full snapshot after start recording");Ie(t)},Pe.mirror=Oe,(Fe=Me||(Me={}))[Fe.NotStarted=0]="NotStarted",Fe[Fe.Running=1]="Running",Fe[Fe.Stopped=2]="Stopped";var Le,De=Object.defineProperty,Be=(t,e,r)=>((t,e,r)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),je=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ze=Object.defineProperty,$e=(t,e,r)=>((t,e,r)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ve={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ze={};function Ye(t){if(ze[t])return ze[t];var e=globalThis[t],r=e.prototype,i=t in He?He[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]"))}))),s=t in Ve?Ve[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ze[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?ze[t]=u:r}catch(t){return r}}var Ue={};function We(t,e,r){var i,n=t+"."+String(r);if(Ue[n])return Ue[n].call(e);var s=Ye(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Ue[n]=o,o.call(e)):e[r]}var Ge={};function Xe(t,e,r){var i=t+"."+String(r);if(Ge[i])return Ge[i].bind(e);var n=Ye(t)[r];return"function"!=typeof n?e[r]:(Ge[i]=n,n.bind(e))}var Je={childNodes:t=>We("Node",t,"childNodes"),parentNode:t=>We("Node",t,"parentNode"),parentElement:t=>We("Node",t,"parentElement"),textContent:t=>We("Node",t,"textContent"),contains:(t,e)=>Xe("Node",t,"contains")(e),getRootNode:t=>Xe("Node",t,"getRootNode")(),host:t=>t&&"host"in t?We("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?We("Element",t,"shadowRoot"):null,querySelector:(t,e)=>We("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>We("Element",t,"querySelectorAll")(e),mutationObserver:()=>Ye("MutationObserver").constructor};function Ke(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Ke(Je.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Ke(Je.parentNode(t),e,r)}class Qe{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 Qe))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 tr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},er={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rr={};function ir(t){if(rr[t])return rr[t];var e=globalThis[t],r=e.prototype,i=t in tr?tr[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]"))}))),s=t in er?er[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return rr[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?rr[t]=u:r}catch(t){return r}}var nr={};function sr(t,e,r){var i,n=t+"."+String(r);if(nr[n])return nr[n].call(e);var s=ir(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(nr[n]=o,o.call(e)):e[r]}var or={};function ar(t,e,r){var i=t+"."+String(r);if(or[i])return or[i].bind(e);var n=ir(t)[r];return"function"!=typeof n?e[r]:(or[i]=n,n.bind(e))}var lr={childNodes:t=>sr("Node",t,"childNodes"),parentNode:t=>sr("Node",t,"parentNode"),parentElement:t=>sr("Node",t,"parentElement"),textContent:t=>sr("Node",t,"textContent"),contains:(t,e)=>ar("Node",t,"contains")(e),getRootNode:t=>ar("Node",t,"getRootNode")(),host:t=>t&&"host"in t?sr("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?sr("Element",t,"shadowRoot"):null,querySelector:(t,e)=>sr("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>sr("Element",t,"querySelectorAll")(e),mutationObserver:()=>ir("MutationObserver").constructor},ur="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.",hr={map:{},getId(){return console.error(ur),-1},getNode(){return console.error(ur),null},removeNodeFromMap(){console.error(ur)},has(){return console.error(ur),!1},reset(){console.error(ur)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hr=new Proxy(hr,{get(t,e,r){return"map"===e&&console.error(ur),Reflect.get(t,e,r)}}));var cr,dr=Date.now;function vr(t){return t?t.nodeType===t.ELEMENT_NODE?t:lr.parentElement(t):null}function fr(t){var e,r=null;return"getRootNode"in t&&(null==(e=lr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lr.host(lr.getRootNode(t))&&(r=lr.host(lr.getRootNode(t))),r}function pr(t){for(var e,r=t;e=fr(r);)r=e;return r}function gr(t){var e=t.ownerDocument;if(!e)return!1;var r=pr(t);return lr.contains(e,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(dr=()=>(new Date).getTime());for(var mr=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){qe(this,"id",1),qe(this,"styleIDMap",new WeakMap),qe(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 hr},closestElementOfNode:vr,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.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(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:pr,getShadowHost:fr,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=lr.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=lr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:t=>!!t&&(t instanceof Qe&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(lr.shadowRoot(t))),hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom(t){var e=t.ownerDocument;return!!e&&(lr.contains(e,t)||gr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&Je.host(i)||null,Boolean(n&&"shadowRoot"in n&&Je.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=lr.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked(t,e,r,i){if(!t)return!1;var n=vr(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(Ke(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:(t,e,r)=>!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t),isSerialized:(t,e)=>-1!==e.getId(t),isSerializedIframe:(t,e)=>Boolean("IFRAME"===t.nodeName&&e.getMeta(t)),isSerializedStylesheet:(t,e)=>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:t=>Boolean(t.changedTouches),get nowTimestamp(){return dr},on(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(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(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(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:s,parentId:o}=n;if(s&&s in e){var a=e[s];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(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:gr,throttle(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}},uniqueTextMutations(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"}))),yr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),br=0;64>br;br++)yr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(br)]=br;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var wr=document.createElement("iframe");document.body.appendChild(wr),Array.from=(null==(Le=wr.contentWindow)?void 0:Le.Array.from)||Array.from,document.body.removeChild(wr)}}catch(t){console.debug("Unable to override Array.from",t)}new class{constructor(){$e(this,"idNodeMap",new Map),$e(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){this.idNodeMap.set(e.id,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(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(cr||(cr={}));class _r{constructor(t){Be(this,"fileName"),Be(this,"functionName"),Be(this,"lineNumber"),Be(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 Ir=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Sr=/^(eval@)?(\[native code])?$/,kr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Cr)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Cr)}),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()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _r({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Sr)}),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 _r({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new _r({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new _r({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new _r({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ir)&&!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 _r({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function xr(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 s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Tr(t){return"[object Object]"==={}.toString.call(t)}function Ar(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Tr(t[i])&&Ar(t[i],e-1))return!0;return!1}function Er(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 s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,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(Tr(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Tr(o)&&Ar(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Array.isArray(u)?xr(u.length?u[0]:null):u}return a}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 Rr={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 Nr(t,e,r){var i,n=r?Object.assign({},Rr,r):Rr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=kr.parse(e.error).map((t=>t.toString())),s=[Er(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Er("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Er("Uncaught (in promise)",n.stringifyOptions),Er(e.reason,n.stringifyOptions)]);var s=kr.parse(r).map((t=>t.toString()));t({level:"error",trace:s,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]?mr.patch(e,r,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=kr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((t=>Er(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Er("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Mr=t=>({name:"rrweb/console@1",observer:Nr,options:t});function Fr(){return(Fr=e((function*(t,e){void 0===e&&(e=!0);try{var r=new Blob([t],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(t){return e&&console.error("Failed to gzip compress data",t),null}}))).apply(this,arguments)}var Or=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Pr=["$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 Lr(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var Dr=["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"],Br=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return Dr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function jr(t,e){return-1!==t.indexOf(e)}var qr=function(t){return t.trim()},Zr=function(t){return t.replace(/^\$/,"")},$r=Object.prototype,Hr=$r.hasOwnProperty,Vr=$r.toString,zr=Array.isArray||function(t){return"[object Array]"===Vr.call(t)},Yr=t=>"function"==typeof t,Ur=t=>t===Object(t)&&!zr(t),Wr=t=>{if(Ur(t)){for(var e in t)if(Hr.call(t,e))return!1;return!0}return!1},Gr=t=>void 0===t,Xr=t=>"[object String]"==Vr.call(t),Jr=t=>Xr(t)&&0===t.trim().length,Kr=t=>null===t,Qr=t=>Gr(t)||Kr(t),ti=t=>"[object Number]"==Vr.call(t)&&t==t,ei=t=>ti(t)&&t>0,ri=t=>"[object Boolean]"===Vr.call(t),ii=t=>t instanceof FormData;function ni(t){return null===t||"object"!=typeof t}function si(t,e){return{}.toString.call(t)==="[object "+e+"]"}function oi(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var ai=[!0,"true",1,"1","yes"],li=t=>jr(ai,t),ui=[!1,"false",0,"0","no"];function hi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ti(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(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),hi(n||r,e,r,i))}class ci{constructor(t){this.Pt={},this.Dt=t.Dt,this.jt=hi(t.bucketSize,0,100,t.qt),this.$t=hi(t.refillRate,0,this.jt,t.qt),this.Ht=hi(t.refillInterval,0,864e5,t.qt)}Vt(t,e){var r=Math.floor((e-t.lastAccess)/this.Ht);r>0&&(t.tokens=Math.min(t.tokens+r*this.$t,this.jt),t.lastAccess=t.lastAccess+r*this.Ht)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.Pt[i];return n?this.Vt(n,r):this.Pt[i]=n={tokens:this.jt,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.Dt)||e.call(this,t)),0===n.tokens)}stop(){this.Pt={}}}var di,vi,fi,pi="Mobile",gi="iOS",mi="Android",yi="Tablet",bi=mi+" "+yi,wi="iPad",_i="Apple",Ii=_i+" Watch",Ci="Safari",Si="BlackBerry",ki="Samsung",xi=ki+"Browser",Ti=ki+" Internet",Ai="Chrome",Ei=Ai+" OS",Ri=Ai+" "+gi,Ni="Internet Explorer",Mi=Ni+" "+pi,Fi="Opera",Oi=Fi+" Mini",Pi="Edge",Li="Microsoft "+Pi,Di="Firefox",Bi=Di+" "+gi,ji="Nintendo",qi="PlayStation",Zi="Xbox",$i=mi+" "+pi,Hi=pi+" "+Ci,Vi="Windows",zi=Vi+" Phone",Yi="Nokia",Ui="Ouya",Wi="Generic",Gi=Wi+" "+pi.toLowerCase(),Xi=Wi+" "+yi.toLowerCase(),Ji="Konqueror",Ki="(\\d+(\\.\\d+)?)",Qi=new RegExp("Version/"+Ki),tn=new RegExp(Zi,"i"),en=new RegExp(qi+" \\w+","i"),rn=new RegExp(ji+" \\w+","i"),nn=new RegExp(Si+"|PlayBook|BB10","i"),sn={"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"},on=function(t,e){return e=e||"",jr(t," OPR/")&&jr(t,"Mini")?Oi:jr(t," OPR/")?Fi:nn.test(t)?Si:jr(t,"IE"+pi)||jr(t,"WPDesktop")?Mi:jr(t,xi)?Ti:jr(t,Pi)||jr(t,"Edg/")?Li:jr(t,"FBIOS")?"Facebook "+pi:jr(t,"UCWEB")||jr(t,"UCBrowser")?"UC Browser":jr(t,"CriOS")?Ri:jr(t,"CrMo")||jr(t,Ai)?Ai:jr(t,mi)&&jr(t,Ci)?$i:jr(t,"FxiOS")?Bi:jr(t.toLowerCase(),Ji.toLowerCase())?Ji:((t,e)=>e&&jr(e,_i)||function(t){return jr(t,Ci)&&!jr(t,Ai)&&!jr(t,mi)}(t))(t,e)?jr(t,pi)?Hi:Ci:jr(t,Di)?Di:jr(t,"MSIE")||jr(t,"Trident/")?Ni:jr(t,"Gecko")?Di:""},an={[Mi]:[new RegExp("rv:"+Ki)],[Li]:[new RegExp(Pi+"?\\/"+Ki)],[Ai]:[new RegExp("("+Ai+"|CrMo)\\/"+Ki)],[Ri]:[new RegExp("CriOS\\/"+Ki)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ki)],[Ci]:[Qi],[Hi]:[Qi],[Fi]:[new RegExp("(Opera|OPR)\\/"+Ki)],[Di]:[new RegExp(Di+"\\/"+Ki)],[Bi]:[new RegExp("FxiOS\\/"+Ki)],[Ji]:[new RegExp("Konqueror[:/]?"+Ki,"i")],[Si]:[new RegExp(Si+" "+Ki),Qi],[$i]:[new RegExp("android\\s"+Ki,"i")],[Ti]:[new RegExp(xi+"\\/"+Ki)],[Ni]:[new RegExp("(rv:|MSIE )"+Ki)],Mozilla:[new RegExp("rv:"+Ki)]},ln=function(t,e){var r=on(t,e),i=an[r];if(Gr(i))return null;for(var n=0;i.length>n;n++){var s=t.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},un=[[new RegExp(Zi+"; "+Zi+" (.*?)[);]","i"),t=>[Zi,t&&t[1]||""]],[new RegExp(ji,"i"),[ji,""]],[new RegExp(qi,"i"),[qi,""]],[nn,[Si,""]],[new RegExp(Vi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zi,""];if(new RegExp(pi).test(e)&&!/IEMobile\b/.test(e))return[Vi+" "+pi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=sn[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[Vi,i]}return[Vi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gi,[t[3],t[4],t[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Gr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),t=>t&&t[2]?[mi,[t[2],t[3],t[4]||"0"].join(".")]:[mi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ei,""]],[/Linux|debian/i,["Linux",""]]],hn=function(t){return rn.test(t)?ji:en.test(t)?qi:tn.test(t)?Zi:new RegExp(Ui,"i").test(t)?Ui:new RegExp("("+zi+"|WPDesktop)","i").test(t)?zi:/iPad/.test(t)?wi:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ii:nn.test(t)?Si:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Yi,"i").test(t)?Yi:/(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(pi).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)?mi:bi:new RegExp("(pda|"+pi+")","i").test(t)?Gi:new RegExp(yi,"i").test(t)&&!new RegExp(yi+" pc","i").test(t)?Xi:""},cn=function(t,e){var r,i,n,s,o=hn(t);return o===wi||o===bi||"Kobo"===o||"Kindle Fire"===o||o===Xi?yi:o===ji||o===Zi||o===qi||o===Ui?"Console":o===Ii?"Wearable":o?pi:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pi:yi:"Desktop"};function dn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return fi&&r.length===vi||(vi=r.length,fi=r.reduce(((r,i)=>{di||(di={});var n=di[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,di[i]=[l,u];break}}return r}),{})),fi}}class vn{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(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&zr(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?e.skipFirstLines: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,s,o={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!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){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 fn="?";function pn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?fn:r,in_app:!0};return Gr(i)||(s.lineno=i),Gr(n)||(s.colno=n),s}var gn=(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]:fn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},mn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bn=/\((\S*)(?::(\d+))(?::(\d+))\)/,wn=(t,e)=>{var r=mn.exec(t);if(r){var[,i,n,s]=r;return pn(e,i,fn,+n,+s)}var o=yn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=bn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=gn(o[1]||fn,o[2]);return pn(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},_n=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cn=(t,e)=>{var r=_n.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=In.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||fn;return[s,n]=gn(s,n),pn(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Sn=/\(error: (.*)\)/,kn=50;class xn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Xr(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 si(t,"DOMException")}isDOMError(t){return si(t,"DOMError")}}class Tn{match(t){return t instanceof Error}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 String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class An{constructor(){}match(t){return si(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var En=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Rn{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(En);return i&&(e=i[1],r=i[2]),[e,r]}}var Nn=["fatal","error","warning","log","info","debug"];function Mn(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(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Fn{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 oi(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: "+Mn(t)}isSeverityLevel(t){return Xr(t)&&!Jr(t)&&Nn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(r instanceof Error)return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class On{match(t){return oi(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Mn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Pn{match(t){return ni(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 Ln{match(t){return si(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!oi(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return ni(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){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Dn="undefined"!=typeof window?window:void 0,Bn="undefined"!=typeof globalThis?globalThis:Dn;"undefined"==typeof self&&(Bn.self=Bn),"undefined"==typeof File&&(Bn.File=function(){});var jn=null==Bn?void 0:Bn.navigator,qn=null==Bn?void 0:Bn.document,Zn=null==Bn?void 0:Bn.location,$n=null==Bn?void 0:Bn.fetch,Hn=null!=Bn&&Bn.XMLHttpRequest&&"withCredentials"in new Bn.XMLHttpRequest?Bn.XMLHttpRequest:void 0,Vn=null==Bn?void 0:Bn.AbortController,zn=null==Bn?void 0:Bn.CompressionStream,Yn=null==jn?void 0:jn.userAgent,Un=null!=Dn?Dn:{},Wn=t=>t instanceof Document,Gn="1.366.2",Xn={DEBUG:!1,LIB_VERSION:Gn,LIB_NAME:"web",JS_SDK_VERSION:Gn},Jn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={C(e){if(Dn&&(Xn.DEBUG||Un.POSTHOG_DEBUG||r)&&!Gr(Dn.console)&&Dn.console){for(var i=("__rrweb_original__"in Dn.console[e]?Dn.console[e].__rrweb_original__:Dn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Jn(t+" "+e,r)};return i},Kn=Jn("[PostHog.js]"),Qn=Kn.createLogger;function ts(t,e){zr(t)&&t.forEach(e)}function es(t,e){if(!Qr(t))if(zr(t))t.forEach(e);else if(ii(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Hr.call(t,r)&&e(t[r],r)}var rs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function is(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 ns=function(t){try{return t()}catch(t){return}},ss=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){Kn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Kn.critical(t)}}},os=function(t){var e={};return es(t,(function(t,r){(Xr(t)&&t.length>0||ti(t))&&(e[r]=t)})),e};var as=["herokuapp.com","vercel.app","netlify.app"];function ls(t){var e=null==t?void 0:t.hostname;if(!Xr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of as)if(r===i)return!1;return!0}function us(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}function hs(t){return"ph_toolbar_internal"===t.name}var cs=t=>{var e=null==qn?void 0:qn.createElement("a");return Gr(e)?null:(e.href=t,e)},ds=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return es(t,(function(t,e){Gr(t)||Gr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},vs=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!zr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){Kn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},fs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");zr(c)&&(e.includes(c[0])?u.push(c[0]+"="+r):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=n&&(d+="#"+n),d},ps=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function gs(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Yr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function ms(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 s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var ys="$people_distinct_id",bs="$device_id",ws="__alias",_s="__timers",Is="$autocapture_disabled_server_side",Cs="$heatmaps_enabled_server_side",Ss="$exception_capture_enabled_server_side",ks="$error_tracking_suppression_rules",xs="$error_tracking_capture_extension_exceptions",Ts="$web_vitals_enabled_server_side",As="$dead_clicks_enabled_server_side",Es="$product_tours_enabled_server_side",Rs="$web_vitals_allowed_metrics",Ns="$session_recording_remote_config",Ms="$sesid",Fs="$session_is_sampled",Os="$enabled_feature_flags",Ps="$early_access_features",Ls="$feature_flag_details",Ds="$stored_person_properties",Bs="$stored_group_properties",js="$surveys",qs="$flag_call_reported",Zs="$flag_call_reported_session_id",$s="$feature_flag_errors",Hs="$feature_flag_evaluated_at",Vs="$user_state",zs="$client_session_props",Ys="$capture_rate_limit",Us="$initial_campaign_params",Ws="$initial_referrer_info",Gs="$initial_person_info",Xs="$epp",Js="__POSTHOG_TOOLBAR__",Ks="$posthog_cookieless",Qs=[ys,ws,"__cmpns",_s,"$session_recording_enabled_server_side",Cs,Ms,Os,ks,Vs,Ps,Ls,Bs,Ds,js,qs,Zs,$s,Hs,zs,Ys,Us,Ws,Xs,Gs],to="PostHog loadExternalDependency extension not found.",eo="on_reject",ro="always",io="anonymous",no="identified",so="identified_only",oo="visibilitychange",ao="beforeunload",lo="$pageview",uo="$pageleave",ho="$identify",co="$groupidentify";function vo(t){return t instanceof Element&&(t.id===Js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function fo(t){return!!t&&1===t.nodeType}function po(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function go(t){return!!t&&3===t.nodeType}function mo(t){return!!t&&11===t.nodeType}function yo(t){return t?qr(t).split(/\s+/):[]}function bo(t){var e=null==Dn?void 0:Dn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function wo(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 yo(e)}function _o(t){return Qr(t)?null:qr(t).split(/(\s+)/).filter((t=>jo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(t){var e="";return No(t)&&!Mo(t)&&t.childNodes&&t.childNodes.length&&es(t.childNodes,(function(t){var r;go(t)&&t.textContent&&(e+=null!==(r=_o(t.textContent))&&void 0!==r?r:"")})),qr(e)}function Co(t){return Gr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var So=["a","button","form","input","select","textarea","label"];function ko(t,e){if(Gr(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 xo(t){var e=t.parentNode;return!(!e||!fo(e))&&e}var To=["next","previous","prev",">","<"],Ao=[".ph-no-rageclick",".ph-no-capture"];var Eo=t=>!t||po(t,"html")||!fo(t),Ro=(t,e)=>{if(!Dn||Eo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=xo(n);if(!s)break;if(e||So.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Dn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function No(t){for(var e=t;e.parentNode&&!po(e,"body");e=e.parentNode){var r=wo(e);if(jr(r,"ph-sensitive")||jr(r,"ph-no-capture"))return!1}if(jr(wo(t),"ph-include"))return!0;var i=t.type||"";if(Xr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!Xr(n)||!/^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,""))}function Mo(t){return!!(po(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||po(t,"select")||po(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fo="(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})",Oo=new RegExp("^(?:"+Fo+")$"),Po=new RegExp(Fo),Lo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Lo+")$"),Bo=new RegExp("("+Lo+")");function jo(t,e){if(void 0===e&&(e=!0),Qr(t))return!1;if(Xr(t)){if(t=qr(t),(e?Oo:Po).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Do:Bo).test(t))return!1}return!0}function qo(t){var e=Io(t);return jo(e=(e+" "+Zo(t)).trim())?e:""}function Zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&es(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Io(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Zo(t)).trim())}catch(t){Kn.error("[AutoCapture]",t)}})),e}function $o(t){return t.replace(/"|\\"/g,'\\"')}function Ho(t){var e=t.attr__class;return e?zr(e)?e:yo(e):void 0}var Vo={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"]},zo=Qn("[Recorder]"),Yo=t=>"navigation"===t.entryType,Uo=t=>"resource"===t.entryType;function Wo(t,e){return!!e&&(ri(e)||e[t])}function Go(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(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(ri(r))return!0;if(zr(r))return s(r);var o=r[e];return ri(o)?o:s(o)}function Xo(t,e,r,i,n,s){return Jo.apply(this,arguments)}function Jo(){return Jo=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return zo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Uo(o=t[s])&&o.initiatorType===e&&(Gr(i)||o.startTime>=i)&&(Gr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Xo(t,e,r,i,n,s+1))})),Jo.apply(this,arguments)}function Ko(t){var{body:e,options:r,url:i}=t;if(Qr(e))return null;var{hostname:n,isHostDenied:s}=ms(i,r);if(s)return n+" is in deny list";if(Xr(e))return e;if(Wn(e))return e.textContent;if(ii(e))return ds(e);if(Ur(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 Qo=t=>!Kr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ta(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,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:Gr(a)?void 0:Math.round(a),endTime:Gr(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Qo(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 ea=["video/","audio/"];function ra(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function ia(){return ia=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=ms(i,r);return s?Promise.resolve(n+" is in deny list"):ra(e)})),ia.apply(this,arguments)}function na(){return na=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 s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ea.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=ms(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return Kr(n)?ra(e):Promise.resolve(n)})),na.apply(this,arguments)}var sa=null;function oa(t,i,n){if(!("performance"in i))return()=>{};if(sa)return zo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Vo,n):Vo,o=e=>{var i=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Yo(t)||Uo(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ta({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=>Yo(t)||Uo(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ta({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Wo("request",r.recordHeaders),n=Wo("response",r.recordHeaders),s=gs(e.XMLHttpRequest.prototype,"open",(s=>function(o,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=>(Go({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Ko({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=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),Go({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Ko({body:v.response,options:r,url:a})),Xo(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ta({entry:e,method:o,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",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Wo("request",i.recordHeaders),s=Wo("response",i.recordHeaders),o=gs(r,"fetch",(o=>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),Go({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return ia.apply(this,arguments)}({r:c,options:i,url:e})),u=r.performance.now(),l=yield o(c),h=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),Go({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return na.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Xo(r,"fetch",c.url,u,h).then((e=>{var r,i=ta({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()=>{o()}}(o,i,s)),sa=()=>{a(),l(),u(),sa=null}}var aa=t=>({name:"rrweb/network@1",observer:oa,options:t});Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Mr,getRecordNetworkPlugin:aa},Un.__PosthogExtensions__.rrweb={record:Pe,version:"v2"},Un.rrweb={record:Pe,version:"v2"},Un.rrwebConsoleRecord={getRecordConsolePlugin:Mr},Un.getRecordNetworkPlugin=aa;var la,ua,ha,ca,da,va,fa,pa,ga,ma,ya,ba,wa={},_a=[],Ia=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ca=Array.isArray;function Sa(t,e){for(var r in e)t[r]=e[r];return t}function ka(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?la.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Ta(t,o,i,n,null)}function Ta(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ha:n,__i:-1,__u:0};return null==n&&null!=ua.vnode&&ua.vnode(s),s}function Aa(t){return t.children}function Ea(t,e){this.props=t,this.context=e}function Ra(t,e){if(null==e)return t.__?Ra(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ra(t):null}function Na(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Na(t)}}function Ma(t){(!t.__d&&(t.__d=!0)&&ca.push(t)&&!$.__r++||da!=ua.debounceRendering)&&((da=ua.debounceRendering)||va)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ca.length;)ca.length>a&&ca.sort(fa),t=ca.shift(),a=ca.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Sa({},i)).__v=i.__v+1,ua.vnode&&ua.vnode(r),ja(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Ra(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Za(s,r,o),i.__e=i.__=null,r.__e!=n&&Na(r)));$.__r=0}function Fa(t,e,r,i,n,s,o,a,l,u,h){var c,d,v,f,p,g,m,y=i&&i.__k||_a,b=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Ta(null,o,null,null,null):Ca(o)?o=t.__k[s]=Ta(Aa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Ta(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=Pa(o,r,l,c))&&(c--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?d--:u==l+1?d++:(u>l?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Ra(a)),Va(a,a));return i}(r,e,y,l,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?wa:y[v.__i]||wa,v.__i=c,g=ja(t,v,d,n,s,o,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),(m=!!(4&v.__u))||d.__k===v.__k?l=Oa(v,l,t,m):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function Oa(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Oa(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ra(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Pa(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ia.test(e)?r:r+"px"}function Da(t,e,r,i,n){var s,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])s=e!=(e=e.replace(pa,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=ga,t.addEventListener(e,s?ya:ma,s)):t.removeEventListener(e,s?ya:ma,s);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=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,"popover"==e&&1==r?"":r))}}function Ba(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=ga++;else if(r.u>e.t)return;return r(ua.event?ua.event(e):e)}}}function ja(t,e,r,i,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ua.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new Ea(m,w),c.constructor=x,c.render=za),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Sa({},c.__s)),Sa(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){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.some((function(t){t&&(t.__=e)})),$=0;c._sb.length>$;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ua.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),C=0;c._sb.length>C;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&&25>++I);c.state=c.__s,null!=c.getChildContext&&(i=Sa(Sa({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Aa&&null==h.key&&(S=$a(h.props.children)),a=Fa(t,Ca(S)?S:[S],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(k=s.length;k--;)ka(s[k]);qa(e)}else e.__e=r.__e,e.__k=r.__k,t.then||qa(e);ua.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,l){var u,h,c,d,v,f,p,g=r.props||wa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ua.__m&&ua.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&la.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)if(v=g[u],"children"==u);else if("dangerouslySetInnerHTML"==u)c=v;else if(!(u in m)){if("value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m)continue;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: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("template"==e.type?t.content:t,Ca(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Ra(r,0),a,l),null!=s)for(u=s.length;u--;)ka(s[u]);a||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Da(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Da(t,u,p,g[u],n))}return t}(r.__e,e,r,i,n,s,o,l,u);return(h=ua.diffed)&&h(e),128&e.__u?void 0:a}function qa(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(qa)}function Za(t,e,r){for(var i=0;r.length>i;i++)Ha(r[i],r[++i],r[++i]);ua.__c&&ua.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ua.__e(t,e.__v)}}))}function $a(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ca(t)?t.map($a):Sa({},t)}function Ha(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ua.__e(t,r)}}function Va(t,e,r){var i,n;if(ua.unmount&&ua.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){ua.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Va(i[n],e,r||"function"!=typeof t.type);r||ka(t.__e),t.__c=t.__=t.__e=void 0}function za(t,e,r){return this.constructor(t,r)}function Ya(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ua.__&&ua.__(t,e),i=e.__k,n=[],s=[],ja(e,t=e.__k=xa(Aa,null,[t]),i||wa,wa,e.namespaceURI,i?null:e.firstChild?la.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Za(n,t,s)}la=_a.slice,ua={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ha=0,Ea.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Sa({},this.state),"function"==typeof t&&(t=t(Sa({},r),this.props)),t&&Sa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ma(this))},Ea.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ma(this))},Ea.prototype.render=Aa,ca=[],va="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,pa=/(PointerCapture)$|Capture$/i,ga=0,ma=Ba(!1),ya=Ba(!0),ba=0;var Ua,Wa,Ga,Xa,Ja=0,Ka=[],Qa=ua,tl=Qa.__b,el=Qa.__r,rl=Qa.diffed,il=Qa.__c,nl=Qa.unmount,sl=Qa.__;function ol(t,e){Qa.__h&&Qa.__h(Wa,t,Ja||e),Ja=0;var r=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function al(t){return Ja=1,function(t,e,r){var i=ol(Ua++,2);if(i.t=t,!i.__c&&(i.__=[yl(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.__f)){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!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};Wa.__f=!0;var s=Wa.shouldComponentUpdate,o=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Wa.shouldComponentUpdate=n}return i.__N||i.__}(yl,t)}function ll(t,e){var r=ol(Ua++,3);!Qa.__s&&ml(r.__H,e)&&(r.__=t,r.u=e,Wa.__H.__h.push(r))}function ul(t){return Ja=5,hl((function(){return{current:t}}),[])}function hl(t,e){var r=ol(Ua++,7);return ml(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function cl(t){var e=Wa.context[t.__c],r=ol(Ua++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Wa)),e.props.value):t.__}function dl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(pl),t.__H.__h.forEach(gl),t.__H.__h=[]}catch(e){t.__H.__h=[],Qa.__e(e,t.__v)}}Qa.__b=function(t){Wa=null,tl&&tl(t)},Qa.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),sl&&sl(t,e)},Qa.__r=function(t){el&&el(t),Ua=0;var e=(Wa=t.__c).__H;e&&(Ga===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(pl),e.__h.forEach(gl),e.__h=[],Ua=0)),Ga=Wa},Qa.diffed=function(t){rl&&rl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===Qa.requestAnimationFrame||((Xa=Qa.requestAnimationFrame)||fl)(dl)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),Ga=Wa=null},Qa.__c=function(t,e){e.some((function(t){try{t.__h.forEach(pl),t.__h=t.__h.filter((function(t){return!t.__||gl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Qa.__e(r,t.__v)}})),il&&il(t,e)},Qa.unmount=function(t){nl&&nl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{pl(t)}catch(t){e=t}})),r.__H=void 0,e&&Qa.__e(e,r.__v))};var vl="function"==typeof requestAnimationFrame;function fl(t){var e,r=function(){clearTimeout(i),vl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);vl&&(e=requestAnimationFrame(r))}function pl(t){var e=Wa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Wa=e}function gl(t){var e=Wa;t.__c=t.__(),Wa=e}function ml(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function yl(t,e){return"function"==typeof e?e(t):e}var bl="events",wl="cancelEvents",_l={Tab:"tab",Selector:"selector"},Il={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Cl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Sl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},xl={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Tl="always",Al={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},El={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Rl="popover",Nl=Qn("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Fl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ol(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Pl="seenSurvey_",Ll="inProgressSurvey_",Dl=(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},Bl=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},jl=t=>Bl(Pl,t),ql=t=>{localStorage.getItem(jl(t))||localStorage.setItem(jl(t),"true")},Zl=[Sl.Popover,Sl.Widget,Sl.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Rl};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ti(t)&&isFinite(t)&&Math.floor(t)===t});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)||0>t||0>e||0>r||0>i||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;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),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;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Vl{constructor(){this.I=0,this.S=0,this.k=new Ul}generate(){var t=this.generateOrAbort();if(Gr(t)){this.I=0;var e=this.generateOrAbort();if(Gr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Hl.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var zl,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;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Dn&&!Gr(Dn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Ul{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(Yl(this.T),this.N=0),this.T[this.N++]}}var Wl=()=>Gl().toString(),Gl=()=>(zl||(zl=new Vl)).generate(),Xl="gzip-js",Jl="base64",Kl=Uint8Array,Ql=Uint16Array,tu=Uint32Array,eu=new Kl([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]),ru=new Kl([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]),iu=new Kl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nu=function(t,e){for(var r=new Ql(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new tu(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},su=nu(eu,2),ou=su[1];su[0][28]=258,ou[258]=28;for(var au=nu(ru,0)[1],lu=new Ql(32768),uu=0;32768>uu;++uu){var hu=(43690&uu)>>>1|(21845&uu)<<1;lu[uu]=((65280&(hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4))>>>8|(255&hu)<<8)>>>1}var cu=function(t,e,r){for(var i=t.length,n=0,s=new Ql(e);i>n;++n)++s[t[n]-1];var o,a=new Ql(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ql(1<<e);var l=15-e;for(n=0;i>n;++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;d>=c;++c)o[lu[c]>>>l]=u}else for(o=new Ql(i),n=0;i>n;++n)o[n]=lu[a[t[n]-1]++]>>>15-t[n];return o},du=new Kl(288);for(uu=0;144>uu;++uu)du[uu]=8;for(uu=144;256>uu;++uu)du[uu]=9;for(uu=256;280>uu;++uu)du[uu]=7;for(uu=280;288>uu;++uu)du[uu]=8;var vu=new Kl(32);for(uu=0;32>uu;++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 Ql?Ql:t instanceof tu?tu:Kl)(r-e);return i.set(t.subarray(e,r)),i},yu=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},bu=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},wu=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new Kl(0),0];if(1==n){var o=new Kl(r[0].s+1);return o[r[0].s]=1,[o,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[c].f>r[u].f?u++:c++],l=r[u!=h&&r[c].f>r[u].f?u++:c++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var v=new Ql(d+1),f=_u(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new Kl(v),f]},_u=function(t,e,r){return-1==t.s?Math.max(_u(t.l,e,r+1),_u(t.r,e,r+1)):e[t.s]=r},Iu=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ql(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},Cu=function(t,e){for(var r=0,i=0;e.length>i;++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 s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},ku=function(t,e,r,i,n,s,o,a,l,u,h){yu(e,h++,r),++n[256];for(var c=wu(n,15),d=c[0],v=c[1],f=wu(s,15),p=f[0],g=f[1],m=Iu(d),y=m[0],b=m[1],w=Iu(p),_=w[0],I=w[1],C=new Ql(19),S=0;y.length>S;++S)C[31&y[S]]++;for(S=0;_.length>S;++S)C[31&_[S]]++;for(var k=wu(C,7),x=k[0],T=k[1],A=19;A>4&&!x[iu[A-1]];--A);var E,R,N,M,F=u+5<<3,O=Cu(n,du)+Cu(s,vu)+o,P=Cu(n,d)+Cu(s,p)+o+14+3*A+Cu(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(O>=F&&P>=F)return Su(e,h,t.subarray(l,l+u));if(yu(e,h,1+(O>P)),h+=2,O>P){E=cu(d,v,0),R=d,N=cu(p,g,0),M=p;var L=cu(x,T,0);for(yu(e,h,b-257),yu(e,h+5,I-1),yu(e,h+10,A-4),h+=14,S=0;A>S;++S)yu(e,h+3*S,x[iu[S]]);h+=3*A;for(var D=[y,_],B=0;2>B;++B){var j=D[B];for(S=0;j.length>S;++S)yu(e,h,L[q=31&j[S]]),h+=x[q],q>15&&(yu(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=fu,R=du,N=pu,M=vu;for(S=0;a>S;++S)if(i[S]>255){var q;bu(e,h,E[257+(q=i[S]>>>18&31)]),h+=R[q+257],q>7&&(yu(e,h,i[S]>>>23&31),h+=eu[q]);var Z=31&i[S];bu(e,h,N[Z]),h+=M[Z],Z>3&&(bu(e,h,i[S]>>>5&8191),h+=ru[Z])}else bu(e,h,E[i[S]]),h+=R[i[S]];return bu(e,h,E[256]),h+R[256]},xu=new tu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tu=function(){for(var t=new tu(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Au=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Eu(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Tu[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new Kl(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?u=Su(l,u,t.subarray(h,c)):(l[h]=!0,u=Su(l,u,t.subarray(h,o)))}else{for(var d=xu[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Ql(32768),m=new Ql(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new tu(25e3),I=new Ql(288),C=new Ql(32),S=0,k=0,x=(h=0,0),T=0,A=0;o>h;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,h>=T){var M=o-h;if((S>7e3||x>24576)&&M>423){u=ku(t,l,0,_,I,C,k,x,A,h-A,u),x=S=k=0,A=h;for(var F=0;286>F;++F)I[F]=0;for(F=0;30>F;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),q=Math.min(258,M);j>=D&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var Z=0;q>Z&&t[h+Z]==t[h+Z-D];++Z);if(Z>O){if(O=Z,P=D,Z>B)break;var H=Math.min(D,Z-2),V=0;for(F=0;H>F;++F){var z=h-D+F+32768&32767,Y=z-g[z]+32768&32767;Y>V&&(V=Y,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|ou[O]<<18|au[P];var U=31&ou[O],W=31&au[P];k+=eu[U]+ru[W],++I[257+U],++C[W],T=h+O,++S}else _[x++]=t[h],++I[t[h]]}}u=ku(t,l,!0,_,I,C,k,x,A,h-A,u)}return mu(a,0,i+gu(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Au(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),Au(l,u-8,r.d()),Au(l,u-4,i),l}var Ru=!!Hn||!!$n,Nu="text/plain",Mu=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),l=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=ds(a);return u&&l.push(u),s+"?"+l.join("&")},Fu=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Ou=t=>{if(t.zt)return t.zt;var{data:e,compression:r}=t;if(e){if(r===Xl){var i=Eu(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Kl(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new Kl(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return mu(i,0,n)}(Fu(e)),{mtime:0});return{contentType:Nu,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Jl){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Fu(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Fu(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Fu(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Pu=function(){var t=e((function*(t){var e=Fu(t.data),i=yield function(t,e){return Fr.apply(this,arguments)}(e,Xn.DEBUG);if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{zt:{contentType:Nu,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Lu=[];$n&&Lu.push({transport:"fetch",method(t){var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=Ou(t))&&void 0!==e?e:{},a=new Headers;es(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(Vn){var h=new Vn;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}$n(l,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&52428.8>(o||0),body:s,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){Kn.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{Kn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),Hn&&Lu.push({transport:"XHR",method(t){var e,r=new Hn;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Ou(t))&&void 0!==e?e:{};es(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!=jn&&jn.sendBeacon&&Lu.push({transport:"sendBeacon",method(t){var e=Mu(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Ou(t))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});jn.sendBeacon(e,s)}catch(t){}}});var Du=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 Bu(t,e,r){return Fu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var ju={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=>Du(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Du(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 Zu(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(Gr(n)||Kr(n))return!1;var s=[String(n)],o=ju[i.operator];return!!o&&o(i.values,s)}))}var $u=Qn("[Stylesheet Loader]"),Hu=Dn,Vu=qn;function zu(t){return"$survey_response_"+t}var Yu="#020617",Uu={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:Il.Right,widgetType:_l.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),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:Yu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Wu=[Il.Center,Il.Left,Il.Right];function Gu(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=Uu.backgroundColor),"#"===t[0]&&(e=Gu(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=Gu(r)),!e)return Yu;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Yu:"white"}return Yu}var Ju=(t,e,i)=>{var n=mh(t),s=Vu.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Vu.createElement("div");((t,e,i)=>{var n=r({},Uu,i),s=t.style,o=!Wu.includes(n.position)||e===Sl.Widget&&(null==i?void 0:i.widgetType)===_l.Tab;s.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)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Xu(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Xu(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Xu(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Xu(n.widgetColor)),s.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"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Xu(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=':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:2147483645;--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}.rating-options-emoji-2{justify-content:space-around}.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{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.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)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.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)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||($u.error("prepare_external_dependency_stylesheet returned null"),null)})(Vu,0,t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Vu.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ku=(t,e)=>{if(!e)return null;var r=t[zu(e)];return zr(r)?[...r]:r},Qu=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=t;s?(ql(i),s.capture(Al.SENT,r({[El.SURVEY_NAME]:i.name,[El.SURVEY_ID]:i.id,[El.SURVEY_ITERATION]:i.current_iteration,[El.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[El.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:Ku(e,t.id)}))),[El.SURVEY_SUBMISSION_ID]:n,[El.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,a,{$set:{[Dl(i,"responded")]:!0}})),o&&(Hu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),gh(i))):Nl.error("[survey sent] event not captured, PostHog instance not found.")},th=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!Qr(t))).length>0,eh=(t,e,i)=>r({[El.SURVEY_NAME]:t.name,[El.SURVEY_ID]:t.id,[El.SURVEY_ITERATION]:t.current_iteration,[El.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[El.SURVEY_PARTIALLY_COMPLETED]:th(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[El.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[El.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Ku((null==e?void 0:e.responses)||{},t.id)})))}),rh=(t,e,i)=>{if(e){if(!i){var n=fh(t);e.capture(Al.DISMISSED,r({},eh(t,n,e),{$set:{[Dl(t,"dismissed")]:!0}})),gh(t),ql(t),Hu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Nl.error("[survey dismissed] event not captured, PostHog instance not found.")},ih=(t,e)=>{if(e){var r=(t=>Bl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=fh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Al.ABANDONED,eh(t,i,e),{transport:"sendBeacon"})}}else Nl.error("[survey abandoned] event not captured, PostHog instance not found.")},nh=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,oh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,nh(t.questions)):t.questions,ah=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===Tl||ph(t)},lh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,Ma(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+ba++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0}),uh=()=>cl(lh),hh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=Sa({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?la.call(arguments,2):r),Ta(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function ch(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Hu||null==(r=Hu.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return ju[o](s,[n])}var dh=t=>{var e=""+Ll+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ll+t.id+"_"+t.current_iteration),e},vh=(t,e)=>{try{localStorage.setItem(dh(t),JSON.stringify(e))}catch(t){Nl.error("Error setting in-progress survey state in localStorage",t)}},fh=t=>{try{var e=localStorage.getItem(dh(t));if(e)return JSON.parse(e)}catch(t){Nl.error("Error getting in-progress survey state from localStorage",t)}return null},ph=t=>{var e=fh(t);return!Qr(null==e?void 0:e.surveySubmissionId)},gh=t=>{try{localStorage.removeItem(dh(t))}catch(t){Nl.error("Error clearing in-progress survey state from localStorage",t)}};function mh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function yh(t,e,r){if(void 0===e&&(e=Il.Right),t===Sl.ExternalSurvey)return{};switch(e){case Il.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Il.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Il.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Il.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Il.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Il.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Il.Left:return{left:"30px"};case Il.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Sl.Widget&&r===_l.Tab?"60px":"30px"}}}var bh=0;function wh(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ua.vnode&&ua.vnode(u),u}var _h=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"})}),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.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"})}),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:"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"})}),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:"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"})}),xh=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wh("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Th=wh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wh("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Ah=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return wh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[wh("title",{id:"close-survey-title",className:"adam-testing",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:e})]})},Eh=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 Rh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return wh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Eh]})}function Nh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:l}=cl(lh);return wh("div",{className:"bottom-section",children:[!a&&wh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Dn||Dn.open(s)),l?null==o||o():n()},children:e}),!i.whiteLabel&&wh(Rh,{urlParams:{utm_source:"survey-footer"}})]})}function Mh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return wh("div",{class:"question-header",children:[wh(e.type===kl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&hh({component:xa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Fh(t){var{onClick:e}=t,{isPreviewMode:r}=cl(lh);return wh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Ah({fill:"black"})})}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 Oh=Dn;function Ph(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=cl(lh);return ll((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return us(Oh,"keydown",t),()=>{Oh.removeEventListener("keydown",t)}}),[o]),wh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wh(Fh,{onClick:()=>o()}),wh("h3",{className:"thank-you-message-header",children:e}),r&&hh({component:xa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&wh(Nh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Lh=t=>zr(t)&&t.every((t=>Xr(t)));function Dh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:l}=uh(),u=ul(null),[h,c]=al((()=>Xr(a)?a:""));ll((()=>{setTimeout((()=>{var t;l||null==(t=u.current)||t.focus()}),100)}),[l]);var d="surveyQuestion"+o,v=hl((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Or.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Or.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Lr(e.validation,Or.MinLength),p=Lr(e.validation,Or.MaxLength),g=hl((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{question:e,forceDisableHtml:r,htmlFor:d}),wh("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation()},value:h}),g&&wh("div",{className:"validation-hint",children:g})]}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function Bh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return wh(Aa,{children:[wh("div",{className:"question-container",children:wh(Mh,{question:e,forceDisableHtml:r})}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function jh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=r.scale,h=10===r.scale?0:1,[c,d]=al((()=>ti(l)?l:zr(l)&&l.length>0&&ti(parseInt(l[0]))?parseInt(l[0]):Xr(l)&&ti(parseInt(l))?parseInt(l):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=uh(),p=t=>f?a(t):o(t);return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{question:r,forceDisableHtml:i}),wh("div",{className:"rating-section",children:[wh("div",{className:"rating-options",children:["emoji"===r.display&&wh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=zh[r.scale])?void 0:e.map(((t,e)=>wh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&wh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-h+1)+", minmax(0, 1fr))"},children:Yh(r.scale).map(((t,e)=>wh(qh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&wh("div",{className:"rating-text",children:[wh("div",{children:r.lowerBoundLabel}),wh("div",{children:r.upperBoundLabel})]})]})]}),wh(Nh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Kr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function qh(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 Zh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=ul(null),h=hl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=sh(e,nh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=al((()=>((t,e)=>Xr(t)||Lh(t)?t:e===kl.SingleChoice?null:[])(l,e.type))),[v,f]=al((()=>((t,e)=>{if(Xr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Lh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=uh(),g=e.type===kl.SingleChoice,m=e.type===kl.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&&(o(t),p&&a(t)));m&&zr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=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||!Kr(c)&&(!zr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),C=()=>{v.isSelected&&m?zr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return wh(Aa,{children:[wh("div",{className:"question-container",children:[wh(Mh,{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,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:zr(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:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),wh("span",{children:i?t+":":t})]}),i&&wh("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick(e){v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),wh(Nh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var $h=[1,2,3,4,5],Hh=[1,2,3,4,5,6,7],Vh=[0,1,2,3,4,5,6,7,8,9,10],zh={2:[xh,Th],3:[Ch,Ih,_h],5:[Sh,Ch,Ih,_h,kh]};function Yh(t){switch(t){case 5:default:return $h;case 7:return Hh;case 10:return Vh}}var Uh=Qn("[Surveys]");function Wh(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?xl.End:s;if(n.branching.type===xl.End)return xl.End;if(n.branching.type===xl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===xl.ResponseBased){if(n.type===kl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===xl.End?xl.End:s}}else if(n.type===kl.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(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||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(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 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===xl.End?xl.End:s}}return s}return Uh.warn("Falling back to next question index due to unexpected branching type"),s}var Gh=Dn,Xh=qn,Jh="ph:show_survey_widget",Kh="PHWidgetSurveyClickListener";function Qh(t,e){try{var r=t.getBoundingClientRect(),i=Gh.innerHeight,n=Gh.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Uu.zIndex}}catch(t){return Nl.warn("Failed to calculate trigger position:",t),null}}class tc{constructor(t){var e=this;this.R=new Map,this.M=new Map,this.O=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(js);if(t)for(var e of t)ph(e)&&ih(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=null!=e&&e.position||null!=e&&e.selector?r({},t,{appearance:r({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.F(a.id);var{properties:l,initialResponses:u}=null!=e?e:{},h=!(!u||0>=Object.keys(u).length)&&this.B(a,u,l);if(!h||null!=(i=a.appearance)&&i.displayThankYouMessage){this.Z(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Il.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var d,v=Xh.querySelector(a.appearance.widgetSelector);v&&(c=Qh(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||Uu.maxWidth))||{})}var f=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:p}=Ju(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.D,properties:l,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(0>=f)return Ya(wh(nc,r({},g)),p);var m=setTimeout((()=>{if(this.R.delete(a.id),!ch(a))return this.D(a);Ya(wh(nc,r({},g,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.R.set(a.id,m)}},this.V=t=>{var{shadow:e,isNewlyCreated:r}=Ju(t,this._posthog);r&&Ya(wh(oc,{posthog:this._posthog,survey:t},t.id),e)},this.q=t=>{this.j(t);var e=this.M.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Kh),this.M.delete(t.id),Nl.info("Removed click listener for survey "+t.id))},this.H=(t,e)=>{var r=Xh.querySelector(e),i=this.M.get(t.id);if(r){if(this.V(t),i){if(r===i.element)return;Nl.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.q(t)}if(!r.hasAttribute(Kh)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Il.NextToTrigger?Qh(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Uu.maxWidth)):{};Gh.dispatchEvent(new CustomEvent(Jh,{detail:{surveyId:t.id,position:n}}))};us(r,"click",n),r.setAttribute(Kh,"true"),this.M.set(t.id,{element:r,listener:n,survey:t}),Nl.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.q(t)},this.renderPopover=t=>{var{shadow:e}=Ju(t,this._posthog);Ya(wh(nc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.D}),e)},this.renderSurvey=(t,e,r)=>{var i,n=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(n=this.Y(t)),Ya(wh(nc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.D,isPopup:!1,properties:r,isSurveyCompleted:n}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.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===Sl.Popover||t.type===Sl.Widget)),i=e.X(r),n=new Set;i.forEach((t=>{if(t.type===Sl.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===_l.Tab)return void e.V(t);(null==(i=t.appearance)?void 0:i.widgetType)===_l.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.H(t,null==(o=t.appearance)?void 0:o.widgetSelector))}Kr(e.K)&&t.type===Sl.Popover&&e.handlePopoverSurvey(t)})),e.M.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.q(r)}))}),t)},this.Z=t=>{Kr(this.K)||Nl.error("Survey "+this.K+" already in focus. Cannot add survey "+t.id+"."),this.K=t.id},this.D=t=>{this.K!==t.id&&Nl.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.F(t.id),this.K=null,this.j(t)},this._posthog=t,this.K=null}F(t){var e=this.R.get(t);e&&(clearTimeout(e),this.R.delete(t))}cancelSurvey(t){this.R.has(t)&&(Nl.info("Cancelled pending survey "+t),this.F(t),this.K===t&&(this.K=null))}X(t){return t.sort(((t,e)=>{var r,i,n=ph(t),s=ph(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Tl,a=e.schedule===Tl;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}Y(t){if(this.O.has(t.id))return!1;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 s of n){var[o,a]=s.split("=");if(o&&!Gr(a)){var l=decodeURIComponent(o),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}}(Gh.location.search);if(0===Object.keys(e).length)return!1;Nl.info("[Survey Prefill] Detected URL prefill parameters");var r=this.J(t,e);if(!r)return!1;var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;return(Object.keys(o).length>0&&t.enable_partial_responses||s)&&Qu({responses:s?i:o,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this.O.add(t.id),s}B(t,e,r){var i={};for(var[n,s]of Object.entries(e))i[parseInt(n)]=zr(s)?s.map(String):[String(s)];Nl.info("[Survey] Processing initial responses");var o=this.J(t,i);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return Qu({responses:a,survey:t,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:r}),u}J(t,e){try{var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=zu(t.id);try{switch(t.type){case kl.SingleChoice:if(!t.choices||0===t.choices.length)return void Kn.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Kn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void Kn.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void Kn.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&Kn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case kl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Kn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:Kn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Kn.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return Nl.warn("[Survey Prefill] No valid responses after conversion"),null;var i=Wl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;t.questions.length>i&&s>0&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=zu(o.id);Gr(r[a])||(n[a]=r[a])}var l=Wh(t,i,o.id?r[zu(o.id)]:null);if(l===xl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=s>=t.questions.length;return vh(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Nl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(t){return Nl.error("[Survey Prefill] Error handling prefill:",t),null}}$(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}G(t){return!t.conditions||ch(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!Yn)return!1;var s=cn(Yn,{userAgentDataPlatform:null==jn||null==(r=jn.userAgentData)?void 0:r.platform,maxTouchPoints:null==jn?void 0:jn.maxTouchPoints,screenWidth:null==Dn||null==(i=Dn.screen)?void 0:i.width,screenHeight:null==Dn||null==(n=Dn.screen)?void 0:n.height,devicePixelRatio:null==Dn?void 0:Dn.devicePixelRatio});return ju[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Vu||!Vu.querySelector(t.conditions.selector))}(t)}ee(t){return ah(t)||this.$(t.internal_targeting_flag_key)||ph(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.$(t.linked_flag_key,n)?this.$(t.targeting_flag_key)?this.ee(t)?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,localStorage.getItem("lastSeenSurveyDate"))?(t=>!!localStorage.getItem(jl(t))&&!ah(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(!Fl(t)&&!Ol(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._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.$(r)}))}j(t){try{var e=Xh.querySelector(mh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){Nl.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.D,surveyInFocus:this.K,surveyTimeouts:this.R,handleWidget:this.V,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.H,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.$.bind(this)}}}function ec(t,e){if(Xh&&Gh){var r,i=new tc(t);if(t.config.disable_surveys_automatic_display)return Nl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Nl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Gr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),us(Xh,"visibilitychange",(()=>{Xh.hidden?Gr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function rc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;ll((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Sl.Widget,s=ch(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===_l.Tab&&n;if(!s)return Nl.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Nl.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};us(Gh,"popstate",s),us(Gh,"hashchange",s);var o=Gh.history.pushState,a=Gh.history.replaceState;return Gh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];o.apply(this,e),s()},Gh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{Gh.removeEventListener("popstate",s),Gh.removeEventListener("hashchange",s),Gh.history.pushState=o,Gh.history.replaceState=a}}}),[n,e,r,i])}function ic(t){switch(void 0===t&&(t=Cl.Right),t){case Cl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Cl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Cl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function nc(t){var e,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=ul(null),I=Number.isInteger(d),C=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,r,i,n,s,o,a){var[l,u]=al(i||0===r||t.type===Sl.ExternalSurvey),[h,c]=al(!1),d=()=>{var e=()=>{s&&n(t),u(!1)};Xh.startViewTransition?Xh.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return ll((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{ch(t)&&(u(!0),Gh.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Al.SHOWN,{[El.SURVEY_NAME]:t.name,[El.SURVEY_ID]:t.id,[El.SURVEY_ITERATION]:t.current_iteration,[El.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(us(Gh,"PHSurveyClosed",v),us(Gh,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),Gh.removeEventListener("PHSurveyClosed",v),Gh.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gh.removeEventListener("PHSurveyClosed",v),Gh.removeEventListener("PHSurveySent",n)}}}else Nl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),rc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:l,isSurveySent:h,setIsPopupVisible:u,hidePopupWithViewTransition:d}}(l,h,C,I,v,f,_,w),T=k||d===l.questions.length||!0===b,A=hl((()=>{var t=fh(l);return{isPreviewMode:I,previewPageIndex:d,onPopupSurveyDismissed(){rh(l,h,I),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Wl(),onPreviewSubmit:p,posthog:h,properties:y}}),[I,d,f,h,l,g,p,y]);return S?wh(lh.Provider,{value:A,children:wh("div",{className:"ph-survey",style:r({},yh(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:_,children:T?wh(Ph,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Uu,onClose(){x(),m()}}):wh(sc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function sc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=al((()=>{var t=fh(i);return null!=t&&t.responses&&Nl.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,properties:f}=cl(lh),[p,g]=al((()=>{var t=fh(i);return l||(null==t?void 0:t.lastQuestionIndex)||0})),m=hl((()=>oh(i)),[i]);ll((()=>{v&&!Gr(l)&&g(l)}),[l,v]);var y=m.at(p);return y?wh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&wh(Fh,{onClick(){u()}}),wh("div",{className:"survey-box","data-question-index":p,children:ac({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||Uu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(s)if(l){var u=zu(l),h=r({},o,{[u]:e});a(h);var c=Wh(i,n,e),v=c===xl.End;v||(g(c),vh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&Qu({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f})}else Nl.error("onNextButtonClick called without a questionId.");else Nl.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?o[zu(y.id)]:void 0})})]}):null}function oc(t){var e,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=al(!0),[f,p]=al(!1),[g,m]=al({}),y=()=>{p(!f)};if(ll((()=>{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&&(Nl.info("Received show event for feedback button survey "+l.id),m(r.detail.position||{}),y())};return us(Gh,Jh,e),()=>{Gh.removeEventListener(Jh,e)}}}else Nl.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]),rc({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==Tl&&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==(s=l.appearance)?void 0:s.tabPosition)===Cl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:ic(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&wh(nc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var ac=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:i,appearance:s,onPreviewSubmit(t){a(t)},onSubmit(t){o(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case kl.Open:return xa(Dh,r({},u,{question:e,key:e.id}));case kl.Link:return xa(Bh,r({},u,{question:e,key:e.id}));case kl.Rating:return xa(jh,r({},u,{question:e,key:e.id}));case kl.SingleChoice:case kl.MultipleChoice:return xa(Zh,r({},u,{question:e,key:e.id}));default:return Nl.error("Unsupported question type: "+e.type),null}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.generateSurveys=ec,Un.extendPostHogWithSurveys=ec;class lc{emit(t){}}var uc=new lc,hc=new class{getLogger(t,e,r){return new lc}};class cc{constructor(t,e,r,i){this.te=t,this.name=e,this.version=r,this.options=i}emit(t){this.re().emit(t)}re(){if(this.ne)return this.ne;var t=this.te.ie(this.name,this.version,this.options);return t?(this.ne=t,this.ne):uc}}class dc{getLogger(t,e,r){var i;return null!==(i=this.ie(t,e,r))&&void 0!==i?i:new cc(this,t,e,r)}oe(){var t;return null!==(t=this.ne)&&void 0!==t?t:hc}ae(t){this.ne=t}ie(t,e,r){var i;return null===(i=this.ne)||void 0===i?void 0:i.getLogger(t,e,r)}}var vc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},fc=Symbol.for("io.opentelemetry.js.api.logs"),pc=vc;class gc{constructor(){this.se=new dc}static getInstance(){return this._instance||(this._instance=new gc),this._instance}setGlobalLoggerProvider(t){return pc[fc]?this.getLoggerProvider():(pc[fc]=(1,e=t,r=hc,t=>1===t?e:r),this.se.ae(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=pc[fc])||void 0===t?void 0:t.call(pc,1))&&void 0!==e?e:this.se}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete pc[fc],this.se=new dc}}var mc=gc.getInstance();class yc{constructor(t){this.ne=void 0,this.ne=t}export(t,e){this.ne.export(t,e)}forceFlush(){return this.ne.forceFlush()}shutdown(){return this.ne.shutdown()}}class bc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function wc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class _c{constructor(t){this.ue=void 0,this.le=[],this.ue=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.le.push(t);var e=()=>{var e=this.le.indexOf(t);this.le.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.le.length>=this.ue}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.le)}))()}}function Ic(t){return new _c(t.concurrencyLimit)}var Cc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sc="1.9.0",kc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,xc=function(t){var e=new Set([t]),r=new Set,i=t.match(kc);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function l(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(kc);if(!i)return a(t);var u=+i[2],h=+i[3];return null!=i[4]||n!==+i[1]?a(t):0===n?s!==u||o>h?a(t):l(t):s>u?a(t):l(t)}}(Sc),Tc=Sc.split(".")[0],Ac=Symbol.for("opentelemetry.js.api."+Tc),Ec=Cc;function Rc(t,e,r,i){var n;void 0===i&&(i=!1);var s=Ec[Ac]=null!==(n=Ec[Ac])&&void 0!==n?n:{version:Sc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}return s.version!==Sc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Sc),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Sc+"."),!0)}function Nc(t){var e,r,i=null===(e=Ec[Ac])||void 0===e?void 0:e.version;if(i&&xc(i))return null===(r=Ec[Ac])||void 0===r?void 0:r[t]}function Mc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Sc+".");var r=Ec[Ac];r&&delete r[t]}var Fc,Oc=function(){function t(t){this.ce=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("debug",this.ce,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("error",this.ce,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("info",this.ce,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("warn",this.ce,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Pc("verbose",this.ce,t)},t}();function Pc(t,e,r){var i=Nc("diag");if(i)return r.unshift(e),i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Fc||(Fc={}));var Lc=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=Nc("diag");if(i)return i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:Fc.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Nc("diag"),l=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return Fc.NONE>t?t=Fc.NONE:t>Fc.ALL&&(t=Fc.ALL),e=e||{},{error:r("error",Fc.ERROR),warn:r("warn",Fc.WARN),info:r("info",Fc.INFO),debug:r("debug",Fc.DEBUG),verbose:r("verbose",Fc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Fc.INFO,t);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return Rc("diag",l,e,!0)},e.disable=function(){Mc("diag",e)},e.createComponentLogger=function(t){return new Oc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function Dc(t){return Symbol.for(t)}var Bc,jc=new function t(e){var r=this;r.de=e?new Map(e):new Map,r.getValue=function(t){return r.de.get(t)},r.setValue=function(e,i){var n=new t(r.de);return n.de.set(e,i),n},r.deleteValue=function(e){var i=new t(r.de);return i.de.delete(e),i}},qc=function(){function t(){}return t.prototype.active=function(){return jc},t.prototype.with=function(t,e,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return e.call.apply(e,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),Zc="context",$c=new qc,Hc=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Rc(Zc,t,Lc.instance())},t.prototype.active=function(){return this.he().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this.he()).with.apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([t,e,r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},t.prototype.bind=function(t,e){return this.he().bind(t,e)},t.prototype.he=function(){return Nc(Zc)||$c},t.prototype.disable=function(){this.he().disable(),Mc(Zc,Lc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Bc||(Bc={}));var Vc="0000000000000000",zc="00000000000000000000000000000000",Yc={traceId:zc,spanId:Vc,traceFlags:Bc.NONE},Uc=function(){function t(t){void 0===t&&(t=Yc),this.ve=t}return t.prototype.spanContext=function(){return this.ve},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),Wc=Dc("OpenTelemetry Context Key SPAN");function Gc(t){return t.getValue(Wc)||void 0}function Xc(){return Gc(Hc.getInstance().active())}function Jc(t,e){return t.setValue(Wc,e)}function Kc(t){return t.deleteValue(Wc)}function Qc(t,e){return Jc(t,new Uc(e))}function td(t){var e;return null===(e=Gc(t))||void 0===e?void 0:e.spanContext()}var ed=/^([0-9a-f]{32})$/i,rd=/^[0-9a-f]{16}$/i;function id(t){return ed.test(r=t.traceId)&&r!==zc&&rd.test(e=t.spanId)&&e!==Vc;var e,r}function nd(t){return new Uc(t)}var sd=Hc.getInstance(),od=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=sd.active()),Boolean(null==e?void 0:e.root))return new Uc;var i,n=r&&td(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&id(n)?new Uc(n):new Uc},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:sd.active(),l=this.startSpan(t,n,a),u=Jc(a,l);return sd.with(u,o,void 0,l)}},t}(),ad=new od,ld=function(){function t(t,e,r,i){this.te=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.fe().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.fe();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.fe=function(){if(this.ne)return this.ne;var t=this.te.getDelegateTracer(this.name,this.version,this.options);return t?(this.ne=t,this.ne):ad},t}(),ud=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new od},t}()),hd=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new ld(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ne)&&void 0!==t?t:ud},t.prototype.setDelegate=function(t){this.ne=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.ne)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),cd=Hc.getInstance(),dd=Lc.instance(),vd="trace",fd=function(){function t(){this.pe=new hd,this.wrapSpanContext=nd,this.isSpanContextValid=id,this.deleteSpan=Kc,this.getSpan=Gc,this.getActiveSpan=Xc,this.getSpanContext=td,this.setSpan=Jc,this.setSpanContext=Qc}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Rc(vd,this.pe,Lc.instance());return e&&this.pe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return Nc(vd)||this.pe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){Mc(vd,Lc.instance()),this.pe=new hd},t}().getInstance(),pd=Dc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function gd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if(md(i)){e=i;continue}return!1}return!1}}return!0}(t):md(typeof t))}function md(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function yd(t){try{(t=>{dd.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))})(t)}catch(t){}}var bd,wd=performance,_d="telemetry.sdk.language",Id="telemetry.sdk.name",Cd="telemetry.sdk.version",Sd={[Id]:"opentelemetry","process.runtime.name":"browser",[_d]:"webjs",[Cd]:"2.2.0"},kd=Math.pow(10,6),xd=Math.pow(10,9);function Td(t){return[Math.trunc(t/1e3),Math.round(t%1e3*kd)]}function Ad(){var t=wd.timeOrigin;return"number"!=typeof t&&(t=wd.timing&&wd.timing.fetchStart),t}function Ed(t){if(s=t,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return t;if("number"==typeof t)return t<Ad()?(e=t,r=Td(Ad()),i=Td("number"==typeof e?e:wd.now()),xd>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=xd,n[0]+=1),n):Td(t);var e,r,i,n,s;if(t instanceof Date)return Td(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(bd||(bd={}));var Rd="[object Object]",Nd="[object Null]",Md="[object Undefined]",Fd=function(){}.toString,Od=Fd.call(Object),Pd=Object.getPrototypeOf,Ld=Object.prototype,Dd=Ld.hasOwnProperty,Bd=Symbol?Symbol.toStringTag:void 0,jd=Ld.toString;function qd(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?Md:Nd:Bd&&Bd in Object(t)?function(t){var e=Dd.call(t,Bd),r=t[Bd],i=!1;try{t[Bd]=void 0,i=!0}catch(t){}var n=jd.call(t);return i&&(e?t[Bd]=r:delete t[Bd]),n}(t):function(t){return jd.call(t)}(t)}(t)!==Rd)return!1;var e=Pd(t);if(null===e)return!0;var r=Dd.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Fd.call(r)===Od}function Zd(t){return Vd(t)?t.slice():t}function $d(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,Ud(t)||Ud(e)||zd(e))n=Zd(e);else if(Vd(t)){if(n=t.slice(),Vd(e))for(var s=0,o=e.length;o>s;s++)n.push(Zd(e[s]));else if(Yd(e))for(var a=Object.keys(e),l=0,u=a.length;u>l;l++){var h=a[l];n[h]=Zd(e[h])}}else if(Yd(t))if(Yd(e)){if(!function(t,e){return!(!qd(t)||!qd(e))}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;v>d;d++){var f=c[d],p=e[f];if(Ud(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Hd(t,f,i)||Hd(e,f,i))delete n[f];else{if(Yd(g)&&Yd(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=$d(n[f],p,r,i)}}}}else n=e;return n}}function Hd(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function Vd(t){return Array.isArray(t)}function zd(t){return"function"==typeof t}function Yd(t){return!Ud(t)&&!Vd(t)&&!zd(t)&&"object"==typeof t}function Ud(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Wd extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Wd.prototype)}}function Gd(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new Wd("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Xd{constructor(){this.me=void 0,this.ge=void 0,this.ye=void 0,this.me=new Promise(((t,e)=>{this.ge=t,this.ye=e}))}get promise(){return this.me}resolve(t){this.ge(t)}reject(t){this.ye(t)}}class Jd{constructor(t,e){this.be=void 0,this.we=void 0,this.Ce=!1,this.Ie=new Xd,this.be=t,this.we=e}get isCalled(){return this.Ce}get promise(){return this.Ie.promise}call(){if(!this.Ce){this.Ce=!0;try{for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];Promise.resolve(this.be.call(this.we,...e)).then((t=>this.Ie.resolve(t)),(t=>this.Ie.reject(t)))}catch(t){this.Ie.reject(t)}}return this.Ie.promise}}var Kd={Se:(t,e)=>new Promise((r=>{cd.with(function(t){return t.setValue(pd,!0)}(cd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class Qd{constructor(t,e,r,i,n){this.ke=void 0,this.xe=void 0,this.Ae=void 0,this.Te=void 0,this.Ne=void 0,this.Re=void 0,this.ke=t,this.xe=e,this.Ae=r,this.Te=i,this.Ne=n,this.Re=dd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Re.debug("items to be sent",t),this.Te.hasReachedLimit())e({code:bd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.xe.serializeRequest(t);null!=r?this.Te.pushPromise(this.ke.send(r,this.Ne).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:bd.FAILED,error:t.error}:"retryable"===t.status?{code:bd.FAILED,error:new bc("Export failed with retryable status")}:{code:bd.FAILED,error:new bc("Export failed with unknown error")});else{if(null!=t.data)try{this.Ae.handleResponse(this.xe.deserializeResponse(t.data))}catch(e){this.Re.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:bd.SUCCESS})}}),(t=>e({code:bd.FAILED,error:t})))):e({code:bd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Te.awaitAll()}shutdown(){var t=this;return e((function*(){t.Re.debug("shutdown started"),yield t.forceFlush(),t.ke.shutdown()}))()}}function tv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Ic(t)},new Qd(i.transport,i.serializer,{handleResponse(t){null!=t&&function(t){return{}.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&dd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function ev(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function rv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=ev(t.charCodeAt(i)),s=ev(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function iv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function nv(t){var e;return e=iv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var sv="undefined"!=typeof BigInt?function(t){return iv(t).toString()}:function(t){return t[0]*xd+t[1]};function ov(t){return t}function av(t){if(void 0!==t)return rv(t)}var lv={encodeHrTime:nv,encodeSpanContext:rv,encodeOptionalSpanContext:av};function uv(t,e){return{key:t,value:hv(e)}}function hv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(hv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return uv(e,r)}))}}:{}}function cv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>uv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n,s;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:hv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>uv(t,s[t])))),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var dv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class vv{static FromAttributeList(t,e){var r=new vv({},e);return r.Me=pv(t),r._e=t.filter((t=>{var[e,r]=t;return dv(r)})).length>0,r}constructor(t,e){var r;this.Me=void 0,this._e=!1,this.Ee=void 0,this.Oe=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.Me=Object.entries(i).map((t=>{var[e,r]=t;return dv(r)&&(this._e=!0),[e,r]})),this.Me=pv(this.Me),this.Ee=function(t){if("string"==typeof t||void 0===t)return t;dd.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this._e}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;t.Me.length>e;e++){var[r,i]=t.Me[e];t.Me[e]=[r,dv(i)?yield i:i]}t._e=!1}}))()}get attributes(){if(this.asyncAttributesPending&&dd.error("Accessing resource attributes before async attributes settled"),this.Oe)return this.Oe;var t={};for(var[e,r]of this.Me){var i;dv(r)?dd.debug("Unsettled resource attribute "+e+" skipped"):null!=r&&(null!==(i=t[e])&&void 0!==i||(t[e]=r))}return this._e||(this.Oe=t),t}getRawAttributes(){return this.Me}get schemaUrl(){return this.Ee}merge(t){if(null==t)return this;var e,r,i,n,s=(n=null==(r=t)?void 0:r.schemaUrl,void 0===(i=null==(e=this)?void 0:e.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void dd.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return vv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function fv(t,e){return vv.FromAttributeList(Object.entries(t),e)}function pv(t){return t.map((t=>{var[e,r]=t;return dv(r)?[e,r.catch((t=>{dd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var gv={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return lv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?nv:sv,encodeSpanContext:n?ov:rv,encodeOptionalSpanContext:n?ov:av}}({useHex:!0,useLongBits:!1}),{resourceLogs:cv(e,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(t){if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class mv{constructor(t){this.ke=void 0,this.ke=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.ke.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.ke.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,h=e-Date.now();if(u>h)return n;n=yield i.retry(t,h,u)}return n}))()}shutdown(){return this.ke.shutdown()}}function yv(t){return new mv(t.transport)}function bv(t){return[429,502,503,504].includes(t)}function wv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return 0>r?0:r}}class _v{constructor(t){this.Fe=void 0,this.Fe=t}send(t,r){var i=this;return e((function*(){var e=yield i.Fe.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Fe.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&bv(s.status)?n({status:"retryable",retryInMillis:wv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(dd.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Iv{constructor(t){this.Le=void 0,this.Le=t}send(t){var r=this;return e((function*(){var e=(yield r.Le.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Le.url,new Blob([t],{type:e}))?(dd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Cv{constructor(t){this.Fe=void 0,this.Fe=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Fe.url),l=yield fetch(a.href,{method:"POST",headers:yield i.Fe.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?bv(l.status)?{status:"retryable",retryInMillis:wv(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(dd.debug("response success"),{status:"success"})}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Sv(t,e){return tv(t,e,yv({transport:(r=t,new _v(r))}));var r}function kv(t,e){return tv(t,e,yv({transport:(r=t,new Cv(r))}));var r}function xv(t,e){return tv(t,e,yv({transport:(r={url:t.url,headers:t.headers},new Iv(r))}));var r}function Tv(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function Av(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function Ev(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:Av(t),concurrencyLimit:t.concurrencyLimit},o={},a=function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(t,e,r){var i,n,s,o,a,l;return{timeoutMillis:wc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=t.compression)&&void 0!==l?l:e.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,e((function*(){var t=r({},yield d()),e={};return null!=c&&Object.assign(e,yield c()),null!=h&&Object.assign(e,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):dd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(l=null!==(u=Tv(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,h,c,d}function Rv(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?kv:Sv:xv)(Ev(t,r,i),e)}class Nv extends yc{constructor(t){void 0===t&&(t={}),super(Rv(t,gv,"v1/logs",{"Content-Type":"application/json"}))}}class Mv{set severityText(t){this.Be()||(this.Ze=t)}get severityText(){return this.Ze}set severityNumber(t){this.Be()||(this.De=t)}get severityNumber(){return this.De}set body(t){this.Be()||(this.Pe=t)}get body(){return this.Pe}get eventName(){return this.Ve}set eventName(t){this.Be()||(this.Ve=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Ze=void 0,this.De=void 0,this.Pe=void 0,this.Ve=void 0,this.totalAttributesCount=0,this.qe=!1,this.je=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:h}=r,c=Date.now();if(this.hrTime=Ed(null!=i?i:c),this.hrTimeObserved=Ed(null!=n?n:c),h){var d=fd.getSpanContext(h);d&&id(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=t.resource,this.instrumentationScope=e,this.je=t.logRecordLimits,this.Ve=s,this.setAttributes(u)}setAttribute(t,e){return this.Be()||null===e?this:0===t.length?(dd.warn("Invalid attribute key: "+t),this):gd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.je.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,t)?(this.attributes[t]=gd(e)?this.He(e):e,this):(1===this.droppedAttributesCount&&dd.warn("Dropping extra attributes."),this)):(dd.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Ye(){this.qe=!0}He(t){var e=this.je.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Ge(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Ge(t,e):t)):t:(dd.warn("Attribute value limit must be positive, got "+e),t)}Ge(t,e){return t.length>e?t.substring(0,e):t}Be(){return this.qe&&dd.warn("Can not execute the operation on emitted log record"),this.qe}}class Fv{constructor(t,e){this.instrumentationScope=void 0,this.We=void 0,this.instrumentationScope=t,this.We=e}emit(t){var e=t.context||cd.active(),i=new Mv(this.We,this.instrumentationScope,r({context:e},t));this.We.activeProcessor.onEmit(i,e),i.Ye()}}class Ov{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class Pv{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>Gd(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class Lv{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new Pv(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Ov}}class Dv{constructor(t){var e,r,i;void 0===t&&(t={}),this.Ue=void 0,this.We=void 0;var n,s,o,a,l,u,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=$d(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:fv({"service.name":"unknown_service",[_d]:Sd[_d],[Id]:Sd[Id],[Cd]:Sd[Cd]});this.We=new Lv(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.Ue=new Jd(this.ze,this)}getLogger(t,e,r){if(this.Ue.isCalled)return dd.warn("A shutdown LoggerProvider cannot provide a Logger"),uc;t||dd.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.We.loggers.has(n)||this.We.loggers.set(n,new Fv({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.We)),this.We.loggers.get(n)}forceFlush(){return this.Ue.isCalled?(dd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Ue.promise):this.We.activeProcessor.forceFlush()}shutdown(){return this.Ue.isCalled?(dd.warn("shutdown may only be called once per LoggerProvider"),this.Ue.promise):this.Ue.call()}ze(){return this.We.activeProcessor.shutdown()}}class Bv{constructor(t,e){var r,i,n,s,o,a,l,u;this.Xe=void 0,this.Ke=void 0,this.Je=void 0,this.Qe=void 0,this.$e=void 0,this.et=!1,this.tt=[],this.rt=void 0,this.Ue=void 0,this.Xe=t,this.Ke=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.Je=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.Qe=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.$e=null!==(l=null!==(u=null==e?void 0:e.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this.Ue=new Jd(this.ze,this),this.Ke>this.Je&&(dd.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.Ke=this.Je)}onEmit(t){this.Ue.isCalled||this.nt(t)}forceFlush(){return this.Ue.isCalled?this.Ue.promise:this.it()}shutdown(){return this.Ue.call()}ze(){var t=this;return e((function*(){t.onShutdown(),yield t.it(),yield t.Xe.shutdown()}))()}nt(t){this.Je>this.tt.length&&(this.tt.push(t),this.ot())}it(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.tt.length/this.Ke),n=0;i>n;n++)r.push(this.st());Promise.all(r).then((()=>{t()})).catch(e)}))}st(){return this.ut(),0===this.tt.length?Promise.resolve():new Promise(((t,e)=>{Gd(this.Se(this.tt.splice(0,this.Ke)),this.$e).then((()=>t())).catch(e)}))}ot(){if(!this.et){var t=()=>{this.et=!0,this.st().then((()=>{this.et=!1,this.tt.length>0&&(this.ut(),this.ot())})).catch((t=>{this.et=!1,yd(t)}))};if(this.tt.length>=this.Ke)return t();void 0===this.rt&&(this.rt=setTimeout((()=>t()),this.Qe),"number"!=typeof this.rt&&this.rt.unref())}}ut(){void 0!==this.rt&&(clearTimeout(this.rt),this.rt=void 0)}Se(t){var e=()=>Kd.Se(this.Xe,t).then((t=>{var e;t.code!==bd.SUCCESS&&yd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(yd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,yd)}}class jv extends Bv{constructor(t,e){super(t,e),this.ct=void 0,this.dt=void 0,this.ht(e)}onShutdown(){"undefined"!=typeof document&&(this.ct&&document.removeEventListener("visibilitychange",this.ct),this.dt&&document.removeEventListener("pagehide",this.dt))}ht(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.ct=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.dt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.ct),document.addEventListener("pagehide",this.dt))}}var qv=1e4,Zv=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=qv),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;for(var o in s.add(t),t)if({}.hasOwnProperty.call(t,o)){var a=t[o],l=e?e+"."+o:o;if(Ur(a))Zv(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[l]=a}}return r},$v={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:Un.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}mc.setGlobalLoggerProvider(new Dv({resource:fv(i),processors:[new jv(new Nv({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=mc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;Un.console[n]=(s=Un.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!Kr(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");u.length>qv&&(u=u.slice(0,qv)+"...",i.body_truncated="true"),e.emit({severityText:$v[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":Un.location.href},i,Ur(a[0])?Zv(a[0]):{})}),s.apply(Un.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var Hv=Qn("[Error tracking]");function Vv(){return new vn([new xn,new Ln,new An,new Tn,new On,new Fn,new Rn,new Pn],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Sn.test(l)?l.replace(Sn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,t);if(c){s.push(c);break}}if(s.length>=kn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,kn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||fn});var i}))}(s)}}("web:javascript",wn,Cn))}var zv=Qn("[ExceptionAutocapture]"),Yv=Vv(),Uv={wrapOnError(t){var e=Dn;e||zv.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),s=0;i>s;s++)n[s]=arguments[s];var o=Yv.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return t(o),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=Dn;e||zv.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,s=Yv.buildFromUnknown(i,{mechanism:{handled:!1}});return t(s),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||zv.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Yv.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.errorWrappingFunctions=Uv,Un.posthogErrorWrappingFunctions=Uv;var Wv=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!zr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==Ks&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{};var Gv={_patchFetch:(t,r,i)=>gs(Dn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Wv(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>gs(Dn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return Wv(t,e,r,u),i.call(this,n,u.url,o,a,l)}))};Un.__PosthogExtensions__.tracingHeadersPatchFns=Gv,Un.postHogTracingHeadersPatchFns=Gv;var Xv=-1,Jv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Xv=e.timeStamp,t(e))}),!0)},Kv=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Qv=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},tf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ef=()=>{var t,e=tf();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},rf=function(t,e){void 0===e&&(e=-1);var r=tf(),i="navigate";return 0>Xv?r&&(document.prerendering||ef()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},nf=new WeakMap;function sf(t,e){return nf.get(t)||nf.set(t,new e),nf.get(t)}class of{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var af,lf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},uf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},hf=-1,cf=new Set,df=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,vf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of cf)e();isFinite(hf)||(hf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",vf,!0))}},ff=()=>{if(0>hf){var t,e=ef(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;hf=null!=r?r:df(),addEventListener("visibilitychange",vf,!0),addEventListener("prerenderingchange",vf,!0),Jv((()=>{setTimeout((()=>{hf=df()}))}))}return{get firstHiddenTime(){return hf},onHidden(t){cf.add(t)}}},pf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},gf=[1800,3e3],mf=function(t,e){void 0===e&&(e={}),pf((()=>{var r,i=ff(),n=rf("FCP"),s=lf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-ef(),0),n.entries.push(e),r(!0)))}));s&&(r=Kv(t,n,gf,e.reportAllChanges),Jv((i=>{n=rf("FCP"),r=Kv(t,n,gf,e.reportAllChanges),Qv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},yf=[.1,.25],bf=0,wf=1/0,_f=0,If=t=>{for(var e of t)e.interactionId&&(wf=Math.min(wf,e.interactionId),_f=Math.max(_f,e.interactionId),bf=_f?(_f-wf)/7+1:0)},Cf=()=>{var t;return af?bf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Sf=0;class kf{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Sf=Cf(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Cf()-Sf)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||10>this.u.length||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.l.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var xf=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=uf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Tf=[200,500];class Af{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Ef=[2500,4e3],Rf={onLCP(t,e){void 0===e&&(e={}),pf((()=>{var r,i=ff(),n=rf("LCP"),s=sf(e,Af),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-ef(),0),n.entries=[o],r())},a=lf("largest-contentful-paint",o);if(a){r=Kv(t,n,Ef,e.reportAllChanges);var l=uf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(xf(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Jv((i=>{n=rf("LCP"),r=Kv(t,n,Ef,e.reportAllChanges),Qv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=ff();mf(uf((()=>{var i,n=rf("CLS",0),s=sf(e,of),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=lf("layout-shift",o);a&&(i=Kv(t,n,yf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Jv((()=>{s.i=0,n=rf("CLS",0),i=Kv(t,n,yf,e.reportAllChanges),Qv((()=>i()))})),setTimeout(i))})))},onFCP:mf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=ff();pf((()=>{var i;"interactionCount"in performance||af||(af=lf("event",If,{type:"event",buffered:!0,durationThreshold:0}));var n,s=rf("INP"),o=sf(e,kf),a=t=>{xf((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=lf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Kv(t,s,Tf,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Jv((()=>{o.v(),s=rf("INP"),n=Kv(t,s,Tf,e.reportAllChanges)})))}))}}};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.postHogWebVitalsCallbacks=Rf,Un.postHogWebVitalsCallbacks=Rf,Un.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Rf;class Nf{constructor(t){this.disabled=!1===t;var e=Ur(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&&this.timeoutMs>r-i.timestamp){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 Mf="$copy_autocapture",Ff=Qn("[AutoCapture]");function Of(t,e){return e.length>t?e.slice(0,t)+"...":e}function Pf(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!fo(e));return e}function Lf(t,e){for(var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,h=[t],c=t;c.parentNode&&!po(c,"body");)mo(c.parentNode)?(h.push(c.parentNode.host),c=c.parentNode.host):(h.push(c.parentNode),c=c.parentNode);var d,v,f=[],p={},g=!1,m=!1;if(es(h,(t=>{var e=No(t);"a"===t.tagName.toLowerCase()&&(g=t.getAttribute("href"),g=e&&g&&jo(g)&&g),jr(wo(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};So.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Of(1024,qo(t)):Of(1024,Io(t)));var o=wo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),es(t.attributes,(function(r){var n;if((!Mo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&jo(r.value)&&(!Xr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=yo(o).join(" ")),s["attr__"+r.name]=Of(1024,o)}}));for(var a=1,l=1,u=t;u=Pf(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(t,o,a,l));var r=function(t){if(!No(t))return{};var e={};return es(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&&jo(i)&&(e[r]=i)}})),e}(t);rs(p,r)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text="a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?qo(t):Io(t)),g){var y,b;f[0].attr__href=g;var w=null==(y=cs(g))?void 0:y.host,_=null==Dn||null==(b=Dn.location)?void 0:b.host;w&&_&&w!==_&&(d=g)}return{props:rs({$event_type:s.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:(v=f,function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=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 is(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[$o(e.toString())]=$o(r.toString())})),(n+=":")+is(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:Ho(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return is(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(v)))},null!=(i=f[0])&&i.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var Df={};function Bf(t){return function(t,e){var r=Df[t];if(r)return r;var i,n=e[t];if(Yr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!Dn.Zone)return Df[t]=n.bind(e);var s=e.document;if(s&&Yr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[t]&&(n=a[t]),s.head.removeChild(o)}catch(e){Kn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&Yr(n)?Df[t]=n.bind(e):n}("MutationObserver",t)}function jf(t,e){return ti(t)&&t>=e}class qf{vt(t){var e,r,i,n,s,o=this.ft((null==t?void 0:t.__onCapture)||this.yt.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.bt=[],this.ft=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.wt=t=>{var e=function(t){var e=Co(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);Kr(e)||this.Ct(e)||this.bt.push(e),this.bt.length&&Gr(this.It)&&(this.It=Un.setTimeout((()=>{this.St()}),1e3))},this.kt=()=>{var t=Date.now();t%50==0&&this.bt.forEach((e=>{Gr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.xt=()=>{this.At=Date.now()},this.Tt=()=>{"visible"===(null==qn?void 0:qn.visibilityState)&&(this.Nt=Date.now())},this.instance=t,this.Rt=this.vt(e),this._onCapture=this.Rt.__onCapture}start(t){this.Mt(),this._t(),this.Et(),this.Ot(),this.Ft(t)}Ft(t){if(!this.Lt){var e=Bf(Un);this.Lt=new e((t=>{this.Bt(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,Un.removeEventListener("click",this.wt),Un.removeEventListener("scroll",this.kt,{capture:!0}),Un.removeEventListener("selectionchange",this.xt),null==qn||qn.removeEventListener("visibilitychange",this.Tt)}Bt(t){this.Zt=Date.now()}Mt(){us(Un,"click",this.wt)}_t(){us(Un,"scroll",this.kt,{capture:!0})}Et(){us(Un,"selectionchange",this.xt)}Ot(){us(qn,"visibilitychange",this.Tt)}Ct(t){if(!t)return!0;if(!this.Rt.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(vo(t.node))return!0;var r=this.bt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!!r||!(!po(t.node,"html")&&fo(t.node)&&!So.includes(t.node.tagName.toLowerCase()))}St(){if(this.bt.length){clearTimeout(this.It),this.It=void 0;var t=this.bt;for(var e of(this.bt=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Zt&&this.Zt>=e.timestamp?this.Zt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.At&&this.At>=e.timestamp?this.At-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Nt?Math.abs(e.timestamp-this.Nt):void 0;var i=jf(e.scrollDelayMs,this.Rt.scroll_threshold_ms),n=jf(e.selectionChangedDelayMs,this.Rt.selection_change_threshold_ms),s=jf(e.mutationDelayMs,this.Rt.mutation_threshold_ms),o=jf(e.absoluteDelayMs,1.1*this.Rt.mutation_threshold_ms),a=ti(e.scrollDelayMs)&&this.Rt.scroll_threshold_ms>e.scrollDelayMs,l=ti(e.mutationDelayMs)&&this.Rt.mutation_threshold_ms>e.mutationDelayMs,u=ti(e.selectionChangedDelayMs)&&this.Rt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=ti(e.visibilityChangedDelayMs)&&this.Rt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var c=jf(e.visibilityChangedDelayMs,this.Rt.selection_change_threshold_ms);i||s||o||n||c?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Zt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.Rt.mutation_threshold_ms>e.absoluteDelayMs&&this.bt.push(e)}}this.bt.length&&Gr(this.It)&&(this.It=Un.setTimeout((()=>{this.St()}),1e3))}}yt(t,e){this.instance.capture("$dead_click",r({},e,Lf(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.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,$dead_click_visibility_changed_delay_ms:t.visibilityChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new qf(t,e);var Zf=Qn("[ExternalScriptsLoader]"),$f=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Zf.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==qn?void 0:qn.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];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})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!qn)return r("document not found");var i=qn.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");if("head"===t.config.external_scripts_inject_target)qn.head.appendChild(i);else{var n,s=qn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):qn.body.appendChild(i)}};null!=qn&&qn.body?a():null==qn||qn.addEventListener("DOMContentLoaded",a)};Un.__PosthogExtensions__=Un.__PosthogExtensions__||{},Un.__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 s=t.requestRouter.endpointFor("assets",i);$f(t,s,r)},Un.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);$f(t,i,r)};var Hf="",Vf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var zf={Yt:()=>!!qn,Ut(t){Kn.error("cookieStore error: "+t)},Wt(t){if(qn){try{for(var e=t+"=",r=qn.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;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}},Gt(t){var e;try{e=JSON.parse(zf.Wt(t))||{}}catch(t){}return e},Xt(t,e,r,i,n){if(qn)try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=qn),Hf)return Hf;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_"+Wl();!Hf&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Hf=s)}return Hf}(t);if(!r){var i=(t=>{var e=t.match(Vf);return e?e[0]:""})(t);i!==r&&Kn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(qn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Kn.warn("cookieStore warning: large cookie, len="+u.length),qn.cookie=u,u}catch(t){return}},Jt(t,e){if(null!=qn&&qn.cookie)try{zf.Xt(t,"",-1,e)}catch(t){return}}},Yf=null,Uf={Yt(){if(!Kr(Yf))return Yf;var t=!0;if(Gr(Dn))t=!1;else try{var e="__mplssupport__";Uf.Xt(e,"xyz"),'"xyz"'!==Uf.Wt(e)&&(t=!1),Uf.Jt(e)}catch(e){t=!1}return t||Kn.error("localStorage unsupported; falling back to cookie store"),Yf=t,t},Ut(t){Kn.error("localStorage error: "+t)},Wt(t){try{return null==Dn?void 0:Dn.localStorage.getItem(t)}catch(t){Uf.Ut(t)}return null},Gt(t){try{return JSON.parse(Uf.Wt(t))||{}}catch(t){}return null},Xt(t,e){try{null==Dn||Dn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Uf.Ut(t)}},Jt(t){try{null==Dn||Dn.localStorage.removeItem(t)}catch(t){Uf.Ut(t)}}},Wf=[bs,"distinct_id",Ms,Fs,Xs,Gs,Vs],Gf={},Xf={Yt:()=>!0,Ut(t){Kn.error("memoryStorage error: "+t)},Wt:t=>Gf[t]||null,Gt:t=>Gf[t]||null,Xt(t,e){Gf[t]=e},Jt(t){delete Gf[t]}},Jf=null,Kf={Yt(){if(!Kr(Jf))return Jf;if(Jf=!0,Gr(Dn))Jf=!1;else try{var t="__support__";Kf.Xt(t,"xyz"),'"xyz"'!==Kf.Wt(t)&&(Jf=!1),Kf.Jt(t)}catch(t){Jf=!1}return Jf},Ut(t){Kn.error("sessionStorage error: ",t)},Wt(t){try{return null==Dn?void 0:Dn.sessionStorage.getItem(t)}catch(t){Kf.Ut(t)}return null},Gt(t){try{return JSON.parse(Kf.Wt(t))||null}catch(t){}return null},Xt(t,e){try{null==Dn||Dn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Kf.Ut(t)}},Jt(t){try{null==Dn||Dn.sessionStorage.removeItem(t)}catch(t){Kf.Ut(t)}}};class Qf{constructor(t){this._instance=t}get Rt(){return this._instance.config}get consent(){return this.Kt()?0:this.Qt}isOptedOut(){return this.Rt.cookieless_mode===ro||0===this.consent||-1===this.consent&&(this.Rt.opt_out_capturing_by_default||this.Rt.cookieless_mode===eo)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}optInOut(t){this.tr.Xt(this.er,t?1:0,this.Rt.cookie_expiration,this.Rt.cross_subdomain_cookie,this.Rt.secure_cookie)}reset(){this.tr.Jt(this.er,this.Rt.cross_subdomain_cookie)}get er(){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 Qt(){var t=this.tr.Wt(this.er);return li(t)?1:jr(ui,t)?0:-1}get tr(){var t=this.Rt.opt_out_capturing_persistence_type,e="localStorage"===t?Uf:zf;if(!this.rr||this.rr!==e){this.rr=e;var r="localStorage"===t?zf:Uf;r.Wt(this.er)&&(this.rr.Wt(this.er)||this.optInOut(li(r.Wt(this.er))),r.Jt(this.er,this.Rt.cross_subdomain_cookie))}return this.rr}Kt(){return!!this.Rt.respect_dnt&&[null==jn?void 0:jn.doNotTrack,null==jn?void 0:jn.msDoNotTrack,Un.doNotTrack].some((t=>li(t)))}}var tp=Qn("[Dead Clicks]"),ep=()=>!0,rp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(As)),i=t.instance.config.capture_dead_clicks;return ri(i)?i:!!Ur(i)||r};class ip{get lazyLoadedDeadClicksAutocapture(){return this.ir}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[As]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.nr((()=>{this.sr()})):this.stop()}nr(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?tp.error("failed to load script",e):t()}))}sr(){var t;if(qn){if(!this.ir&&null!=(t=Un.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ur(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ir=Un.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ir.start(qn),tp.info("starting...")}}else tp.error("`document` not found. Cannot start.")}stop(){this.ir&&(this.ir.stop(),this.ir=void 0,tp.info("stopping..."))}}var np=Qn("[SegmentIntegration]");var sp="posthog-js";function op(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if("*"!==o&&!o.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,p=(null==(l=e.exception)?void 0:l.values)||[],g=p.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}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||e.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class ap{constructor(t,e,r,i,n,s){this.name=sp,this.setupOnce=function(o){o(op(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class lp{constructor(t){this.ar=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(Kn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.lr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.ur()}ur(){var t;this.hr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ar)}destroy(){var t;null==(t=this.hr)||t.call(this),this.hr=void 0}doPageView(t,e){var r,i=this.cr(t,e);return this.lr={pathname:null!==(r=null==Dn?void 0:Dn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.cr(t,null==(e=this.lr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.lr)?void 0:t.pageViewId}}cr(t,e){var r=this.lr;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:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(Gr(s)||Gr(o)||Gr(a)||Gr(l)||Gr(u)||Gr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=s>1?hi(o/s,0,1,Kn):1,d=s>1?hi(a/s,0,1,Kn):1,v=l>1?hi(u/l,0,1,Kn):1,f=l>1?hi(h/l,0,1,Kn):1;i=rs(i,{$prev_pageview_last_scroll:o,$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 up="https?://(.*)",hp=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hp],dp="<masked>",vp=["li_fat_id"];function fp(t,e,r){if(!qn)return{};var i,n=e?[...hp,...r||[]]:[],s=pp(fs(qn.URL,n,dp),t),o=(i={},es(vp,(function(t){var e=zf.Wt(t);i[t]=e||null})),i);return rs(o,s)}function pp(t,e){var r=cp.concat(e||[]),i={};return es(r,(function(e){var r=vs(t,e);i[e]=r||null})),i}function gp(t){var e=function(t){return t?0===t.search(up+"google.([^/?]*)")?"google":0===t.search(up+"bing.com")?"bing":0===t.search(up+"yahoo.com")?"yahoo":0===t.search(up+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Kr(e)){i.$search_engine=e;var n=qn?vs(qn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function mp(){return navigator.language||navigator.userLanguage}var yp="$direct";function bp(){return(null==qn?void 0:qn.referrer)||yp}function wp(t,e){var r=t?[...hp,...e||[]]:[],i=null==Zn?void 0:Zn.href.substring(0,1e3);return{r:bp().substring(0,1e3),u:i?fs(i,r,dp):void 0}}function _p(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==yp?yp:null==(e=cs(r))?void 0:e.host};if(i){n.$current_url=i;var s=cs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=pp(i);rs(n,o)}if(r){var a=gp(r);rs(n,a)}return n}function Ip(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Cp(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Sp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class kp{constructor(t,e){this.Rt=t,this.props={},this.dr=!1,this.vr=(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.tr=this.pr(t),this.load(),t.debug&&Kn.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.gr}pr(t){-1===Sp.indexOf(t.persistence.toLowerCase())&&(Kn.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=[...Wf,...t];return r({},Uf,{Gt(t){try{var e={};try{e=zf.Gt(t)||{}}catch(t){}var r=rs(e,JSON.parse(Uf.Wt(t)||"{}"));return Uf.Xt(t,r),r}catch(t){}return null},Xt(t,r,i,n,s,o){try{Uf.Xt(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&zf.Xt(t,a,i,n,s,o)}catch(t){Uf.Ut(t)}},Jt(t,e){try{null==Dn||Dn.localStorage.removeItem(t),zf.Jt(t,e)}catch(t){Uf.Ut(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Uf.Yt()?Uf:"localstorage+cookie"===i&&e.Yt()?e:"sessionstorage"===i&&Kf.Yt()?Kf:"memory"===i?Xf:"cookie"===i?zf:e.Yt()?e:zf}mr(t){var e=null!=t?t:this.Rt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Hs];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return es(this.props,((e,r)=>{if(r===Os&&Ur(e)){if(!this.mr())for(var i=Object.keys(e),n=0;i.length>n;n++)t["$feature/"+i[n]]=e[i[n]]}else-1===Qs.indexOf(r)&&(t[r]=e)})),t}load(){if(!this.gr){var t=this.tr.Gt(this.vr);t&&(this.props=rs({},t))}}save(){this.gr||this.tr.Xt(this.vr,this.props,this.yr,this.br,this.wr,this.Rt.debug)}remove(){this.tr.Jt(this.vr,!1),this.tr.Jt(this.vr,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Ur(t)){Gr(e)&&(e="None"),this.yr=Gr(r)?this._r:r;var i=!1;if(es(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(Ur(t)){this.yr=Gr(e)?this._r:e;var r=!1;if(es(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.dr){var t=fp(this.Rt.custom_campaign_params,this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties);Wr(os(t))||this.register(t),this.dr=!0}}update_search_keyword(){var t;this.register((t=null==qn?void 0:qn.referrer)?gp(t):{})}update_referrer_info(){var t;this.register_once({$referrer:bp(),$referring_domain:null!=qn&&qn.referrer&&(null==(t=cs(qn.referrer))?void 0:t.host)||yp},void 0)}set_initial_person_info(){this.props[Us]||this.props[Ws]||this.register_once({[Gs]:wp(this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};es([Ws,Us],(e=>{var r=this.props[e];r&&es(r,(function(e,r){t["$initial_"+Zr(r)]=e}))}));var e,r,i=this.props[Gs];if(i){var n=(e=_p(i),r={},es(e,(function(t,e){r["$initial_"+Zr(e)]=t})),r);rs(t,n)}return t}safe_merge(t){return es(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this._r=this.yr=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.pr(t),n=this.props;this.clear(),this.tr=i,this.props=n,this.save()}}set_disabled(t){this.gr=t,this.gr?this.remove():this.save()}set_cross_subdomain(t){t!==this.br&&(this.br=t,this.remove(),this.save())}set_secure(t){t!==this.wr&&(this.wr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[_s]||{};r[t]=e,this.props[_s]=r,this.save()}remove_event_timer(t){var e=(this.props[_s]||{})[t];return Gr(e)||(delete this.props[_s][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var xp=Qn("[RateLimiter]");class Tp{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{xp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void xp.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Ys))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Ys,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Ap=Qn("[RemoteConfig]");class Ep{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Un._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Ir(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Cr(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 Ap.info("Using preloaded remote config",this.remoteConfig),this.Sr(this.remoteConfig),void this.kr();if(this._instance.Tr())return void Ap.warn("Remote config is disabled. Falling back to local config.");this.Ir((t=>{if(!t)return Ap.info("No config found after loading remote JS config. Falling back to JSON."),void this.Cr((t=>{this.Sr(t),this.kr()}));this.Sr(t),this.kr()}))}catch(t){Ap.error("Error loading remote config",t)}}stop(){this.Ar&&(clearInterval(this.Ar),this.Ar=void 0)}refresh(){this._instance.Tr()||"hidden"===(null==qn?void 0:qn.visibilityState)||this._instance.reloadFeatureFlags()}kr(){var t;if(!this.Ar){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ar=setInterval((()=>{this.refresh()}),e))}}Sr(t){var e;t||Ap.error("Failed to fetch remote config from PostHog."),this._instance.Sr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var Rp=3e3;class Np{constructor(t,e){this.Er=!0,this.Rr=[],this.Nr=hi((null==e?void 0:e.flush_interval_ms)||Rp,250,5e3,Kn.createLogger("flush interval"),Rp),this.Mr=t}enqueue(t){this.Rr.push(t),this.Fr||this.Or()}unload(){this.Pr();var t=this.Rr.length>0?this.Lr():{},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.Mr(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Er=!1,this.Or()}Or(){var t=this;this.Er||(this.Fr=setTimeout((()=>{if(this.Pr(),this.Rr.length>0){var e=this.Lr(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&zr(r.data)&&es(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Mr(r)};for(var i in e)r()}}),this.Nr))}Pr(){clearTimeout(this.Fr),this.Fr=void 0}Lr(){var t={};return es(this.Rr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Gr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Rr=[],t}}var Mp=["retriesPerformedSoFar"];class Fp{constructor(t){this.Dr=!1,this.Br=3e3,this.Rr=[],this._instance=t,this.Rr=[],this.jr=!0,!Gr(Dn)&&"onLine"in Dn.navigator&&(this.jr=Dn.navigator.onLine,this.qr=()=>{this.jr=!0,this.Zr()},this.$r=()=>{this.jr=!1},us(Dn,"online",this.qr),us(Dn,"offline",this.$r))}get length(){return this.Rr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,Mp);ei(e)&&(n.url=Mu(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200===t.statusCode||t.statusCode>=400&&500>t.statusCode||(null!=e?e:0)>=10?null==n.callback||n.callback(t):this.Hr(r({retriesPerformedSoFar:e},n))}}))}Hr(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;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Rr.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),Kn.warn(n),this.Dr||(this.Dr=!0,this.Vr())}Vr(){if(this.zr&&clearTimeout(this.zr),0===this.Rr.length)return this.Dr=!1,void(this.zr=void 0);this.zr=setTimeout((()=>{this.jr&&this.Rr.length>0&&this.Zr(),this.Vr()}),this.Br)}Zr(){var t=Date.now(),e=[],r=this.Rr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Rr=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.zr&&(clearTimeout(this.zr),this.zr=void 0),this.Dr=!1,Gr(Dn)||(this.qr&&(Dn.removeEventListener("online",this.qr),this.qr=void 0),this.$r&&(Dn.removeEventListener("offline",this.$r),this.$r=void 0)),this.Rr))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){Kn.error(t)}this.Rr=[]}}class Op{constructor(t){this.Yr=()=>{var t,e,r,i;this.Ur||(this.Ur={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Ur.lastScrollY=Math.ceil(s),this.Ur.maxScrollY=Math.max(s,null!==(t=this.Ur.maxScrollY)&&void 0!==t?t:0),this.Ur.maxScrollHeight=Math.max(o,null!==(e=this.Ur.maxScrollHeight)&&void 0!==e?e:0),this.Ur.lastContentY=a,this.Ur.maxContentY=Math.max(a,null!==(r=this.Ur.maxContentY)&&void 0!==r?r:0),this.Ur.maxContentHeight=Math.max(l,null!==(i=this.Ur.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get Wr(){return this._instance.config.scroll_root_selector}getContext(){return this.Ur}resetContext(){var t=this.Ur;return setTimeout(this.Yr,0),t}startMeasuringScrollPosition(){us(Dn,"scroll",this.Yr,{capture:!0}),us(Dn,"scrollend",this.Yr,{capture:!0}),us(Dn,"resize",this.Yr)}scrollElement(){if(!this.Wr)return null==Dn?void 0:Dn.document.documentElement;var t=zr(this.Wr)?this.Wr:[this.Wr];for(var e of t){var r=null==Dn?void 0:Dn.document.querySelector(e);if(r)return r}}scrollY(){if(this.Wr){var t=this.scrollElement();return t&&t.scrollTop||0}return Dn&&(Dn.scrollY||Dn.pageYOffset||Dn.document.documentElement.scrollTop)||0}scrollX(){if(this.Wr){var t=this.scrollElement();return t&&t.scrollLeft||0}return Dn&&(Dn.scrollX||Dn.pageXOffset||Dn.document.documentElement.scrollLeft)||0}}var Pp=t=>wp(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Lp{constructor(t,e,r,i){this.Gr=t=>{var e=this.Xr();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Jr(this._instance)};this.Kr.register({[zs]:r})}},this._instance=t,this.Qr=e,this.Kr=r,this.Jr=i||Pp,this.Qr.onSessionId(this.Gr)}Xr(){return this.Kr.props[zs]}getSetOnceProps(){var t,e=null==(t=this.Xr())?void 0:t.props;return e?"r"in e?_p(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 es(os(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Zr(r)]=e})),t}}class Dp{constructor(){this.ti={}}on(t,e){return this.ti[t]||(this.ti[t]=[]),this.ti[t].push(e),()=>{this.ti[t]=this.ti[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.ti[t]||[])r(e);for(var i of this.ti["*"]||[])i(t,e)}}var Bp=Qn("[SessionId]");class jp{on(t,e){return this.ei.on(t,e)}constructor(t,e,r){var i;if(this.ri=[],this.ii=void 0,this.ei=new Dp,this.ni=(t,e)=>!(!ei(t)||!ei(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===ro)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rt=t.config,this.Kr=t.persistence,this.si=void 0,this.oi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ai=e||Wl,this.li=r||Wl;var n=this.Rt.persistence_name||this.Rt.token;if(this._sessionTimeoutMs=1e3*hi(this.Rt.session_idle_timeout_seconds||1800,60,36e3,Bp.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ui(),this.hi="ph_"+n+"_window_id",this.ci="ph_"+n+"_primary_window_exists",this.di()){var s=Kf.Gt(this.hi),o=Kf.Gt(this.ci);s&&!o?this.si=s:Kf.Jt(this.hi),Kf.Xt(this.ci,!0)}if(null!=(i=this.Rt.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Rt.bootstrap.sessionID.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.vi(this.Rt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){Bp.error("Invalid sessionID in bootstrap",t)}this.fi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Gr(this.ri)&&(this.ri=[]),this.ri.push(t),this.oi&&t(this.oi,this.si),()=>{this.ri=this.ri.filter((e=>e!==t))}}di(){return"memory"!==this.Rt.persistence&&!this.Kr.gr&&Kf.Yt()}pi(t){t!==this.si&&(this.si=t,this.di()&&Kf.Xt(this.hi,t))}gi(){return this.si?this.si:this.di()?Kf.Gt(this.hi):null}vi(t,e,r){t===this.oi&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.oi=t,this.Kr.register({[Ms]:[e,t,r]}))}mi(){var t=this.Kr.props[Ms];return zr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.vi(null,null,null)}destroy(){clearTimeout(this.yi),this.yi=void 0,this.ii&&Dn&&(Dn.removeEventListener(ao,this.ii,{capture:!1}),this.ii=void 0),this.ri=[]}fi(){this.ii=()=>{this.di()&&Kf.Jt(this.ci)},us(Dn,ao,this.ii,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Rt.cookieless_mode===ro)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.mi(),o=this.gi(),a=ei(s)&&Math.abs(r-s)>864e5,l=!1,u=!n,h=!u&&!t&&this.ni(r,i);u||h||a?(n=this.ai(),o=this.li(),Bp.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this.li(),l=!0);var c=ei(i)&&t&&!a?i:r,d=ei(s)?s:(new Date).getTime();return this.pi(o),this.vi(n,c,d),t||this.ui(),l&&this.ri.forEach((t=>t(n,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}ui(){clearTimeout(this.yi),this.yi=setTimeout((()=>{var[t]=this.mi();if(this.ni((new Date).getTime(),t)){var e=this.oi;this.resetSessionId(),this.ei.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var qp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Br(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Br(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Zp="custom",$p="i.posthog.com";class Hp{constructor(t){this.bi={},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("."+$p,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.bi[this.apiHost]||(this.bi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Zp),this.bi[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===Zp)return this.apiHost+e;var r=$p+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Vp=Qn("[PostHog ExternalIntegrations]"),zp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Yp{constructor(t){this._instance=t}nr(t,e){var r;null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Vp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=Un.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.nr(zp[e],(()=>{var r;null==(r=Un.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=Un.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=Un.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var Up={},Wp=0,Gp=()=>{},Xp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Jp="Surveys module not available",Kp="sanitize_properties is deprecated. Use before_send instead",Qp="Invalid value for property_denylist config: ",tg="posthog",eg=!Ru&&-1===(null==Yn?void 0:Yn.indexOf("MSIE"))&&-1===(null==Yn?void 0:Yn.indexOf("Mozilla")),rg=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:ls(null==qn?void 0:qn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Gp,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:Zn&&Xr(null==Zn?void 0:Zn.search)&&-1!==Zn.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:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Dn||null==(e=Dn.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_feature_flags_dedup_per_session:!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){Kn.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:so,before_send:void 0,request_queue_config:{flush_interval_ms:Rp},error_tracking:{},_onCapture:Gp,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},ig=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],ng=t=>{var e={};for(var[r,i]of ig)Gr(t[r])||(e[i]=t[r]);var n=rs({},e,t);return zr(t.property_blacklist)&&(Gr(t.property_denylist)?n.property_denylist=t.property_blacklist:zr(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Kn.error(Qp+t.property_denylist)),n};class sg{constructor(){this.__forceAllowLocalhost=!1}get wi(){return this.__forceAllowLocalhost}set wi(t){Kn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class og{Ii(t,e){if(t){var r=this.Ci.indexOf(t);-1!==r&&this.Ci.splice(r,1)}return this.Ci.push(e),null==e.initialize||e.initialize(),e}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(){var t;this.webPerformance=new sg,this.Si=!1,this.version=Xn.LIB_VERSION,this.ki=new Dp,this.Ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rg(),this.SentryIntegration=ap,this.sentryIntegration=t=>function(t,e){var r=op(t,e);return{name:sp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.xi=!1,this.Ti=null,this.Ai=null,this.Ei=null,this.scrollManager=new Op(this),this.pageViewManager=new lp(this),this.rateLimiter=new Tp(this),this.requestRouter=new Hp(this),this.consent=new Qf(this),this.externalIntegrations=new Yp(this);var e=null!==(t=og.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Xr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Xr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>Kn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==tg){var i,n=null!==(i=Up[r])&&void 0!==i?i:new og;return n._init(t,e,r),Up[r]=n,Up[tg][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;if(void 0===e&&(e={}),Gr(t)||Jr(t))return Kn.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.Ri(e.debug),this.Ni=e,this.Mi=[],e.person_profiles?this.Ai=e.person_profiles:e.process_person&&(this.Ai=e.process_person),this.set_config(rs({},rg(e.defaults),ng(e),{name:i,token:t})),this.config.on_xhr_error&&Kn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Xl;var o=this.Fi();this.persistence=new kp(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new kp(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Oi=new Np((t=>this.Pi(t)),this.config.request_queue_config),this.Li=new Fp(this),this.__request_queue=[];var u=this.config.cookieless_mode===ro||this.config.cookieless_mode===eo&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new jp(this),this.sessionPropsManager=new Lp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Kn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Di(u)}),0)):(Kn.info("Initializing extensions synchronously"),this.Di(u)),Xn.DEBUG=Xn.DEBUG||this.config.debug,Xn.DEBUG&&Kn.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var h=e.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(Vs);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===io)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===no)Kn.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Wl()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Vs,e.bootstrap.isIdentifiedID?no:io),this.register({distinct_id:h,$device_id:f})}}if(u)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Wl());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Vs,io)}return us(Dn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(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()||Wl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Vs,no)),e()},n=r.user();"then"in n&&Yr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||np.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()||(np.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(np.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,lo),identify:t=>e(t,ho),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Bi())):this.Bi(),Yr(this.config._onCapture)&&this.config._onCapture!==Gp&&(Kn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Kn.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}Di(t){var e,i,n,s,o,a,l,u=performance.now(),h=r({},og.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ci.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.Ci.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Ci.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ci.push(new h.tracingHeaders(this)),h.siteApps&&this.Ci.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.Ci.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Ci.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ci.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Ci.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Ci.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Ci.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ci.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ci.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ci.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ci.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,rp)),h.toolbar&&this.Ci.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Ci.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Ci.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.ji){var t=this.ji;this.ji=void 0,this.Sr(t)}})),this.qi(c,u)}qi(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.qi(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){Kn.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&&Kn.info("PostHog extensions initialized ("+i+"ms)")}Sr(t){var e;if(!qn||!qn.body)return Kn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Sr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.ji=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=jr(t.supportedCompression,Xl)?Xl:jr(t.supportedCompression,Jl)?Jl:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ai?this.Ai:so}),this.Ci.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Bi(){try{this.config.loaded(this)}catch(t){Kn.critical("`loaded` function failed",t)}if(this.Zi(),this.config.internal_or_test_user_hostname&&null!=Zn&&Zn.hostname){var t=Zn.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===ro)&&this.$i()}),1),this.Hi=new Ep(this),this.Hi.load()}Zi(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Oi)||t.enable())}_dom_loaded(){this.is_capturing()&&ts(this.__request_queue,(t=>this.Pi(t))),this.__request_queue=[],this.Zi()}_handle_unload(){var t,e,r;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Vi()&&this.capture(uo),null==(e=this.Oi)||e.unload(),null==(r=this.Li)||r.unload()):this.Vi()&&this.capture(uo,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(eg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Mu(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,s=r({},t);s.timeout=s.timeout||6e4,s.url=Mu(s.url,{_:(new Date).getTime().toString(),ver:Xn.JS_SDK_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Lu.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),l=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Xl&&zn?Pu(s).then((t=>{l(t)})).catch((()=>{l(s)})):l(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))))}Pi(t){this.Li?this.Li.retriableRequest(t):this._send_request(t)}_execute_array(t){Wp++;try{var e,r=[],i=[],n=[];ts(t,(t=>{t&&(zr(e=t[0])?n.push(t):Yr(t)?t.call(this):zr(t)&&"alias"===e?r.push(t):zr(t)&&-1!==e.indexOf("capture")&&Yr(this[e])?n.push(t):i.push(t))}));var s=function(t,e){ts(t,(function(t){if(zr(t[0])){var r=e;es(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}))};s(r,this),s(i,this),s(n,this)}finally{Wp--}}push(t){if(Wp>0&&zr(t)&&Xr(t[0])){var e=og.prototype[t[0]];Yr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Oi){if(this.is_capturing())if(!Gr(t)&&Xr(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=e&&e.$current_url&&!Xr(null==e?void 0:e.$current_url)&&(Kn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.zi||Kn.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 c=new Date,d=(null==i?void 0:i.timestamp)||c,v=Wl(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===lo&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=this.Yi(null==i?void 0:i.$set_once,t!==co,t===ho);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>Xr(t)?t.slice(0,s):t,l=new Set,f=function t(e,r){return e!==Object(e)?a?a(e):e:l.has(e)?void 0:(l.add(e),zr(e)?(i=[],ts(e,(e=>{i.push(t(e))}))):(i={},es(e,((e,r)=>{l.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,Gr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===Al.DISMISSED||t===Al.SENT){var g=null==e?void 0:e[El.SURVEY_ID],m=null==e?void 0:e[El.SURVEY_ITERATION];ql({id:g,current_iteration:m}),f.$set=r({},f.$set,{[Dl({id:g,current_iteration:m},t===Al.SENT?"responded":"dismissed")]:!0})}else t===Al.SHOWN&&(f.$set=r({},f.$set,{[El.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var y=null==e?void 0:e.$product_tour_type;y&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(Wr(b)||this.setPersonPropertiesForFlags(b),!Qr(this.config.before_send)){var w=this.Ui(f);if(!w)return;f=w}this.ki.emit("eventCaptured",f);var _={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,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.Pi(_):this.Oi.enqueue(_),f}Kn.critical("This capture call is ignored due to client rate limiting.")}}else Kn.error("No event name provided to posthog.capture")}else Kn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode==ro||this.config.cookieless_mode==eo&&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,(!Xr(a.distinct_id)&&!ti(a.distinct_id)||Jr(a.distinct_id))&&Kn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e){var r,i,n,s;if(!Yn)return{};var o,a=t?[...hp,...e||[]]:[],[l,u]=function(t){for(var e=0;un.length>e;e++){var[r,i]=un[e],n=r.exec(t),s=n&&(Yr(i)?i(n,t):i);if(s)return s}return["",""]}(Yn);return rs(os({$os:l,$os_version:u,$browser:on(Yn,navigator.vendor),$device:hn(Yn),$device_type:cn(Yn,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==Dn||null==(n=Dn.screen)?void 0:n.width,screenHeight:null==Dn||null==(s=Dn.screen)?void 0:s.height,devicePixelRatio:null==Dn?void 0:Dn.devicePixelRatio}),$timezone:Ip(),$timezone_offset:Cp()}),{$current_url:fs(null==Zn?void 0:Zn.href,a,dp),$host:null==Zn?void 0:Zn.host,$pathname:null==Zn?void 0:Zn.pathname,$raw_user_agent:Yn.length>1e3?Yn.substring(0,997)+"...":Yn,$browser_version:ln(Yn,navigator.vendor),$browser_language:mp(),$browser_language_prefix:(o=mp(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==Dn?void 0:Dn.screen.height,$screen_width:null==Dn?void 0:Dn.screen.width,$viewport_height:null==Dn?void 0:Dn.innerHeight,$viewport_width:null==Dn?void 0:Dn.innerWidth,$lib:Xn.LIB_NAME,$lib_version:Xn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&rs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&rs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Li)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Zp&&(a.$lib_custom_api_host=this.config.api_host),u=t!==lo||s?t!==uo||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=rs(a,u),t===lo&&qn&&(a.title=qn.title),!Gr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Yn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=rs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),zr(this.config.property_denylist)?es(this.config.property_denylist,(function(t){delete a[t]})):Kn.error(Qp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Kn.error(Kp),a=p(a,t));var g=this.Wi();return a.$process_person_profile=g,g&&!s&&this.Gi("_calculate_event_properties"),a}Yi(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Wi())return t;if(this.Si&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=rs({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(Kn.error(Kp),o=a(o,"$set_once")),e&&(this.Si=!0),Wr(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)}Xi(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.ki.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Jp}),()=>{})}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?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Jp})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Jp})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=$l),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Jp}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Jp})}Ji(t){return!t||Jr(t)?(Kn.critical("Unique user id has not been set in posthog.identify"),!1):t===Ks?(Kn.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Kn.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.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return Kn.uninitializedWarning("posthog.identify");if(ti(t)&&(t=t.toString(),Kn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Ji(t)&&this.Gi("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(bs)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(ws)&&(this.unregister(ws),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Vs)||io)===io;t!==i&&s?(this.persistence.set_property(Vs,no),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(ho,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.Ei=Bu(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(qs))}}setPersonProperties(t,e){if((t||e)&&this.Gi("posthog.setPersonProperties")){var r=Bu(this.get_distinct_id(),t,e);this.Ei!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ei=r):Kn.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(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(co,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Kn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.Gi("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n,s,o,a,l;if(Kn.info("reset"),!this.__loaded)return Kn.uninitializedWarning("posthog.reset");var u=this.get_property(bs);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),null==(i=this.surveys)||i.reset(),null==(n=this.Hi)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Vs,io),null==(l=this.sessionManager)||l.resetSessionId(),this.Ei=null,this.config.cookieless_mode===ro)this.register_once({distinct_id:Ks,$device_id:null},"");else{var h=this.config.get_device_id(Wl());this.register_once({distinct_id:h,$device_id:t?h:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Ki()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qi()}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,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(ys)?(Kn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Gi("posthog.alias")?(Gr(e)&&(e=this.get_distinct_id()),t!==e?(this.Xi(ws,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Kn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Ur(t)){var i,n,s,o,a,l,u,h,c;rs(this.config,ng(t));var d=this.Fi();null==(i=this.persistence)||i.update_config(this.config,e,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new kp(r({},this.config,{persistence:"sessionStorage"}),d);var v=this.Ri(this.config.debug);ri(v)&&(this.config.debug=v),ri(this.config.debug)&&(this.config.debug?(Xn.DEBUG=!0,Uf.Yt()&&Uf.Xt("ph_debug",!0),Kn.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(Xn.DEBUG=!1,Uf.Yt()&&Uf.Jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.tn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Xn.LIB_NAME=t,Xn.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.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){if(this.exceptions){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){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}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:tg;return e!==tg&&(e=tg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Vs))===no||(null==(e=this.sessionPersistence)?void 0:e.get_property(Vs))===no}Wi(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===so&&!this._isIdentified()&&Wr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ws])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Xs]))}Vi(){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.Wi()||this.Gi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Gi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Gi(t){return"never"===this.config.person_profiles?(Kn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Xi(Xs,!0),!0)}Fi(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==eo)}tn(){var t,e,r,i,n=this.Fi();return(null==(t=this.persistence)?void 0:t.gr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.gr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==ro){if(this.config.cookieless_mode===eo&&this.consent.isExplicitlyOptedOut()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new jp(this),this.pageViewManager=new lp(this),this.persistence&&(this.sessionPropsManager=new Lp(this,this.sessionManager,this.persistence));var a=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=og.__defaultExtensionClasses)?void 0:o.sessionRecording;a&&(this.sessionRecording=this.Ii(this.sessionRecording,new a(this)))}var l,u;this.consent.optInOut(!0),this.tn(),this.Zi(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==eo&&(null==(l=this.surveys)||l.loadIfEnabled()),(Gr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(u=null==t?void 0:t.captureEventName)&&void 0!==u?u:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$i()}else Kn.warn(Xp)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==ro?(this.config.cookieless_mode===eo&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===eo&&(this.register({distinct_id:Ks,$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.$i())):Kn.warn(Xp)}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 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===ro||(this.config.cookieless_mode===eo?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return jn?qp(jn,this.config.custom_blocked_useragents):void 0}$i(){qn&&("visible"===qn.visibilityState?this.xi||(this.xi=!0,this.capture(lo,{title:qn.title},{send_instantly:!0}),this.Ti&&(qn.removeEventListener(oo,this.Ti),this.Ti=null)):this.Ti||(this.Ti=this.$i.bind(this),us(qn,oo,this.Ti)))}debug(t){!1===t?(null==Dn||Dn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Dn||Dn.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}))}Tr(){var t,e,r,i,n,s,o=this.Ni||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Kn.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",!1,i=Kn,n=(e="advanced_disable_flags")in(t=o)&&!Qr(t[e]),s=r in t&&!Qr(t[r]),n?t[e]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]))}Ui(t){if(Qr(this.config.before_send))return t;var e=zr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),Qr(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return jr(Pr,t.event)?Kn.warn(n+". This can cause unexpected behavior."):Kn.info(n),null}r.properties&&!Wr(r.properties)||Kn.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.lr)?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)})}Ri(t){var e=ri(t)&&!t,r=Uf.Yt()&&"true"===Uf.Wt("ph_debug");return!e&&(!!r||t)}}og.__defaultExtensionClasses={},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=ss(t.prototype[e[r]])}(og,["identify"]);var ag=Qn("[ExceptionAutocapture]"),lg=Qn("[TracingHeaders]"),ug=Qn("[Web Vitals]"),hg=9e5,cg="disabled",dg="lazy_loading",vg="awaiting_config",fg="missing_config";Qn("[SessionRecording]");var pg="[SessionRecording]",gg=Qn(pg),mg=Qn("[Heatmaps]");function yg(t){return Ur(t)&&"clientX"in t&&"clientY"in t&&ti(t.clientX)&&ti(t.clientY)}var bg=Qn("[Product Tours]"),wg="ph_product_tours",_g=["$set_once","$set"],Ig=Qn("[SiteApps]"),Cg="Error while initializing PostHog app with config id ";function Sg(t,e,r){if(Qr(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 kg{constructor(t){this.en=new Dp,this.rn=(t,e)=>this.nn(t,e)&&this.sn(t,e)&&this.an(t,e)&&this.ln(t,e),this.nn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.un=new Set,this.hn=new Set}init(){var t,e;Gr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Gr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.hn)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.un)||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.un.has(t)||this.un.has(null==e?void 0:e.event))&&this.hn&&(null==(r=this.hn)?void 0:r.size)>0&&this.hn.forEach((t=>{this.cn(e,t)&&this.en.emit("actionCaptured",t.name)}))}dn(t){this.onAction("actionCaptured",(e=>t(e)))}cn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.rn(t,r))return!0;return!1}onAction(t,e){return this.en.on(t,e)}sn(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(!Sg(i,e.url,e.url_matching||"contains"))return!1}return!0}an(t,e){return!!this.vn(t,e)&&!!this.fn(t,e)&&!!this.pn(t,e)}vn(t,e){var r;if(null==e||!e.href)return!0;var i=this.gn(t);if(i.length>0)return i.some((t=>Sg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Sg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}fn(t,e){var r;if(null==e||!e.text)return!0;var i=this.gn(t);if(i.length>0)return i.some((t=>Sg(t.text,e.text,e.text_matching||"exact")||Sg(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!Qr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Sg(t,s,o))))}pn(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 s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}gn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ln(t,e){return null==e||!e.properties||0===e.properties.length||Zu(e.properties.reduce(((t,e)=>{var r=zr(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 xg{constructor(t){this._instance=t,this.mn=new Map,this.yn=new Map,this.bn=new Map}wn(t,e){return!!t&&Zu(t.propertyFilters,null==e?void 0:e.properties)}_n(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}In(t,e,r){var i=(r===bl?this.mn:this.yn).get(t),n=[];return this.Cn((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.wn(s,e)}))}register(t){var e;Gr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Sn(t),this.kn(t))}kn(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}));0!==e.length&&(null==this.xn&&(this.xn=new kg(this._instance),this.xn.init(),this.xn.dn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;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.xn)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.bn.get(e.name);r&&r.push(t.id),this.bn.set(e.name,r||[t.id])}})))})))}Sn(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}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.mn=this._n(t,bl),this.yn=this._n(t,wl))}onEvent(t,e){var r,i=this.re(),n=this.Tn(),s=this.An(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});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=o.indexOf(u);0>h||(o.splice(h,1),this.En(o))}}else{if(this.yn.has(t)){var c=this.In(t,e,wl);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);0>e||o.splice(e,1),this.Rn(t.id)})),this.En(o))}if(this.mn.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.mn.get(t)});var d=this.In(t,e,bl);this.En(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.Tn(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.bn.has(t)&&this.En(i.concat(this.bn.get(t)||[]))}En(t){var e,r=this.re(),i=this.Tn(),n=[...new Set(t)].filter((t=>!this.Nn(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.Tn();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.mn}Mn(){return this.xn}}class Tg extends xg{constructor(t){super(t)}Tn(){return"$surveys_activated"}An(){return Al.SHOWN}Cn(t){var e;null==(e=this._instance)||e.getSurveys(t)}Rn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}re(){return Nl}Nn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Ag="SDK is not enabled or survey functionality is not yet loaded",Eg="Disabled. Not loading surveys.",Rg=null!=Dn&&Dn.location?ps(Dn.location.hash,"__posthog")||ps(location.hash,"state"):null,Ng="_postHogToolbarParams",Mg=Qn("[Toolbar]"),Fg=Qn("[FeatureFlags]"),Og=Qn("[FeatureFlags]",{debugEnabled:!0}),Pg="\" failed. Feature flags didn't load in time.",Lg="$active_feature_flags",Dg="$override_feature_flags",Bg="$feature_flag_payloads",jg="$override_feature_flag_payloads",qg="$feature_flag_request_id",Zg=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},$g=t=>{var e={};for(var[r,i]of is(t||{}))i&&(e[r]=i);return e},Hg="Refusing to render web experiment since the viewer is a likely bot",Vg={icontains:(t,e)=>!!Dn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Dn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Dn&&Du(e.href,t),not_regex:(t,e)=>!!Dn&&!Du(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class zg{get Rt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{zg.Fn("retrieved web experiments from the server"),e.On=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.On&&(zg.Fn("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.On)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Xr(i)&&t.variants[i]&&e.Pn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];zg.Ln(s)&&e.Pn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())zg.Fn(Hg);else if(!this.Rt.disable_web_experiments){if(Qr(this.On))return this.On=new Map,this.loadIfEnabled(),void this.previewWebExperiment();zg.Fn("applying feature flags",t),t.forEach((t=>{var e;if(this.On&&null!=(e=this.On)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.On)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Pn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=zg.getWindowLocation();if(null!=t&&t.search){var e=vs(null==t?void 0:t.search,"__experiment_id"),r=vs(null==t?void 0:t.search,"__experiment_variant");e&&r&&(zg.Fn("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Dn(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Rt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Rt.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.Rt.token),method:"GET",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Dn(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(zg.Fn("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Pn(i[0].name,e,i[0].variants[e].transforms))}static Ln(t){return!Qr(t.conditions)&&zg.Bn(t)&&zg.jn(t)}static Bn(t){var e;if(Qr(t.conditions)||Qr(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=zg.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Vg[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Dn?void 0:Dn.location}static jn(t){var e;if(Qr(t.conditions)||Qr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=fp();if(r.utm_source){var i,n,s,o,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==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.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 Fn(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];Kn.info("[WebExperiments] "+t,r)}Pn(t,e,r){this._is_bot()?zg.Fn(Hg):"control"!==e?r.forEach((r=>{if(r.selector){var i;zg.Fn("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)}))}})):zg.Fn("Control variants leave the page unmodified.")}_is_bot(){return jn&&this._instance?qp(jn,this.Rt.custom_blocked_useragents):void 0}}var Yg,Ug,Wg=Qn("[Conversations]"),Gg="Conversations not available yet.",Xg={featureFlags:class{constructor(t){this.qn=!1,this.Zn=!1,this.$n=!1,this.Hn=!1,this.Vn=!1,this.zn=!1,this.Yn=!1,this.Un=!1,this._instance=t,this.featureFlagEventHandlers=[]}get Rt(){return this._instance.config}get Kr(){return this._instance.persistence}Wn(t){return this._instance.get_property(t)}Gn(){var t,e;return null!==(t=null==(e=this.Kr)?void 0:e.mr(this.Rt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}Xn(){return!!this.Gn()&&(this.Un||this.$n||(this.Un=!0,Fg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Jn(){var t,e=null!==(t=this.Rt.evaluation_contexts)&&void 0!==t?t:this.Rt.evaluation_environments;return!this.Rt.evaluation_environments||this.Rt.evaluation_contexts||this.Yn||(Fg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yn=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Fg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Kn(){return this.Jn().length>0}initialize(){var t,e,{config:r}=this._instance,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),l={};for(var[u,h]of Object.entries(o)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:Gr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Zn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Wn(Ls),e=this.Wn(Dg),i=this.Wn(jg);if(!i&&!e)return t||{};var n=rs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],c=Gr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=Gr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});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[o]=f}return this.qn||(Fg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.qn=!0),n}getFlagVariants(){var t=this.Wn(Os),e=this.Wn(Dg);if(!e)return t||{};for(var r=rs({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.qn||(Fg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.qn=!0),r}getFlagPayloads(){var t=this.Wn(Bg),e=this.Wn(jg);if(!e)return t||{};for(var r=rs({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.qn||(Fg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.qn=!0),r}reloadFeatureFlags(){this.Hn||this.Rt.advanced_disable_feature_flags||this.Qn||(this._instance.ki.emit("featureFlagsReloading",!0),this.Qn=setTimeout((()=>{this.ts()}),5))}es(){clearTimeout(this.Qn),this.Qn=void 0}ensureFlagsLoaded(){this.Zn||this.$n||this.Qn||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Hn=t}ts(t){var e;if(this.es(),!this._instance.Tr())if(this.$n)this.Vn=!0;else{var i=this.Rt.token,n=this.Wn(bs),s={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.Kr)?void 0:e.get_initial_props())||{},this.Wn(Ds)||{}),group_properties:this.Wn(Bs),timezone:Ip()};Kr(n)||Gr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Rt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Kn()&&(s.evaluation_contexts=this.Jn());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Rt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$n=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Rt.disable_compression?void 0:Jl,timeout:this.Rt.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(200===t.statusCode&&(this.Vn||(this.$anon_distinct_id=void 0),n=!1),this.$n=!1,!s.disable_flags||this.Vn){this.zn=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.Kr)||i.register({[$s]:o}),l)Fg.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 s.disable_flags||this.receivedFeatureFlags(null!==(a=t.json)&&void 0!==a?a:{},n),this.Vn&&(this.Vn=!1,this.ts())}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.zn)if(this.Zn||this.getFlags()&&this.getFlags().length>0){if(!this.Xn()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Fg.warn('getFeatureFlag for key "'+t+Pg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.zn)if(this.Zn||this.getFlags()&&this.getFlags().length>0){if(!this.Xn()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Wn(qg)||void 0,l=this.Wn(Hs)||void 0,u=this.Wn(qs)||{};if(this.Rt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.Wn(Zs);c&&c!==d&&(u={},null==(h=this.Kr)||h.register({[qs]:u,[Zs]:c}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,w,_,I;zr(u[t])?u[t].push(o):u[t]=[o],null==(v=this.Kr)||v.register({[qs]:u});var C=this.getFeatureFlagDetails(t),S=[...null!==(f=this.Wn($s))&&void 0!==f?f:[]];Gr(n)&&S.push("flag_missing");var k={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Rt.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Rt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.zn};Gr(null==C||null==(m=C.metadata)?void 0:m.version)||(k.$feature_flag_version=C.metadata.version);var x,T=null!==(y=null==C||null==(b=C.reason)?void 0:b.description)&&void 0!==y?y:null==C||null==(w=C.reason)?void 0:w.code;T&&(k.$feature_flag_reason=T),null!=C&&null!=(_=C.metadata)&&_.id&&(k.$feature_flag_id=C.metadata.id),Gr(null==C?void 0:C.original_variant)&&Gr(null==C?void 0:C.original_enabled)||(k.$feature_flag_original_response=Gr(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(I=C.metadata)&&I.original_payload&&(k.$feature_flag_original_payload=null==C||null==(x=C.metadata)?void 0:x.original_payload),S.length&&(k.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",k)}if(i){var A=s;if(!Gr(s))try{A=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:A}}}}else Fg.warn('getFeatureFlagResult for key "'+t+Pg)}getRemoteConfigPayload(t,e){var r=this.Rt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Kn()&&(i.evaluation_contexts=this.Jn()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Rt.disable_compression?void 0:Jl,timeout:this.Rt.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={}),!e.fresh||this.zn){if(this.Zn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return Gr(r)?void 0:!!r}Fg.warn('isFeatureEnabled for key "'+t+Pg)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this.Kr){this.Zn=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=(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]})))):Fg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(zr(l)){Fg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;l.length>v;v++)d[l[v]]=!0;e&&e.register({[Lg]:l,[Os]:d})}else{var f=l,p=u,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=r({},i,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=r({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=r({},s,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=r({},i,f),p=r({},n,p),g=r({},s,g);e&&e.register(r({[Lg]:Object.keys($g(f)),[Os]:f||{},[Bg]:p||{},[Ls]:g||{}},h?{[qg]:h}:{},c?{[Hs]:c}:{}))}}}(t,this.Kr,i,n,s),e||(this.Un=!1),this.rs(e)}}override(t,e){void 0===e&&(e=!1),Fg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Kr)return Fg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Kr.unregister(Dg),this.Kr.unregister(jg),this.rs(),Og.info("All overrides cleared");if(zr(t)){var e=Zg(t);return this.Kr.register({[Dg]:e}),this.rs(),Og.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.qn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.Kr.unregister(Dg),Og.info("Flag overrides cleared");else if(i.flags){if(zr(i.flags)){var n=Zg(i.flags);this.Kr.register({[Dg]:n})}else this.Kr.register({[Dg]:i.flags});Og.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.Kr.unregister(jg),Og.info("Payload overrides cleared")):i.payloads&&(this.Kr.register({[jg]:i.payloads}),Og.info("Payload overrides set",{payloads:i.payloads}))),void this.rs()}if(t&&"object"==typeof t)return this.Kr.register({[Dg]:t}),this.rs(),Og.info("Flag overrides set",{flags:t});Fg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Zn){var{flags:e,flagVariants:r}=this.ns();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.Wn(Ps)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this.Kr)||n.register({[Lg]:Object.keys($g(l)),[Os]:l}),this.rs()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.Wn(Ps),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.Rt.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.Kr)||r.unregister(Ps),null==(i=this.Kr)||i.register({[Ps]:n}),t(n)}}})}ns(){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)),{})}}rs(t){var{flags:e,flagVariants:r}=this.ns();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wn(Ds)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Ds]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ds)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wn(Bs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Bs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wn(Bs)||{};this._instance.register({[Bs]:r({},e,{[t]:{}})})}else this._instance.unregister(Bs)}reset(){this.Zn=!1,this.$n=!1,this.Hn=!1,this.Vn=!1,this.zn=!1,this.$anon_distinct_id=void 0,this.es(),this.qn=!1}}},Jg={sessionRecording:class{get Rt(){return this._instance.config}get Kr(){return this._instance.persistence}get started(){var t;return!(null==(t=this.ss)||!t.isStarted)}get status(){var t,e;return this.os===vg||this.os===fg?this.os:null!==(t=null==(e=this.ss)?void 0:e.status)&&void 0!==t?t:this.os}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.os=cg,this.ls=void 0,this._instance=t,!this._instance.sessionManager)throw gg.error("started without valid sessionManager"),new Error(pg+" started without valid sessionManager. This is a bug.");if(this.Rt.cookieless_mode===ro)throw new Error(pg+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get us(){var t,e=!(null==(t=this._instance.get_property(Ns))||!t.enabled),r=!this.Rt.disable_session_recording,i=this.Rt.disable_session_recording||this._instance.consent.isOptedOut();return Dn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.us||null==(e=this.ss)||!e.isStarted){var r=!Gr(Object.assign)&&!Gr(Array.from);this.us&&r?(this.hs(t),gg.info("starting")):(this.os=cg,this.stopRecording())}}hs(t){var e,r,i;this.us&&(this.os!==vg&&this.os!==fg&&(this.os=dg),null!=Un&&null!=(e=Un.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=Un.__PosthogExtensions__)&&r.initSessionRecording?this.cs(t):null==(i=Un.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.ds,(e=>{if(e)return gg.error("could not load recorder",e);this.cs(t)})))}stopRecording(){var t,e;null==(t=this.ls)||t.call(this),this.ls=void 0,null==(e=this.ss)||e.stop()}vs(){var t,e;null==(t=this.ls)||t.call(this),this.ls=void 0,null==(e=this.ss)||e.discard()}fs(){var t;null==(t=this.Kr)||t.unregister(Fs)}ps(t,e){if(Qr(t))return null;var r,i=ti(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(gg.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}gs(t){if(this.Kr){var e,i,n=this.Kr,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.ps(null==(e=this.Rt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.ps(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Qr(a)&&this.fs();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Ns]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Gr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers})})};s(),null==(e=this.ls)||e.call(this),this.ls=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.gs(t),void this.vs()):(this.gs(t),void this.startIfEnabledOrStop()):(this.os===vg&&(this.os=fg,gg.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.ss)&&r.log?this.ss.log(t,e):gg.warn("log called before recorder was ready")}get ds(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Ns);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}ys(){var t,e=this._instance.get_property(Ns);if(!e)return!1;var r=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-r}cs(t){var e,r;if(null==(e=Un.__PosthogExtensions__)||!e.initSessionRecording)return gg.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.ss||(this.ss=null==(r=Un.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ss._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ys()){if(this.os===fg||this.os===vg)return;return this.os=vg,gg.info("persisted remote config is stale, requesting fresh config before starting"),void new Ep(this._instance).load()}this.os=dg,this.ss.start(t)}onRRwebEmit(t){var e;null==(e=this.ss)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.ss||null==(e=this.Kr)||e.register({$replay_override_linked_flag:!0}),null==(t=this.ss)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ss||null==(e=this.Kr)||e.register({$replay_override_sampling:!0}),null==(t=this.ss)||t.overrideSampling()}overrideTrigger(t){var e,r;this.ss||null==(r=this.Kr)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(e=this.ss)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.ss)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.ss)||!r.tryAddCustomEvent(t,e))}}},Kg={autocapture:class{constructor(t){this.bs=!1,this.ws=null,this._s=!1,this.instance=t,this.rageclicks=new Nf(t.config.rageclick),this.Is=null}initialize(){this.startIfEnabled()}get Rt(){var t,e,r=Ur(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}Cs(){if(this.isBrowserSupported()){if(Dn&&qn){var t=t=>{t=t||(null==Dn?void 0:Dn.event);try{this.Ss(t)}catch(t){Ff.error("Failed to capture event",t)}};if(us(qn,"submit",t,{capture:!0}),us(qn,"change",t,{capture:!0}),us(qn,"click",t,{capture:!0}),this.Rt.capture_copied_text){var e=t=>{this.Ss(t=t||(null==Dn?void 0:Dn.event),Mf)};us(qn,"copy",e,{capture:!0}),us(qn,"cut",e,{capture:!0})}}}else Ff.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.bs&&(this.Cs(),this.bs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._s=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Is]:!!t.autocapture_opt_out}),this.ws=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Is=t}getElementSelectors(t){var e,r=[];return null==(e=this.Is)||e.forEach((e=>{var i=null==qn?void 0:qn.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[Is];if(Kr(this.ws)&&!ri(r)&&!this.instance.Tr())return!1;var i=null!==(e=this.ws)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}Ss(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Co(t);go(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())&&function(t,e){if(!Dn||Eo(t))return!1;var r,i,n;if(ri(e)?(r=!!e&&Ao,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ao,i=null==e?void 0:e.content_ignorelist),!1===r)return!1;var{targetElementList:s}=Ro(t,!1);return!function(t,e){if(!1===t||Gr(t))return!1;var r;if(!0===t)r=To;else{if(!zr(t))return!1;if(t.length>10)return Kn.error("[PostHog] content_ignorelist array cannot exceed 10 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,s.map((t=>{var e;return{safeText:Io(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!ko(s,r)}(i,this.instance.config.rageclick)&&this.Ss(t,"$rageclick");var n=e===Mf;if(i&&function(t,e,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Dn||Eo(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!bo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&bo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Ro(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Gr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!ko(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Dn.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&&(So.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Rt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Lf(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.element_attribute_ignorelist,elementsChainAsString:this._s});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===Mf){var l,u=_o(null==Dn||null==(l=Dn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Yr(null==qn?void 0:qn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ks=(null==Dn||null==(e=Dn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Kn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.xs&&this.xs(),this.xs=void 0,Kn.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Dn&&Dn.history){var r=this;null!=(t=Dn.history.pushState)&&t.__posthog_wrapped__||gs(Dn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ts("pushState")})),null!=(e=Dn.history.replaceState)&&e.__posthog_wrapped__||gs(Dn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ts("replaceState")})),this.As()}}Ts(t){try{var e,r=null==Dn||null==(e=Dn.location)?void 0:e.pathname;if(!r)return;r!==this.ks&&this.isEnabled&&this._instance.capture(lo,{navigation_type:t}),this.ks=r}catch(e){Kn.error("Error capturing "+t+" pageview",e)}}As(){if(!this.xs){var t=()=>{this.Ts("popstate")};us(Dn,"popstate",t),this.xs=()=>{Dn&&Dn.removeEventListener("popstate",t)}}}},heatmaps:class{get Rt(){return this.instance.config}constructor(t){var e;this.Es=!1,this.bs=!1,this.Rs=null,this.instance=t,this.Es=!(null==(e=this.instance.persistence)||!e.props[Cs]),this.rageclicks=new Nf(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ur(this.Rt.capture_heatmaps)&&this.Rt.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qr(this.Rt.capture_heatmaps)?Qr(this.Rt.enable_heatmaps)?this.Es:this.Rt.enable_heatmaps:!1!==this.Rt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.bs)return;mg.info("starting..."),this.Ns(),this.Tt()}else{var t;clearInterval(null!==(t=this.Rs)&&void 0!==t?t:void 0),this.Ms(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Cs]:e}),this.Es=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.T;return this.T=void 0,t}Fs(t){this.wt(t.originalEvent,"deadclick")}Tt(){this.Rs&&clearInterval(this.Rs),this.Rs=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(qn)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Ns(){Dn&&qn&&(this.Os=this.Zr.bind(this),us(Dn,ao,this.Os),this.Ps=t=>this.wt(t||(null==Dn?void 0:Dn.event)),us(qn,"click",this.Ps,{capture:!0}),this.Ls=t=>this.Ds(t||(null==Dn?void 0:Dn.event)),us(qn,"mousemove",this.Ls,{capture:!0}),this.Bs=new ip(this.instance,ep,this.Fs.bind(this)),this.Bs.startIfEnabledOrStop(),this.js=this.Tt.bind(this),us(qn,oo,this.js),this.bs=!0)}Ms(){var t;Dn&&qn&&(this.Os&&Dn.removeEventListener(ao,this.Os),this.Ps&&qn.removeEventListener("click",this.Ps,{capture:!0}),this.Ls&&qn.removeEventListener("mousemove",this.Ls,{capture:!0}),this.js&&qn.removeEventListener(oo,this.js),clearTimeout(this.qs),null==(t=this.Bs)||t.stop(),this.bs=!1)}Zs(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&fo(i)&&!po(i,"body");){if(i===r)return!1;if(jr(e,null==Dn?void 0:Dn.getComputedStyle(i).position))return!0;i=xo(i)}return!1}(Co(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}wt(t,e){var i;if(void 0===e&&(e="click"),!vo(t.target)&&yg(t)){var n=this.Zs(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.$s(r({},n,{type:"rageclick"})),this.$s(n)}}Ds(t){!vo(t.target)&&yg(t)&&(clearTimeout(this.qs),this.qs=setTimeout((()=>{this.$s(this.Zs(t,"mousemove"))}),500))}$s(t){if(Dn){var e=Dn.location.href,r=this.Rt.custom_personal_data_properties,i=this.Rt.mask_personal_data_properties?[...hp,...r||[]]:[],n=fs(e,i,dp);this.T=this.T||{},this.T[n]||(this.T[n]=[]),this.T[n].push(t)}}Zr(){this.T&&!Wr(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ip,webVitalsAutocapture:class{constructor(t){var e;this.Es=!1,this.bs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hs=()=>{clearTimeout(this.Vs),0!==this.T.metrics.length&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.nt=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(Gr(i))ug.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.zs();Gr(n)||(Qr(null==t?void 0:t.name)||Qr(null==t?void 0:t.value)?ug.error("Invalid metric received",t):!this.Ys||this.Ys>t.value?(this.T.url!==n&&(this.Hs(),this.Vs=setTimeout(this.Hs,this.flushToCaptureTimeoutMs)),Gr(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=Gr(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.T.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.Hs()):ug.error("Ignoring metric with value >= "+this.Ys,t))}},this.Us=()=>{if(!this.bs){var t,e,r,i,n=Un.__PosthogExtensions__;Gr(n)||Gr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.nt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.nt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.nt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.nt.bind(this)),this.bs=!0):ug.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Es=!(null==(e=this._instance.persistence)||!e.props[Ts]),this.startIfEnabled()}get Ws(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Ur(this.Ws)?null==(t=this.Ws)?void 0:t.web_vitals_allowed_metrics:void 0;return Qr(r)?(null==(e=this._instance.persistence)?void 0:e.props[Rs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ur(this.Ws)?this.Ws.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ur(this.Ws)?this.Ws.web_vitals_attribution:void 0;return null!=t&&t}get Ys(){var t=Ur(this.Ws)&&ti(this.Ws.__web_vitals_max_value)?this.Ws.__web_vitals_max_value:hg;return t>0&&6e4>=t?hg:t}get isEnabled(){var t=null==Zn?void 0:Zn.protocol;if("http:"!==t&&"https:"!==t)return ug.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ur(this.Ws)?this.Ws.web_vitals:ri(this.Ws)?this.Ws:void 0;return ri(e)?e:this.Es}startIfEnabled(){this.isEnabled&&!this.bs&&(ug.info("enabled, starting..."),this.nr(this.Us))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ur(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Ur(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ts]:e}),this._instance.persistence.register({[Rs]:r})),this.Es=e,this.startIfEnabled()}}nr(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?ug.error("failed to load script",e):t()}))}zs(){var t=Dn?Dn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...hp,...e||[]]:[];return fs(t,r,dp)}ug.error("Could not determine current URL")}}},Qg={exceptionObserver:class{constructor(t){var e,r,i;this.Us=()=>{var t;if(Dn&&this.isEnabled&&null!=(t=Un.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Un.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Un.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Un.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Gs&&this.Rt.capture_unhandled_errors&&(this.Gs=e(this.captureException.bind(this))),!this.Xs&&this.Rt.capture_unhandled_rejections&&(this.Xs=r(this.captureException.bind(this))),!this.Js&&this.Rt.capture_console_errors&&(this.Js=i(this.captureException.bind(this)))}catch(t){ag.error("failed to start",t),this.Ks()}}},this._instance=t,this.Qs=!(null==(e=this._instance.persistence)||!e.props[Ss]),this.eo=new ci({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,qt:ag}),this.Rt=this.ro(),this.startIfEnabledOrStop()}ro(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ur(t)?e=r({},e,t):(Gr(t)?this.Qs:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rt.capture_console_errors||this.Rt.capture_unhandled_errors||this.Rt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ag.info("enabled"),this.Ks(),this.nr(this.Us)):this.Ks()}nr(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return ag.error("failed to load script",e);t()}))}Ks(){var t,e,r;null==(t=this.Gs)||t.call(this),this.Gs=void 0,null==(e=this.Xs)||e.call(this),this.Xs=void 0,null==(r=this.Js)||r.call(this),this.Js=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Qs=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ss]:this.Qs}),this.Rt=this.ro(),this.startIfEnabledOrStop())}onConfigChange(){this.Rt=this.ro()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.eo.consumeRateLimit(n)?ag.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.io=[],this.no=Vv(),this._instance=t,this.io=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(ks))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i;if("errorTracking"in t){var n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.io=n,this._instance.persistence&&this._instance.persistence.register({[ks]:this.io,[xs]:s})}}get so(){var t,e=!!this._instance.get_property(xs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.no.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.oo(e)){if(this.ao(e))return void Hv.info("Skipping exception capture because a suppression rule matched");if(!this.so&&this.lo(e))return void Hv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.uo(e))return void Hv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",zi:!0})}ao(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return Xr(r)&&r.length>0&&t.$exception_types.push(r),Xr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.io.some((t=>{var r=t.values.map((t=>{var r,i=ju[t.operator],n=zr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}lo(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://")))}uo(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}oo(t){return!Qr(t)&&zr(t)}}},tm=r({productTours:class{get Kr(){return this._instance.persistence}constructor(t){this.ho=null,this.co=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.Kr&&this.Kr.register({[Es]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.ho||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Es)||this.nr((()=>this.do()))}nr(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?bg.error("Could not load product tours script",e):t()}))}do(){var t;!this.ho&&null!=(t=Un.__PosthogExtensions__)&&t.generateProductTours&&(this.ho=Un.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!zr(this.co)||e){var r=this.Kr;if(r){var i=r.props[wg];if(zr(i)&&!e)return this.co=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 bg.error(n),void t([],{isLoaded:!1,error:n})}var s=zr(e.json.product_tours)?e.json.product_tours:[];this.co=s,r&&r.register({[wg]:s}),t(s,{isLoaded:!0})}})}else t(this.co,{isLoaded:!0})}getActiveProductTours(t){Qr(this.ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ho)||e.showTourById(t)}previewTour(t){this.ho?this.ho.previewTour(t):this.nr((()=>{var e;this.do(),null==(e=this.ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ho)||t.nextStep()}previousStep(){var t;null==(t=this.ho)||t.previousStep()}clearCache(){var t;this.co=null,null==(t=this.Kr)||t.unregister(wg)}resetTour(t){var e;null==(e=this.ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ho)||e.cancelPendingTour(t)}}},Xg),em={siteApps:class{constructor(t){this._instance=t,this.vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}fo(t,e){if(e){var r=this.globalsForEvent(e);this.vo.push(r),this.vo.length>1e3&&(this.vo=this.vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Un._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.fo.bind(this));this.po=()=>{t(),this.vo=[],this.po=void 0}}}globalsForEvent(t){var e,n,s,o,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,_g),{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!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},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.vo.length&&(Ig.info("Processing "+this.vo.length+" events for site app with id "+t.id),this.vo.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.po)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Ig.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback(t){n(t)}});s&&(e.processEvent=s),i=!0}catch(e){Ig.error(Cg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Ig.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}mo(){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)}yo(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){Ig.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.mo(),void this._instance.on("eventCaptured",(t=>this.yo(t)))):void Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.po)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;Un["__$$ph_site_app_"+t]=n._instance,null==(e=Un.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Ig.error(Cg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},rm={tracingHeaders:class{constructor(t){this.bo=void 0,this.wo=void 0,this.Us=()=>{var t,e;Gr(this.bo)&&(null==(t=Un.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Gr(this.wo)&&(null==(e=Un.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}initialize(){this.startIfEnabledOrStop()}nr(t){var e,r;null!=(e=Un.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=Un.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return lg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.nr(this.Us):(null==(t=this.bo)||t.call(this),null==(e=this.wo)||e.call(this),this.bo=void 0,this.wo=void 0)}}},im=r({surveys:class{get Rt(){return this._instance.config}constructor(t){this._o=void 0,this._surveyManager=null,this.Io=!1,this.Co=[],this.So=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Rt.disable_surveys){var e=t.surveys;if(Qr(e))return Nl.warn("Flags not loaded yet. Not loading surveys.");var r=zr(e);this._o=r?e.length>0:e,Nl.info("flags response received, isSurveysEnabled: "+this._o),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Pl)||null!=r&&r.startsWith(Ll))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Io)Nl.info("Already initializing surveys, skipping...");else if(this.Rt.disable_surveys)Nl.info(Eg);else if(this.Rt.cookieless_mode&&this._instance.consent.isOptedOut())Nl.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Un?void 0:Un.__PosthogExtensions__;if(t){if(!Gr(this._o)||this.Rt.advanced_enable_surveys){var e=this._o||this.Rt.advanced_enable_surveys;this.Io=!0;try{var r=t.generateSurveys;if(r)return void this.ko(r,e);var i=t.loadExternalDependency;if(!i)return void this.xo(to);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.xo("Could not load surveys script",r):this.ko(t.generateSurveys,e)}))}catch(t){throw this.xo("Error initializing surveys",t),t}finally{this.Io=!1}}}else Nl.error("PostHog Extensions not found.")}}ko(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Tg(this._instance),Nl.info("Surveys loaded successfully"),this.To({isLoaded:!0})}xo(t,e){Nl.error(t,e),this.To({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Co.push(t),this._surveyManager&&this.To({isLoaded:!0}),()=>{this.Co=this.Co.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Rt.disable_surveys)return Nl.info(Eg),t([]);var r,i=this._instance.get_property(js);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.So?this.So.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.So=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Rt.token),method:"GET",timeout:this.Rt.surveys_request_timeout_ms,callback:e=>{var i;this.So=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Nl.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Fl(t)||Ol(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[js]:l});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}To(t){for(var e of this.Co)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Nl.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Qr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Nl.warn("init was not called")}Ao(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}Eo(t){if(Qr(this._surveyManager))return{eligible:!1,reason:Ag};var e="string"==typeof t?this.Ao(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qr(this._surveyManager))return Nl.warn("init was not called"),{visible:!1,disabledReason:Ag};var e=this.Eo(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qr(this._surveyManager)?(Nl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ag})):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 s=this.Eo(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(Qr(this._surveyManager))Nl.warn("init was not called");else{var n="string"==typeof t?this.Ao(t):t;if(null!=n&&n.id)if(Zl.includes(n.type)){var s=null==qn?void 0:qn.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Nl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Nl.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Nl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Nl.warn("Survey element not found")}else Nl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Nl.warn("Survey not found")}}displaySurvey(t,e){var i;if(Qr(this._surveyManager))Nl.warn("init was not called");else{var n=this.Ao(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Rl&&e.initialResponses&&Nl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Nl.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Nl.warn("Survey not found")}}cancelPendingSurvey(t){Qr(this._surveyManager)?Nl.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Xg),nm={toolbar:class{constructor(t){this.instance=t}Ro(t){Un.ph_toolbar_state=t}No(){var t;return null!==(t=Un.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),hs(this.instance.config))return!1;if(!Dn||!qn)return!1;t=null!=t?t:Dn.location,r=null!=r?r:Dn.history;try{if(!e){try{Dn.localStorage.setItem("test","test"),Dn.localStorage.removeItem("test")}catch(t){return!1}e=null==Dn?void 0:Dn.localStorage}var i,n=Rg||ps(t.hash,"__posthog")||ps(t.hash,"state"),s=n?ns((()=>JSON.parse(atob(decodeURIComponent(n)))))||ns((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Ng)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Mo(t){var e=Un.ph_load_toolbar||Un.ph_load_editor;!Qr(e)&&Yr(e)?e(t,this.instance):Mg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==qn||!qn.getElementById(Js));if(!Dn||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(Dn.localStorage.setItem(Ng,JSON.stringify(r({},n,{source:void 0}))),2===this.No())this.Mo(n);else if(0===this.No()){var s;this.Ro(1),null==(s=Un.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Mg.error("[Toolbar] Failed to load",t),void this.Ro(0);this.Ro(2),this.Mo(n)})),us(Dn,"turbolinks:load",(()=>{this.Ro(0),this.loadToolbar(n)}))}return!0}Fo(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)}}},sm=r({experiments:zg},Xg),om={conversations:class{constructor(t){this.Oo=void 0,this._conversationsManager=null,this.Po=!1,this.Lo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Qr(e)||(ri(e)?this.Oo=e:(this.Oo=e.enabled,this.Lo=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Oo=void 0,this.Lo=null}loadIfEnabled(){if(!(this._conversationsManager||this.Po||this._instance.config.disable_conversations||hs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Un?void 0:Un.__PosthogExtensions__;if(t&&!Gr(this.Oo)&&this.Oo)if(this.Lo&&this.Lo.token){this.Po=!0;try{var e=t.initConversations;if(e)return this.Do(e),void(this.Po=!1);var r=t.loadExternalDependency;if(!r)return void this.Bo(to);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.Bo("Could not load conversations script",e):this.Do(t.initConversations),this.Po=!1}))}catch(t){this.Bo("Error initializing conversations",t),this.Po=!1}}else Wg.error("Conversations enabled but missing token in remote config.")}}Do(t){if(this.Lo)try{this._conversationsManager=t(this.Lo,this._instance),Wg.info("Conversations loaded successfully")}catch(t){this.Bo("Error completing conversations initialization",t)}else Wg.error("Cannot complete initialization: remote config is null")}Bo(t,e){Wg.error(t,e),this._conversationsManager=null,this.Po=!1}show(){this._conversationsManager?this._conversationsManager.show():Wg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Oo&&!Kr(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):(Wg.warn(Gg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Wg.warn(Gg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Wg.warn(Gg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Wg.warn(Gg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Wg.warn(Gg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Wg.warn(Gg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Wg.warn(Gg),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}Ki(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qi(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},am={logs:class{constructor(t){var e;this.jo=!1,this.qo=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.jo=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!Qr(r)&&r&&(this.jo=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.jo&&!this.qo){var t=Qn("[logs]"),e=null==Un?void 0:Un.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=e.logs)||!i.initializeLogs?t.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.qo=!0)})):t.error(to)}else t.error("PostHog Extensions not found.")}}}},lm=r({},Xg,Jg,Kg,Qg,tm,em,im,rm,nm,sm,om,am);og.__defaultExtensionClasses=r({},lm),Yg=Up[tg]=new og,(Ug=Un.posthog)&&es(Ug._i,(function(t){if(t&&zr(t)){var e=Yg.init(t[0],t[1],t[2]),r=Ug[t[2]]||Ug;e&&(e._execute_array.call(e.people,r.people),e._execute_array(r))}})),Un.posthog=Yg,function(){function t(){t.done||(t.done=!0,eg=!1,es(Up,(function(t){t._dom_loaded()})))}null!=qn&&qn.addEventListener?"complete"===qn.readyState?t():us(qn,"DOMContentLoaded",t,{capture:!1}):Dn&&Kn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.js.map