posthog-js 1.331.2 → 1.331.3

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.
Files changed (44) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/lazy-recorder.js +1 -1
  13. package/dist/main.js +1 -1
  14. package/dist/module.full.js +1 -1
  15. package/dist/module.full.js.map +1 -1
  16. package/dist/module.full.no-external.js +1 -1
  17. package/dist/module.full.no-external.js.map +1 -1
  18. package/dist/module.js +1 -1
  19. package/dist/module.no-external.js +1 -1
  20. package/dist/posthog-recorder.js +1 -1
  21. package/dist/product-tours-preview.js +1 -1
  22. package/dist/product-tours-preview.js.map +1 -1
  23. package/dist/product-tours.js +1 -1
  24. package/dist/product-tours.js.map +1 -1
  25. package/dist/src/extensions/product-tours/product-tours-utils.d.ts +1 -0
  26. package/dist/src/extensions/surveys/components/PostHogLogo.d.ts +5 -1
  27. package/dist/surveys-preview.js +1 -1
  28. package/dist/surveys-preview.js.map +1 -1
  29. package/dist/surveys.js +1 -1
  30. package/dist/surveys.js.map +1 -1
  31. package/lib/package.json +1 -1
  32. package/lib/src/extensions/product-tours/components/ProductTourTooltip.js +5 -3
  33. package/lib/src/extensions/product-tours/components/ProductTourTooltip.js.map +1 -1
  34. package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js +2 -1
  35. package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js.map +1 -1
  36. package/lib/src/extensions/product-tours/product-tours-utils.d.ts +1 -0
  37. package/lib/src/extensions/product-tours/product-tours-utils.js +23 -4
  38. package/lib/src/extensions/product-tours/product-tours-utils.js.map +1 -1
  39. package/lib/src/extensions/surveys/components/BottomSection.js +1 -1
  40. package/lib/src/extensions/surveys/components/BottomSection.js.map +1 -1
  41. package/lib/src/extensions/surveys/components/PostHogLogo.d.ts +5 -1
  42. package/lib/src/extensions/surveys/components/PostHogLogo.js +28 -2
  43. package/lib/src/extensions/surveys/components/PostHogLogo.js.map +1 -1
  44. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- function t(t,e,r,i,n,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,u,"next",e)}function u(e){t(s,n,o,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function 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 C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function M(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(R,((t,r,i,n,o,s)=>{var a,u=i||o||s,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var o=i(V);if(","===o.slice(-1))o=Y(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=Y(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=I(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:M(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=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(l.type,l.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="+q+"! 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}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"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:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:M=!0}=e;E||(E=Q(t,s,a,void 0===E));var R,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(M||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:R});if(i.add(t,O),R===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(M=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(C(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?st[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ut[n]=s,s.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),jt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jt||{}),Zt=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Zt||{}),$t=(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))($t||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(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&&qt(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 Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ut(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Wt(this.droppedSet,s)||Ut(this.removes,s,this.mirror)?Wt(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=M(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===h?l:[l,h]:s._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=jt.Mouse;break;case"touch":u=jt.Touch;break;case"pen":u=jt.Pen}u===jt.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):jt.Pen}else Tt(i)&&(u=jt.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===jt.Touch||l.startsWith("Mouse")&&u===jt.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var u="#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,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=M(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),o.media||500))),u=[ft("play",a($t.Play),s),ft("pause",a($t.Pause),s),ft("seeked",a($t.Seeked),s),ft("volumechange",a($t.VolumeChange),s),ft("ratechange",a($t.RateChange),s)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var u,[l,h,c]=s;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=se(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:oe(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,s)=>{var a,[l]=s;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(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 ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,o,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));s.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Me(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),u=new Map,l=new Me;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:Zt["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.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});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:Zt["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:Zt["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,Zt.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,Zt.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function je(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;Vt=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=_),Be.reset();var L,D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=wt(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(s),r);else if(P){var a={type:"rrweb",event:Z(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Lt.FullSnapshot)L=s,j=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&s.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Re({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of M||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!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 rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Mt(t,Be)&&z.trackLinkElement(t),Nt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}je.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},je.freezePage=()=>{Kt.forEach((t=>t.freeze()))},je.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},je.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var Ze,$e=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(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),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Ue?Ue[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var o=ur(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lr[n]=s,s.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(s in e){var h=e[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==(Ze=xr.contentWindow)?void 0:Ze.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Mr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Rr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Rr(u.length?u[0]:null):s[a]=u}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:h,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),jr=["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"],Zr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return jr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},$r=["$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 qr(t,e){return-1!==t.indexOf(e)}var Hr=function(t){return t.trim()},Vr=function(t){return t.replace(/^\$/,"")};var zr=Array.isArray,Gr=Object.prototype,Yr=Gr.hasOwnProperty,Ur=Gr.toString,Wr=zr||function(t){return"[object Array]"===Ur.call(t)},Xr=t=>"function"==typeof t,Jr=t=>Xr(t)&&-1!==t.toString().indexOf("[native code]"),Kr=t=>t===Object(t)&&!Wr(t),Qr=t=>{if(Kr(t)){for(var e in t)if(Yr.call(t,e))return!1;return!0}return!1},ti=t=>void 0===t,ei=t=>"[object String]"==Ur.call(t),ri=t=>ei(t)&&0===t.trim().length,ii=t=>null===t,ni=t=>ti(t)||ii(t),oi=t=>"[object Number]"==Ur.call(t)&&t==t,si=t=>oi(t)&&t>0,ai=t=>"[object Boolean]"===Ur.call(t),ui=t=>t instanceof FormData,li=t=>qr($r,t);function hi(t){return null===t||"object"!=typeof t}function ci(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function di(t){return!ti(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var vi=[!0,"true",1,"1","yes"],fi=t=>qr(vi,t),pi=[!1,"false",0,"0","no"];function gi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),oi(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),gi(n||r,e,r,i))}class mi{constructor(t){this.i={},this.o=t.o,this.h=gi(t.bucketSize,0,100,t.m),this.C=gi(t.refillRate,0,this.h,t.m),this.I=gi(t.refillInterval,0,864e5,t.m)}S(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.I);if(i>0){var n=i*this.C;t.tokens=Math.min(t.tokens+n,this.h),t.lastAccess=t.lastAccess+i*this.I}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.i[i];return n?this.S(n,r):(n={tokens:this.h,lastAccess:r},this.i[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.o)||e.call(this,t)),0===n.tokens)}stop(){this.i={}}}var yi="Mobile",bi="iOS",wi="Android",_i="Tablet",Ci=wi+" "+_i,Ii="iPad",Si="Apple",ki=Si+" Watch",xi="Safari",Ai="BlackBerry",Ti="Samsung",Ei=Ti+"Browser",Mi=Ti+" Internet",Ni="Chrome",Ri=Ni+" OS",Fi=Ni+" "+bi,Oi="Internet Explorer",Pi=Oi+" "+yi,Li="Opera",Di=Li+" Mini",Bi="Edge",ji="Microsoft "+Bi,Zi="Firefox",$i=Zi+" "+bi,qi="Nintendo",Hi="PlayStation",Vi="Xbox",zi=wi+" "+yi,Gi=yi+" "+xi,Yi="Windows",Ui=Yi+" Phone",Wi="Nokia",Xi="Ouya",Ji="Generic",Ki=Ji+" "+yi.toLowerCase(),Qi=Ji+" "+_i.toLowerCase(),tn="Konqueror",en="(\\d+(\\.\\d+)?)",rn=new RegExp("Version/"+en),nn=new RegExp(Vi,"i"),on=new RegExp(Hi+" \\w+","i"),sn=new RegExp(qi+" \\w+","i"),an=new RegExp(Ai+"|PlayBook|BB10","i"),un={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var ln,hn,cn,dn=(t,e)=>e&&qr(e,Si)||function(t){return qr(t,xi)&&!qr(t,Ni)&&!qr(t,wi)}(t),vn=function(t,e){return e=e||"",qr(t," OPR/")&&qr(t,"Mini")?Di:qr(t," OPR/")?Li:an.test(t)?Ai:qr(t,"IE"+yi)||qr(t,"WPDesktop")?Pi:qr(t,Ei)?Mi:qr(t,Bi)||qr(t,"Edg/")?ji:qr(t,"FBIOS")?"Facebook "+yi:qr(t,"UCWEB")||qr(t,"UCBrowser")?"UC Browser":qr(t,"CriOS")?Fi:qr(t,"CrMo")||qr(t,Ni)?Ni:qr(t,wi)&&qr(t,xi)?zi:qr(t,"FxiOS")?$i:qr(t.toLowerCase(),tn.toLowerCase())?tn:dn(t,e)?qr(t,yi)?Gi:xi:qr(t,Zi)?Zi:qr(t,"MSIE")||qr(t,"Trident/")?Oi:qr(t,"Gecko")?Zi:""},fn={[Pi]:[new RegExp("rv:"+en)],[ji]:[new RegExp(Bi+"?\\/"+en)],[Ni]:[new RegExp("("+Ni+"|CrMo)\\/"+en)],[Fi]:[new RegExp("CriOS\\/"+en)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+en)],[xi]:[rn],[Gi]:[rn],[Li]:[new RegExp("(Opera|OPR)\\/"+en)],[Zi]:[new RegExp(Zi+"\\/"+en)],[$i]:[new RegExp("FxiOS\\/"+en)],[tn]:[new RegExp("Konqueror[:/]?"+en,"i")],[Ai]:[new RegExp(Ai+" "+en),rn],[zi]:[new RegExp("android\\s"+en,"i")],[Mi]:[new RegExp(Ei+"\\/"+en)],[Oi]:[new RegExp("(rv:|MSIE )"+en)],Mozilla:[new RegExp("rv:"+en)]},pn=function(t,e){var r=vn(t,e),i=fn[r];if(ti(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},gn=[[new RegExp(Vi+"; "+Vi+" (.*?)[);]","i"),t=>[Vi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(Hi,"i"),[Hi,""]],[an,[Ai,""]],[new RegExp(Yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ui,""];if(new RegExp(yi).test(e)&&!/IEMobile\b/.test(e))return[Yi+" "+yi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=un[i]||"";return/arm/i.test(e)&&(n="RT"),[Yi,n]}return[Yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[bi,e.join(".")]}return[bi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ti(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+wi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[wi,e.join(".")]}return[wi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ri,""]],[/Linux|debian/i,["Linux",""]]],mn=function(t){return sn.test(t)?qi:on.test(t)?Hi:nn.test(t)?Vi:new RegExp(Xi,"i").test(t)?Xi:new RegExp("("+Ui+"|WPDesktop)","i").test(t)?Ui:/iPad/.test(t)?Ii:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ki:an.test(t)?Ai:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wi,"i").test(t)?Wi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(yi).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)?wi:Ci:new RegExp("(pda|"+yi+")","i").test(t)?Ki:new RegExp(_i,"i").test(t)&&!new RegExp(_i+" pc","i").test(t)?Qi:""},yn=function(t){var e=mn(t);return e===Ii||e===Ci||"Kobo"===e||"Kindle Fire"===e||e===Qi?_i:e===qi||e===Vi||e===Hi||e===Xi?"Console":e===ki?"Wearable":e?yi:"Desktop"},bn=t=>t instanceof Error;function wn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return cn&&r.length===hn||(hn=r.length,cn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,ln[i]=[u,l];break}}return r}),{})),cn}}class _n{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:wn(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Cn="?";function In(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?Cn:r,in_app:!0};return ti(i)||(o.lineno=i),ti(n)||(o.colno=n),o}var Sn=(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]:Cn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},kn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,An=/\((\S*)(?::(\d+))(?::(\d+))\)/,Tn=(t,e)=>{var r=kn.exec(t);if(r){var[,i,n,o]=r;return In(e,i,Cn,+n,+o)}var s=xn.exec(t);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=An.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[u,l]=Sn(s[1]||Cn,s[2]);return In(e,l,u,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},En=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Nn=(t,e)=>{var r=En.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||Cn;return[o,n]=Sn(o,n),In(e,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Rn=/\(error: (.*)\)/,Fn=50;function On(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var o=[],s=e.split("\n"),a=n;a<s.length;a++){var u=s[a];if(!(u.length>1024)){var l=Rn.test(u)?u.replace(Rn,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){o.push(c);break}}if(o.length>=Fn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Fn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Cn});var i}))}(o)}}("web:javascript",Tn,Nn)}class Pn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ei(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return ci(t,"DOMException")}isDOMError(t){return ci(t,"DOMError")}}class Ln{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Dn{constructor(){}match(t){return ci(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class jn{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(Bn);return i&&(e=i[1],r=i[2]),[e,r]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return di(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return ei(t)&&!ri(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(bn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return di(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$n(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vn{match(t){return hi(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 zn{match(t){return ci(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return hi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(hi(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Gn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Gn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Un=Array.prototype,Wn=Un.forEach,Xn=Un.indexOf,Jn=null==Yn?void 0:Yn.navigator,Kn=null==Yn?void 0:Yn.document,Qn=null==Yn?void 0:Yn.location,to=null==Yn?void 0:Yn.fetch,eo=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ro=null==Yn?void 0:Yn.AbortController,io=null==Jn?void 0:Jn.userAgent,no=null!=Gn?Gn:{},oo=()=>!!Gn.Zone,so=t=>t instanceof Document,ao={DEBUG:!1,LIB_VERSION:"1.331.2"},uo=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k:function(e){if(Gn&&(ao.DEBUG||no.POSTHOG_DEBUG||r)&&!ti(Gn.console)&&Gn.console){for(var i=("__rrweb_original__"in Gn.console[e]?Gn.console[e].__rrweb_original__:Gn.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(t,...o)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>uo(t+" "+e,r)};return i},lo=uo("[PostHog.js]"),ho=lo.createLogger,co={};function vo(t,e,r){if(Wr(t))if(Wn&&t.forEach===Wn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===co)return}function fo(t,e,r){if(!ni(t)){if(Wr(t))return vo(t,e,r);if(ui(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===co)return}else for(var n in t)if(Yr.call(t,n)&&e.call(r,t[n],n)===co)return}}var po=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return vo(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},go=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return vo(r,(function(e){vo(e,(function(e){t.push(e)}))})),t};function mo(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 yo=function(t){try{return t()}catch(t){return}},bo=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){lo.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),lo.critical(t)}}},wo=function(t){var e={};return fo(t,(function(t,r){(ei(t)&&t.length>0||oi(t))&&(e[r]=t)})),e};function _o(t,e){return r=t,i=t=>ei(t)&&!ii(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Wr(e)?(o=[],vo(e,(e=>{o.push(t(e))}))):(o={},fo(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var Co=["herokuapp.com","vercel.app","netlify.app"];function Io(t){var e=null==t?void 0:t.hostname;if(!ei(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Co)if(r===i)return!1;return!0}function So(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function ko(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var xo=t=>{var e=null==Kn?void 0:Kn.createElement("a");return ti(e)?null:(e.href=t,e)},Ao=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return fo(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},To=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Wr(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){lo.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Eo=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Wr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=o&&(v+="#"+o),v},Mo=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function No(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Ro(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Fo="$people_distinct_id",Oo="__alias",Po="__timers",Lo="$autocapture_disabled_server_side",Do="$heatmaps_enabled_server_side",Bo="$exception_capture_enabled_server_side",jo="$error_tracking_suppression_rules",Zo="$error_tracking_capture_extension_exceptions",$o="$web_vitals_enabled_server_side",qo="$dead_clicks_enabled_server_side",Ho="$product_tours_enabled_server_side",Vo="$web_vitals_allowed_metrics",zo="$session_recording_remote_config",Go="$sesid",Yo="$session_is_sampled",Uo="$enabled_feature_flags",Wo="$early_access_features",Xo="$feature_flag_details",Jo="$stored_person_properties",Ko="$stored_group_properties",Qo="$surveys",ts="$flag_call_reported",es="$user_state",rs="$client_session_props",is="$capture_rate_limit",ns="$initial_campaign_params",os="$initial_referrer_info",ss="$initial_person_info",as="$epp",us="__POSTHOG_TOOLBAR__",ls="$posthog_cookieless",hs=[Fo,Oo,"__cmpns",Po,"$session_recording_enabled_server_side",Do,Go,Uo,jo,es,Wo,Xo,Ko,Jo,Qo,ts,rs,is,ns,os,as,ss,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function cs(t){return t instanceof Element&&(t.id===us||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ds(t){return!!t&&1===t.nodeType}function vs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function fs(t){return!!t&&3===t.nodeType}function ps(t){return!!t&&11===t.nodeType}function gs(t){return t?Hr(t).split(/\s+/):[]}function ms(t){var e=null==Gn?void 0:Gn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ys(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 gs(e)}function bs(t){return ni(t)?null:Hr(t).split(/(\s+)/).filter((t=>Zs(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ws(t){var e="";return Rs(t)&&!Fs(t)&&t.childNodes&&t.childNodes.length&&fo(t.childNodes,(function(t){var r;fs(t)&&t.textContent&&(e+=null!==(r=bs(t.textContent))&&void 0!==r?r:"")})),Hr(e)}function _s(t){return ti(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Cs=["a","button","form","input","select","textarea","label"];function Is(t,e){if(ti(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Ss(t){var e=t.parentNode;return!(!e||!ds(e))&&e}var ks=["next","previous","prev",">","<"],xs=10;var As=[".ph-no-rageclick",".ph-no-capture"];function Ts(t,e){if(!Gn||Es(t))return!1;var r,i,n;ai(e)?(r=!!e&&As,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:As,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Ms(t,!1);return!function(t,e){if(!1===t||ti(t))return!1;var r;if(!0===t)r=ks;else{if(!Wr(t))return!1;if(t.length>xs)return lo.error("[PostHog] content_ignorelist array cannot exceed "+xs+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,o.map((t=>{var e;return{safeText:ws(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Is(o,r)}var Es=t=>!t||vs(t,"html")||!ds(t),Ms=(t,e)=>{if(!Gn||Es(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!vs(n,"body");)if(ps(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=Ss(n);if(!o)break;if(e||Cs.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Gn.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Ns(t,e,r,i,n){var o,s,a,u;if(void 0===r&&(r=void 0),!Gn||Es(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!ms(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&ms(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Ms(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ti(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!Is(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Gn.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&&(Cs.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Rs(t){for(var e=t;e.parentNode&&!vs(e,"body");e=e.parentNode){var r=ys(e);if(qr(r,"ph-sensitive")||qr(r,"ph-no-capture"))return!1}if(qr(ys(t),"ph-include"))return!0;var i=t.type||"";if(ei(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ei(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fs(t){return!!(vs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vs(t,"select")||vs(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Os="(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})",Ps=new RegExp("^(?:"+Os+")$"),Ls=new RegExp(Os),Ds="\\d{3}-?\\d{2}-?\\d{4}",Bs=new RegExp("^("+Ds+")$"),js=new RegExp("("+Ds+")");function Zs(t,e){if(void 0===e&&(e=!0),ni(t))return!1;if(ei(t)){if(t=Hr(t),(e?Ps:Ls).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Bs:js).test(t))return!1}return!0}function $s(t){var e=ws(t);return Zs(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&fo(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ws(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){lo.error("[AutoCapture]",t)}})),e}function Hs(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return mo(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Vs(e.toString())]=Vs(r.toString())})),n+=":",n+=mo(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:zs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return mo(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Vs(t){return t.replace(/"|\\"/g,'\\"')}function zs(t){var e=t.attr__class;return e?Wr(e)?e:gs(e):void 0}var Gs={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"]},Ys=ho("[Recorder]"),Us=t=>"navigation"===t.entryType,Ws=t=>"resource"===t.entryType;function Xs(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Us(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ia({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=>Us(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Js(t,e){return!!e&&(ai(e)||e[t])}function Ks(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(ai(r))return!0;if(Wr(r))return o(r);var s=r[e];return ai(s)?s:o(s)}function Qs(t,e,r,i,n,o){return ta.apply(this,arguments)}function ta(){return ta=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return Ys.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ws(t)&&t.initiatorType===e&&(ti(i)||t.startTime>=i)&&(ti(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Qs(t,e,r,i,n,o+1))})),ta.apply(this,arguments)}function ea(t){var{body:e,options:r,url:i}=t;if(ni(e))return null;var{hostname:n,isHostDenied:o}=Ro(i,r);if(o)return n+" is in deny list";if(ei(e))return e;if(so(e))return e.textContent;if(ui(e))return Ao(e);if(Kr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ra=t=>!ii(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ia(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ti(a)?void 0:Math.round(a),endTime:ti(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ra(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 na=["video/","audio/"];function oa(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function sa(){return sa=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=Ro(i,r);return o?Promise.resolve(n+" is in deny list"):oa(e)})),sa.apply(this,arguments)}function aa(){return aa=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=na.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=Ro(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return ii(n)?oa(e):Promise.resolve(n)})),aa.apply(this,arguments)}function ua(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Js("request",i.recordHeaders),o=Js("response",i.recordHeaders),s=No(r,"fetch",(s=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Ks({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return sa.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield s(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Ks({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return aa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Qs(r,"fetch",c.url,l,h).then((e=>{var r,i=ia({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var la=null;function ha(t,e,i){if(!("performance"in e))return()=>{};if(la)return Ys.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Gs,i):Gs,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Xs(o,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Js("request",r.recordHeaders),n=Js("response",r.recordHeaders),o=No(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,h){void 0===u&&(u=!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=>(Ks({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ea({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),Ks({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ea({body:v.response,options:r,url:a})),Qs(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ia({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),u,l,h)}));return()=>{o()}}(o,e,n),u=ua(o,e,n)),la=()=>{s(),a(),u(),la=null}}var ca=t=>({name:"rrweb/network@1",observer:ha,options:t});no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ca},no.__PosthogExtensions__.rrweb={record:je,version:"v2"},no.rrweb={record:je,version:"v2"},no.rrwebConsoleRecord={getRecordConsolePlugin:Br},no.getRecordNetworkPlugin=ca;var da,va,fa,pa,ga,ma,ya,ba,wa,_a,Ca,Ia,Sa={},ka=[],xa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Aa=Array.isArray;function Ta(t,e){for(var r in e)t[r]=e[r];return t}function Ea(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ma(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?da.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Na(t,s,i,n,null)}function Na(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++fa:n,__i:-1,__u:0};return null==n&&null!=va.vnode&&va.vnode(o),o}function Ra(t){return t.children}function Fa(t,e){this.props=t,this.context=e}function Oa(t,e){if(null==e)return t.__?Oa(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Oa(t):null}function Pa(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Pa(t)}}function La(t){(!t.__d&&(t.__d=!0)&&pa.push(t)&&!$.__r++||ga!=va.debounceRendering)&&((ga=va.debounceRendering)||ma)($)}function $(){for(var t,e,r,i,n,o,s,a=1;pa.length;)pa.length>a&&pa.sort(ya),t=pa.shift(),a=pa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,o=[],s=[],e.__P&&((r=Ta({},i)).__v=i.__v+1,va.vnode&&va.vnode(r),Ha(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,o,null==n?Oa(i):n,!!(32&i.__u),s),r.__v=i.__v,r.__.__k[r.__i]=r,za(o,r,s),i.__e=i.__=null,r.__e!=n&&Pa(r)));$.__r=0}function Da(t,e,r,i,n,o,s,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||ka,b=e.length;for(u=function(t,e,r,i,n){var o,s,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),o=0;o<n;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=Na(null,s,null,null,null):Aa(s)?s=t.__k[o]=Na(Ra,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Na(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,u=o+d,s.__=t,s.__b=t.__b+1,a=null,-1!=(l=s.__i=ja(s,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,s.__u|=4))):t.__k[o]=null;if(c)for(o=0;o<h;o++)null!=(a=r[o])&&0==(2&a.__u)&&(a.__e==i&&(i=Oa(a)),Ua(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Sa:y[v.__i]||Sa,v.__i=c,g=Ha(t,v,d,n,o,s,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ya(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?u=Ba(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ba(t,e,r,i){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Ba(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Oa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function ja(t,e,r,i){var n,o,s,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,o=r+1;n>=0||o<e.length;)if(null!=(l=e[s=n>=0?n--:o++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function Za(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||xa.test(e)?r:r+"px"}function $a(t,e,r,i,n){var o,s;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||Za(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Za(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(ba,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=wa,t.addEventListener(e,o?Ca:_a,o)):t.removeEventListener(e,o?Ca:_a,o);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 qa(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=wa++;else if(e.t<r.u)return;return r(va.event?va.event(e):e)}}}function Ha(t,e,r,i,n,o,s,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[a=e.__e=r.__e]),(h=va.__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 Fa(m,w),c.constructor=x,c.render=Wa),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=Ta({},c.__s)),Ta(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&&s.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,_=va.__r,C=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++C<25);c.state=c.__s,null!=c.getChildContext&&(i=Ta(Ta({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Ra&&null==h.key&&(S=Ga(h.props.children)),a=Da(t,Aa(S)?S:[S],e,r,i,n,o,s,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=o)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else{for(k=o.length;k--;)Ea(o[k]);Va(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Va(e);va.__e(t,e,r)}else null==o&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,o,s,a,u){var l,h,c,d,v,f,p,g=r.props||Sa,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!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,o[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(va.__m&&va.__m(e,o),a=!1),o=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(o=o&&da.call(t.childNodes),!a&&null!=o)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;$a(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||$a(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Da("template"==e.type?t.content:t,Aa(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:r.__k&&Oa(r,0),a,u),null!=o)for(l=o.length;l--;)Ea(o[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&$a(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&$a(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,o,s,u,l);return(h=va.diffed)&&h(e),128&e.__u?void 0:a}function Va(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Va)}function za(t,e,r){for(var i=0;i<r.length;i++)Ya(r[i],r[++i],r[++i]);va.__c&&va.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){va.__e(t,e.__v)}}))}function Ga(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Aa(t)?t.map(Ga):Ta({},t)}function Ya(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){va.__e(t,r)}}function Ua(t,e,r){var i,n;if(va.unmount&&va.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ya(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){va.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ua(i[n],e,r||"function"!=typeof t.type);r||Ea(t.__e),t.__c=t.__=t.__e=void 0}function Wa(t,e,r){return this.constructor(t,r)}function Xa(t,e,r){var i,n,o;e==document&&(e=document.documentElement),va.__&&va.__(t,e),i=!1?null:e.__k,n=[],o=[],Ha(e,t=e.__k=Ma(Ra,null,[t]),i||Sa,Sa,e.namespaceURI,i?null:e.firstChild?da.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),za(n,t,o)}function Ja(t,e,r){var i,n,o,s,a=Ta({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?da.call(arguments,2):r),Na(t.type,a,i||t.key,n||t.ref,null)}da=ka.slice,va={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},fa=0,Fa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ta({},this.state),"function"==typeof t&&(t=t(Ta({},r),this.props)),t&&Ta(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),La(this))},Fa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),La(this))},Fa.prototype.render=Ra,pa=[],ma="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ya=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,ba=/(PointerCapture)$|Capture$/i,wa=0,_a=qa(!1),Ca=qa(!0),Ia=0;var Ka,Qa,tu,eu,ru=0,iu=[],nu=va,ou=nu.__b,su=nu.__r,au=nu.diffed,uu=nu.__c,lu=nu.unmount,hu=nu.__;function cu(t,e){nu.__h&&nu.__h(Qa,t,ru||e),ru=0;var r=Qa.__H||(Qa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function du(t){return ru=1,function(t,e,r){var i=cu(Ka++,2);if(i.t=t,!i.__c&&(i.__=[Iu(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=Qa,!Qa.__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!o||o.call(this,t,e,r);var s=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]&&(s=!0)}})),o&&o.call(this,t,e,r)||s};Qa.__f=!0;var o=Qa.shouldComponentUpdate,s=Qa.componentWillUpdate;Qa.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Qa.shouldComponentUpdate=n}return i.__N||i.__}(Iu,t)}function vu(t,e){var r=cu(Ka++,3);!nu.__s&&Cu(r.__H,e)&&(r.__=t,r.u=e,Qa.__H.__h.push(r))}function fu(t){return ru=5,pu((function(){return{current:t}}),[])}function pu(t,e){var r=cu(Ka++,7);return Cu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function gu(t){var e=Qa.context[t.__c],r=cu(Ka++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Qa)),e.props.value):t.__}function mu(){for(var t;t=iu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(wu),t.__H.__h.forEach(_u),t.__H.__h=[]}catch(e){t.__H.__h=[],nu.__e(e,t.__v)}}nu.__b=function(t){Qa=null,ou&&ou(t)},nu.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),hu&&hu(t,e)},nu.__r=function(t){su&&su(t),Ka=0;var e=(Qa=t.__c).__H;e&&(tu===Qa?(e.__h=[],Qa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(wu),e.__h.forEach(_u),e.__h=[],Ka=0)),tu=Qa},nu.diffed=function(t){au&&au(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==iu.push(e)&&eu===nu.requestAnimationFrame||((eu=nu.requestAnimationFrame)||bu)(mu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),tu=Qa=null},nu.__c=function(t,e){e.some((function(t){try{t.__h.forEach(wu),t.__h=t.__h.filter((function(t){return!t.__||_u(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],nu.__e(r,t.__v)}})),uu&&uu(t,e)},nu.unmount=function(t){lu&&lu(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{wu(t)}catch(t){e=t}})),r.__H=void 0,e&&nu.__e(e,r.__v))};var yu="function"==typeof requestAnimationFrame;function bu(t){var e,r=function(){clearTimeout(i),yu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);yu&&(e=requestAnimationFrame(r))}function wu(t){var e=Qa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Qa=e}function _u(t){var e=Qa;t.__c=t.__(),Qa=e}function Cu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Iu(t,e){return"function"==typeof e?e(t):e}var Su=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),ku=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),xu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Au=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Tu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Eu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Mu=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Nu=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Ru=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Fu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Ou=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Pu=ho("[Surveys]");function Lu(t){return!(!t.start_date||t.end_date)}function Du(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Bu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var ju="seenSurvey_",Zu="inProgressSurvey_",$u=(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},qu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Hu=t=>qu(ju,t),Vu=t=>{localStorage.getItem(Hu(t))||localStorage.setItem(Hu(t),"true")},zu=[Tu.Popover,Tu.Widget,Tu.API],Gu={ignoreConditions:!1,ignoreDelay:!1,displayType:Ou.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return oi(t)&&isFinite(t)&&Math.floor(t)===t});var Yu="0123456789abcdef";class Uu{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Uu(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Yu.charAt(this.bytes[e]>>>4)+Yu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Uu(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Wu{constructor(){this.A=0,this.T=0,this.M=new Ku}generate(){var t=this.generateOrAbort();if(ti(t)){this.A=0;var e=this.generateOrAbort();if(ti(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.N();else{if(!(t+1e4>this.A))return;this.T++,this.T>4398046511103&&(this.A++,this.N())}return Uu.fromFieldsV7(this.A,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.M.nextUint32())}N(){this.T=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}}var Xu,Ju=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Gn&&!ti(Gn.crypto)&&crypto.getRandomValues&&(Ju=t=>crypto.getRandomValues(t));class Ku{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(Ju(this.R),this.F=0),this.R[this.F++]}}var Qu=()=>tl().toString(),tl=()=>(Xu||(Xu=new Wu)).generate(),el=["fatal","error","warning","log","info","debug"],rl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),il=Uint8Array,nl=Uint16Array,ol=Uint32Array,sl=new il([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]),al=new il([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]),ul=new il([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ll=function(t,e){for(var r=new nl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new ol(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},hl=ll(sl,2),cl=hl[0],dl=hl[1];cl[28]=258,dl[258]=28;for(var vl=ll(al,0)[1],fl=new nl(32768),pl=0;pl<32768;++pl){var gl=(43690&pl)>>>1|(21845&pl)<<1;gl=(61680&(gl=(52428&gl)>>>2|(13107&gl)<<2))>>>4|(3855&gl)<<4,fl[pl]=((65280&gl)>>>8|(255&gl)<<8)>>>1}var ml=function(t,e,r){for(var i=t.length,n=0,o=new nl(e);n<i;++n)++o[t[n]-1];var s,a=new nl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new nl(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[fl[c]>>>u]=l}else for(s=new nl(i),n=0;n<i;++n)s[n]=fl[a[t[n]-1]++]>>>15-t[n];return s},yl=new il(288);for(pl=0;pl<144;++pl)yl[pl]=8;for(pl=144;pl<256;++pl)yl[pl]=9;for(pl=256;pl<280;++pl)yl[pl]=7;for(pl=280;pl<288;++pl)yl[pl]=8;var bl=new il(32);for(pl=0;pl<32;++pl)bl[pl]=5;var wl=ml(yl,9,0),_l=ml(bl,5,0),Cl=function(t){return(t/8>>0)+(7&t&&1)},Il=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof nl?nl:t instanceof ol?ol:il)(r-e);return i.set(t.subarray(e,r)),i},Sl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},kl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},xl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new il(0),0];if(1==n){var s=new il(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new nl(d+1),f=Al(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new il(v),f]},Al=function(t,e,r){return-1==t.s?Math.max(Al(t.l,e,r+1),Al(t.r,e,r+1)):e[t.s]=r},Tl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},El=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Ml=function(t,e,r){var i=r.length,n=Cl(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},Nl=function(t,e,r,i,n,o,s,a,u,l,h){Sl(e,h++,r),++n[256];for(var c=xl(n,15),d=c[0],v=c[1],f=xl(o,15),p=f[0],g=f[1],m=Tl(d),y=m[0],b=m[1],w=Tl(p),_=w[0],C=w[1],I=new nl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=xl(I,7),x=k[0],A=k[1],T=19;T>4&&!x[ul[T-1]];--T);var E,M,N,R,F=l+5<<3,O=El(n,yl)+El(o,bl)+s,P=El(n,d)+El(o,p)+s+14+3*T+El(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Ml(e,h,t.subarray(u,u+l));if(Sl(e,h,1+(P<O)),h+=2,P<O){E=ml(d,v,0),M=d,N=ml(p,g,0),R=p;var L=ml(x,A,0);Sl(e,h,b-257),Sl(e,h+5,C-1),Sl(e,h+10,T-4),h+=14;for(S=0;S<T;++S)Sl(e,h+3*S,x[ul[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];Sl(e,h,L[Z]),h+=x[Z],Z>15&&(Sl(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=wl,M=yl,N=_l,R=bl;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;kl(e,h,E[Z+257]),h+=M[Z+257],Z>7&&(Sl(e,h,i[S]>>>23&31),h+=sl[Z]);var q=31&i[S];kl(e,h,N[q]),h+=R[q],q>3&&(kl(e,h,i[S]>>>5&8191),h+=al[q])}else kl(e,h,E[i[S]]),h+=M[i[S]];return kl(e,h,E[256]),h+M[256]},Rl=new ol([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fl=function(){for(var t=new ol(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ol=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new il(i+s+5*(1+Math.floor(s/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?l=Ml(u,l,t.subarray(h,c)):(u[h]=o,l=Ml(u,l,t.subarray(h,s)))}else{for(var d=Rl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new nl(32768),m=new nl(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 ol(25e3),C=new nl(288),I=new nl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=w(h),M=32767&h,N=m[E];if(g[M]=N,m[E]=M,A<=h){var R=s-h;if((S>7e3||x>24576)&&R>423){l=Nl(t,u,0,_,C,I,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==w(h-D))for(var B=Math.min(v,R)-1,j=Math.min(32767,h),Z=Math.min(258,R);D<=j&&--L&&M!=N;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,N=z)}}}D+=(M=N)-(N=g[M])+32768&32767}if(P){_[x++]=268435456|dl[O]<<18|vl[P];var Y=31&dl[O],U=31&vl[P];k+=sl[Y]+al[U],++C[257+Y],++I[U],A=h+O,++S}else _[x++]=t[h],++C[t[h]]}}l=Nl(t,u,o,_,C,I,k,x,T,h-T,l)}return Il(a,0,i+Cl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Pl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ll(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Fl[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Ol(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Pl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Pl(n,o-8,r.d()),Pl(n,o-4,i),n}var Dl=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ii(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Bl=!!eo||!!to,jl="text/plain",Zl=function(t,e,i){var n;void 0===i&&(i=!0);var[o,s]=t.split("?"),a=r({},e),u=null!==(n=null==s?void 0:s.split("&").map((t=>{var e,[r,n]=t.split("="),o=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],l=Ao(a);return l&&u.push(l),o+"?"+u.join("&")},$l=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),ql=t=>{var{data:e,compression:r}=t;if(e){if(r===rl.GZipJS){var i=Ll(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new il(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new il(n+8+(r-s<<1));a.set(i),i=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Il(i,0,n)}($l(e)),{mtime:0}),n=new Blob([i],{type:jl});return{contentType:jl,body:n,estimatedSize:n.size}}if(r===rl.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=Dl(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[u++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}($l(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:$l(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=$l(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hl=[];to&&Hl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=ql(t))&&void 0!==e?e:{},a=new Headers;fo(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(ro){var h=new ro;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}to(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){lo.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{lo.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),eo&&Hl.push({transport:"XHR",method:t=>{var e,r=new eo;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=ql(t))&&void 0!==e?e:{};fo(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&&Hl.push({transport:"sendBeacon",method:t=>{var e=Zl(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=ql(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Jn.sendBeacon(e,o)}catch(t){}}});var Vl=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 zl(t,e,r){return $l({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Gl={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=>Vl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Vl(e,t))))),icontains:(t,e)=>e.map(Yl).some((e=>t.map(Yl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Yl).every((e=>t.map(Yl).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)))}))},Yl=t=>t.toLowerCase();function Ul(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ti(n)||ii(n))return!1;var o=[String(n)],s=Gl[i.operator];return!!s&&s(i.values,o)}))}var Wl=ho("[Stylesheet Loader]"),Xl=Gn,Jl=Kn;function Kl(t){return"$survey_response_"+t}var Ql="#020617",th={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:xu.Right,widgetType:ku.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ql,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function eh(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 rh(t){var e;void 0===t&&(t=th.backgroundColor),"#"===t[0]&&(e=eh(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=eh(r)),!e)return Ql;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Ql:"white"}return Ql}function ih(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Wl.error("prepare_external_dependency_stylesheet returned null"),null)})(Jl,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.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)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var nh=(t,e,i)=>{var n=kh(t),o=Jl.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Jl.createElement("div");((t,e,i)=>{var n=r({},th,i),o=t.style,s=![xu.Center,xu.Left,xu.Right].includes(n.position)||e===Tu.Widget&&(null==i?void 0:i.widgetType)===ku.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||rh(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",rh(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||rh(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",rh(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||rh(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),u=ih(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return Jl.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},oh=(t,e)=>{if(!e)return null;var r=t[Kl(e)];return Wr(r)?[...r]:r},sh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s,properties:a}=t;o?(Vu(i),o.capture(Ru.SENT,r({[Fu.SURVEY_NAME]:i.name,[Fu.SURVEY_ID]:i.id,[Fu.SURVEY_ITERATION]:i.current_iteration,[Fu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Fu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:oh(e,t.id)}))),[Fu.SURVEY_SUBMISSION_ID]:n,[Fu.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,a,{$set:{[$u(i,"responded")]:!0}})),s&&(Xl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Sh(i))):Pu.error("[survey sent] event not captured, PostHog instance not found.")},ah=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!ni(t))).length>0,uh=(t,e,i)=>r({[Fu.SURVEY_NAME]:t.name,[Fu.SURVEY_ID]:t.id,[Fu.SURVEY_ITERATION]:t.current_iteration,[Fu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Fu.SURVEY_PARTIALLY_COMPLETED]:ah(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Fu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Fu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:oh((null==e?void 0:e.responses)||{},t.id)})))}),lh=(t,e,i)=>{if(e){if(!i){var n=Ch(t);e.capture(Ru.DISMISSED,r({},uh(t,n,e),{$set:{[$u(t,"dismissed")]:!0}})),Sh(t),Vu(t),Xl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Pu.error("[survey dismissed] event not captured, PostHog instance not found.")},hh=(t,e)=>{if(e){var r=(t=>qu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Ch(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Ru.ABANDONED,uh(t,i,e),{transport:"sendBeacon"})}}else Pu.error("[survey abandoned] event not captured, PostHog instance not found.")},ch=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),dh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,vh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?dh(t.questions,ch(t.questions)):t.questions,fh=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===Nu.Always||Ih(t)},ph=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,La(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"+Ia++,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}),gh=()=>gu(ph),mh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return Ja(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function yh(t){return null!=t?t:"icontains"}function bh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Xl||null==(r=Xl.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=yh(null==(i=t.conditions)?void 0:i.urlMatchType);return Gl[s](o,[n])}var wh=t=>{var e=""+Zu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Zu+t.id+"_"+t.current_iteration),e},_h=(t,e)=>{try{localStorage.setItem(wh(t),JSON.stringify(e))}catch(t){Pu.error("Error setting in-progress survey state in localStorage",t)}},Ch=t=>{try{var e=localStorage.getItem(wh(t));if(e)return JSON.parse(e)}catch(t){Pu.error("Error getting in-progress survey state from localStorage",t)}return null},Ih=t=>{var e=Ch(t);return!ni(null==e?void 0:e.surveySubmissionId)},Sh=t=>{try{localStorage.removeItem(wh(t))}catch(t){Pu.error("Error clearing in-progress survey state from localStorage",t)}};function kh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function xh(t,e,r){if(void 0===e&&(e=xu.Right),t===Tu.ExternalSurvey)return{};switch(e){case xu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case xu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case xu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case xu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case xu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case xu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case xu.Left:return{left:"30px"};case xu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case xu.Right:return{right:t===Tu.Widget&&r===ku.Tab?"60px":"30px"}}}var Ah=0;function Th(t,e,r,i,n,o){e||(e={});var s,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?s=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ah,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return va.vnode&&va.vnode(l),l}var Eh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Mh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Nh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Rh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Fh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Oh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Ph=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Lh=Th("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[Th("title",{id:"close-survey-title",children:"Close survey"}),Th("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:"currentColor"})]}),Dh=Th("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Th("g",{"clip-path":"url(#clip0_2415_6911)",children:[Th("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Th("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Th("g",{mask:"url(#mask0_2415_6911)",children:[Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"})]})]}),Th("defs",{children:Th("clipPath",{id:"clip0_2415_6911",children:Th("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Bh(){return Th("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Dh]})}function jh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:u}=gu(ph);return Th("div",{className:"bottom-section",children:[!a&&Th("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Gn||Gn.open(o)),u?null==s||s():n()},children:e}),!i.whiteLabel&&Th(Bh,{})]})}function Zh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Th("div",{class:"question-header",children:[Th(e.type===Eu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&mh({component:Ma("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function $h(t){var{onClick:e}=t,{isPreviewMode:r}=gu(ph);return Th("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Lh})}Th("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Th("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 qh=Gn;function Hh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=gu(ph);return vu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return ko(qh,"keydown",t),()=>{qh.removeEventListener("keydown",t)}}),[s]),Th("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&Th($h,{onClick:()=>s()}),Th("h3",{className:"thank-you-message-header",children:e}),r&&mh({component:Ma("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Th(jh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Vh=t=>Wr(t)&&t.every((t=>ei(t)));function zh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:u}=gh(),l=fu(null),[h,c]=du((()=>ei(a)?a:""));vu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+s;return Th(Ra,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:e,forceDisableHtml:r,htmlFor:d}),Th("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Gh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return Th(Ra,{children:[Th("div",{className:"question-container",children:Th(Zh,{question:e,forceDisableHtml:r})}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Yh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=du((()=>oi(u)?u:Wr(u)&&u.length>0&&oi(parseInt(u[0]))?parseInt(u[0]):ei(u)&&oi(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=gh(),p=t=>f?a(t):s(t);return Th(Ra,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:r,forceDisableHtml:i}),Th("div",{className:"rating-section",children:[Th("div",{className:"rating-options",children:["emoji"===r.display&&Th("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=Qh[r.scale])?void 0:e.map(((t,e)=>Th("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&&Th("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:tc(r.scale).map(((t,e)=>Th(Uh,{displayQuestionIndex:n,active:c===t,appearance:o,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Th("div",{className:"rating-text",children:[Th("div",{children:r.lowerBoundLabel}),Th("div",{children:r.upperBoundLabel})]})]})]}),Th(jh,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:ii(c)&&!r.optional,appearance:o,onSubmit:()=>s(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Uh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Th("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Wh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=fu(null),h=pu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=dh(e,ch(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=du((()=>((t,e)=>ei(t)||Vh(t)?t:e===Eu.SingleChoice?null:[])(u,e.type))),[v,f]=du((()=>((t,e)=>{if(ei(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Vh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=gh(),g=e.type===Eu.SingleChoice,m=e.type===Eu.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=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Wr(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||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!ii(c)||(!(!Wr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Wr(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return Th(Ra,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:e,forceDisableHtml:i}),Th("fieldset",{className:"multiple-choice-options limit-height",children:[Th("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===t:Wr(c)&&c.includes(t);return Th("label",{className:i?"choice-option-open":"",children:[Th("div",{className:"response-choice",children:[Th("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),Th("span",{children:i?t+":":t})]}),i&&Th("input",{type:"text",ref:l,id:s,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)}))]})]}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Xh=[1,2,3,4,5],Jh=[1,2,3,4,5,6,7],Kh=[0,1,2,3,4,5,6,7,8,9,10],Qh={2:[Oh,Ph],3:[Nh,Mh,Eh],5:[Rh,Nh,Mh,Eh,Fh]};function tc(t){switch(t){case 5:default:return Xh;case 7:return Jh;case 10:return Kh}}var ec=ho("[Surveys]");function rc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Mu.End:o;if(n.branching.type===Mu.End)return Mu.End;if(n.branching.type===Mu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Mu.ResponseBased){if(n.type===Eu.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Mu.End?Mu.End:o}}else if(n.type===Eu.Rating){var l;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(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Mu.End?Mu.End:o}}return o}return ec.warn("Falling back to next question index due to unexpected branching type"),o}var ic=Gn,nc=Kn,oc="ph:show_survey_widget",sc="PHWidgetSurveyClickListener",ac=250,uc=20,lc=12;class hc{constructor(t){var e=this;this.O=new Map,this.P=new Map,this.L=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Qo);if(t)for(var e of t)Ih(e)&&hh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i;this.D(t.id),this.B(t);var n=(null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0,{shadow:o}=nh(t,this._posthog);if(n<=0)return Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j,properties:e}),o);var s=setTimeout((()=>{if(this.O.delete(t.id),!bh(t))return this.j(t);Xa(Th(fc,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.j,properties:e}),o)}),1e3*n);this.O.set(t.id,s)},this.Z=t=>{var{shadow:e,isNewlyCreated:r}=nh(t,this._posthog);r&&Xa(Th(gc,{posthog:this._posthog,survey:t},t.id),e)},this.$=t=>{this.q(t);var e=this.P.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(sc),this.P.delete(t.id),Pu.info("Removed click listener for survey "+t.id))},this.H=(t,e)=>{var r=nc.querySelector(e),i=this.P.get(t.id);if(r){if(this.Z(t),i){if(r===i.element)return;Pu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.$(t)}if(!r.hasAttribute(sc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===xu.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=ic.innerHeight,n=ic.innerWidth,o=ac,s=r.left+r.width/2-e/2;s+e>n-uc&&(s=n-e-uc),s<uc&&(s=uc);var a=lc,u=i-r.bottom,l=r.top,h=u<o&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:th.zIndex}}catch(t){return Pu.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||th.maxWidth)):{};ic.dispatchEvent(new CustomEvent(oc,{detail:{surveyId:t.id,position:n}}))};ko(r,"click",n),r.setAttribute(sc,"true"),this.P.set(t.id,{element:r,listener:n,survey:t}),Pu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.$(t)},this.renderPopover=t=>{var{shadow:e}=nh(t,this._posthog);Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.V(t),Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.Y(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===Tu.Popover||t.type===Tu.Widget)),i=e.W(r),n=new Set;i.forEach((t=>{if(t.type===Tu.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===ku.Tab)return void e.Z(t);if((null==(i=t.appearance)?void 0:i.widgetType)===ku.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.H(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ii(e.X)&&t.type===Tu.Popover&&e.handlePopoverSurvey(t)})),e.P.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.$(r)}))}),t)},this.B=t=>{ii(this.X)||Pu.error("Survey "+this.X+" already in focus. Cannot add survey "+t.id+"."),this.X=t.id},this.j=t=>{this.X!==t.id&&Pu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.D(t.id),this.X=null,this.q(t)},this._posthog=t,this.X=null}D(t){var e=this.O.get(t);e&&(clearTimeout(e),this.O.delete(t))}cancelSurvey(t){this.O.has(t)&&(Pu.info("Cancelled pending survey "+t),this.D(t),this.X===t&&(this.X=null))}W(t){return t.sort(((t,e)=>{var r,i,n=Ih(t),o=Ih(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===Nu.Always,a=e.schedule===Nu.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}V(t){if(!this.L.has(t.id))try{var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ti(a)){var u=decodeURIComponent(s),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(ic.location.search);if(0===Object.keys(e).length)return;Pu.info("[Survey Prefill] Detected URL prefill parameters");var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],o=Kl(t.id);try{switch(t.type){case Eu.SingleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=t.choices.length)return void lo.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[s];break;case Eu.MultipleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void lo.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&lo.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=u;break;case Eu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void lo.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=l;break;default:lo.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){lo.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return void Pu.warn("[Survey Prefill] No valid responses after conversion");var i=Qu(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:s}=function(t,e,r){for(var i=0,n={},o=t.questions.length+1;i<t.questions.length&&0<o&&e.includes(i);){var s=t.questions[i];if(!s||!("skipSubmitButton"in s)||!s.skipSubmitButton)break;if(s.id){var a=Kl(s.id);ti(r[a])||(n[a]=r[a])}var u=rc(t,i,s.id?r[Kl(s.id)]:null);if(u===Mu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=o>=t.questions.length;_h(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?t.questions.length-1:o}),Pu.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(s).length>0&&t.enable_partial_responses||a)&&sh({responses:a?r:s,survey:t,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this.L.add(t.id)}catch(t){Pu.error("[Survey Prefill] Error handling URL prefill:",t)}}J(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}G(t){return!t.conditions||bh(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!io)return!1;var n=yn(io);return Gl[yh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Jl||!Jl.querySelector(t.conditions.selector))}(t)}K(t){return fh(t)||this.J(t.internal_targeting_flag_key)||Ih(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Lu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!zu.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.J(t.linked_flag_key,n)?this.J(t.targeting_flag_key)?this.K(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Hu(t))&&!fh(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)}Y(t){var e;if(!Du(t)&&!Bu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.J(r)}))}q(t){try{var e=nc.querySelector(kh(t,!0));null!=e&&e.shadowRoot&&Xa(null,e.shadowRoot),null==e||e.remove()}catch(e){Pu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.B,removeSurveyFromFocus:this.j,surveyInFocus:this.X,surveyTimeouts:this.O,handleWidget:this.Z,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.H,sortSurveysByAppearanceDelay:this.W,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.J.bind(this)}}}function cc(t,e){if(nc&&ic){var r,i=new hc(t);if(t.config.disable_surveys_automatic_display)return Pu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Pu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ti(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),ko(nc,"visibilitychange",(()=>{nc.hidden?ti(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function dc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;vu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===Tu.Widget,o=bh(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===ku.Tab&&n;if(!o)return Pu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(Pu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};ko(ic,"popstate",o),ko(ic,"hashchange",o);var s=ic.history.pushState,a=ic.history.replaceState;return ic.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},ic.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{ic.removeEventListener("popstate",o),ic.removeEventListener("hashchange",o),ic.history.pushState=s,ic.history.replaceState=a}}}),[n,e,r,i])}function vc(t){switch(void 0===t&&(t=Au.Right),t){case Au.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Au.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Au.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Au.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function fc(t){var e,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y}=t,b=fu(null),w=Number.isInteger(d),_=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:C,isSurveySent:I,hidePopupWithViewTransition:S}=function(t,e,r,i,n,o,s){var[a,u]=du(i||0===r||t.type===Tu.ExternalSurvey),[l,h]=du(!1),c=()=>{var e=()=>{o&&n(t),u(!1)};nc.startViewTransition?nc.startViewTransition((()=>{var t;null==s||null==(t=s.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return vu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{bh(t)&&(u(!0),ic.dispatchEvent(new Event("PHSurveyShown")),e.capture(Ru.SHOWN,{[Fu.SURVEY_NAME]:t.name,[Fu.SURVEY_ID]:t.id,[Fu.SURVEY_ITERATION]:t.current_iteration,[Fu.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(ko(ic,"PHSurveyClosed",d),ko(ic,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),ic.removeEventListener("PHSurveyClosed",d),ic.removeEventListener("PHSurveySent",n)}}return o(),()=>{ic.removeEventListener("PHSurveyClosed",d),ic.removeEventListener("PHSurveySent",n)}}}else Pu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:l,setIsPopupVisible:u,hidePopupWithViewTransition:c}}(u,h,_,w,v,f,b),k=I||d===u.questions.length,x=pu((()=>{var t=Ch(u);return{isPreviewMode:w,previewPageIndex:d,onPopupSurveyDismissed:()=>{lh(u,h,w),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Qu(),onPreviewSubmit:p,posthog:h,properties:y}}),[w,d,f,h,u,g,p,y]);return C?Th(ph.Provider,{value:x,children:Th("div",{className:"ph-survey",style:r({},xh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:b,children:k?Th(Hh,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=u.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||th,onClose:()=>{S(),m()}}):Th(pc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function pc(t){var e,{survey:i,forceDisableHtml:n,posthog:o}=t,[s,a]=du((()=>{var t=Ch(i);return null!=t&&t.responses&&Pu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=gu(ph),[p,g]=du((()=>{var t=Ch(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=pu((()=>vh(i)),[i]);vu((()=>{v&&!ti(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Th("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Th($h,{onClick:()=>{l()}}),Th("div",{className:"survey-box",children:mc({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||th,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(o)if(u){var l=Kl(u),h=r({},s,{[l]:e});a(h);var c=rc(i,n,e),v=c===Mu.End;v||(g(c),_h(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&sh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:o,properties:f})}else Pu.error("onNextButtonClick called without a questionId.");else Pu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?s[Kl(y.id)]:void 0})})]}):null}function gc(t){var e,r,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=du(!0),[f,p]=du(!1),[g,m]=du({}),y=()=>{p(!f)};if(vu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.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)===u.id&&(Pu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return ko(ic,oc,e),()=>{ic.removeEventListener(oc,e)}}}else Pu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),dc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Nu.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Th(Ra,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Th("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===Au.Top?"widget-tab-top":""),onClick:y,disabled:c,style:vc(null==(s=u.appearance)?void 0:s.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Th(fc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var mc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Eu.Open:return Ma(zh,r({},l,{question:e,key:e.id}));case Eu.Link:return Ma(Gh,r({},l,{question:e,key:e.id}));case Eu.Rating:return Ma(Yh,r({},l,{question:e,key:e.id}));case Eu.SingleChoice:case Eu.MultipleChoice:return Ma(Wh,r({},l,{question:e,key:e.id}));default:return Pu.error("Unsupported question type: "+e.type),null}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.generateSurveys=cc,no.extendPostHogWithSurveys=cc;class yc{emit(t){}}var bc=new yc;var wc=new class{getLogger(t,e,r){return new yc}};class _c{constructor(t,e,r,i){this.tt=t,this.name=e,this.version=r,this.options=i}emit(t){this.et().emit(t)}et(){if(this.rt)return this.rt;var t=this.tt.it(this.name,this.version,this.options);return t?(this.rt=t,this.rt):bc}}class Cc{getLogger(t,e,r){var i;return null!==(i=this.it(t,e,r))&&void 0!==i?i:new _c(this,t,e,r)}nt(){var t;return null!==(t=this.rt)&&void 0!==t?t:wc}ot(t){this.rt=t}it(t,e,r){var i;return null===(i=this.rt)||void 0===i?void 0:i.getLogger(t,e,r)}}var Ic="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sc=Symbol.for("io.opentelemetry.js.api.logs"),kc=Ic;class xc{constructor(){this.st=new Cc}static getInstance(){return this._instance||(this._instance=new xc),this._instance}setGlobalLoggerProvider(t){return kc[Sc]?this.getLoggerProvider():(kc[Sc]=(e=1,r=t,i=wc,t=>t===e?r:i),this.st.ot(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=kc[Sc])||void 0===t?void 0:t.call(kc,1))&&void 0!==e?e:this.st}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete kc[Sc],this.st=new Cc}}var Ac=xc.getInstance();class Tc{constructor(t){this.rt=void 0,this.rt=t}export(t,e){this.rt.export(t,e)}forceFlush(){return this.rt.forceFlush()}shutdown(){return this.rt.shutdown()}}class Ec 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 Mc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Nc{constructor(t){this.ut=void 0,this.ht=[],this.ut=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.ht.push(t);var e=()=>{var e=this.ht.indexOf(t);this.ht.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.ht.length>=this.ut}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.ht)}))()}}function Rc(t){return new Nc(t.concurrencyLimit)}var Fc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Oc="1.9.0",Pc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Lc=function(t){var e=new Set([t]),r=new Set,i=t.match(Pc);if(!i)return function(){return!1};var n=+i[1],o=+i[2],s=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(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(Pc);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?o===h&&s<=c?u(t):a(t):o<=h?u(t):a(t)}}(Oc),Dc=Oc.split(".")[0],Bc=Symbol.for("opentelemetry.js.api."+Dc),jc=Fc;function Zc(t,e,r,i){var n;void 0===i&&(i=!1);var o=jc[Bc]=null!==(n=jc[Bc])&&void 0!==n?n:{version:Oc};if(!i&&o[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(o.version!==Oc){s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Oc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Oc+"."),!0}function $c(t){var e,r,i=null===(e=jc[Bc])||void 0===e?void 0:e.version;if(i&&Lc(i))return null===(r=jc[Bc])||void 0===r?void 0:r[t]}function qc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Oc+".");var r=jc[Bc];r&&delete r[t]}var Hc,Vc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},zc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Gc=function(){function t(t){this.ct=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("debug",this.ct,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("error",this.ct,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("info",this.ct,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("warn",this.ct,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("verbose",this.ct,t)},t}();function Yc(t,e,r){var i=$c("diag");if(i)return r.unshift(e),i[t].apply(i,zc([],Vc(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"}(Hc||(Hc={}));var Uc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},Wc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Xc=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=$c("diag");if(i)return i[t].apply(i,Wc([],Uc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,o;if(void 0===r&&(r={logLevel:Hc.INFO}),t===e){var s=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=s.stack)&&void 0!==i?i:s.message),!1}"number"==typeof r&&(r={logLevel:r});var a=$c("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Hc.NONE?t=Hc.NONE:t>Hc.ALL&&(t=Hc.ALL),e=e||{},{error:r("error",Hc.ERROR),warn:r("warn",Hc.WARN),info:r("info",Hc.INFO),debug:r("debug",Hc.DEBUG),verbose:r("verbose",Hc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Hc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Zc("diag",u,e,!0)},e.disable=function(){qc("diag",e)},e.createComponentLogger=function(t){return new Gc(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 Jc(t){return Symbol.for(t)}var Kc,Qc=function t(e){var r=this;r.dt=e?new Map(e):new Map,r.getValue=function(t){return r.dt.get(t)},r.setValue=function(e,i){var n=new t(r.dt);return n.dt.set(e,i),n},r.deleteValue=function(e){var i=new t(r.dt);return i.dt.delete(e),i}},td=new Qc,ed=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},rd=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},id=function(){function t(){}return t.prototype.active=function(){return td},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,rd([r],ed(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),nd=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},od=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},sd="context",ad=new id,ud=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Zc(sd,t,Xc.instance())},t.prototype.active=function(){return this.vt().active()},t.prototype.with=function(t,e,r){for(var i,n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return(i=this.vt()).with.apply(i,od([t,e,r],nd(n),!1))},t.prototype.bind=function(t,e){return this.vt().bind(t,e)},t.prototype.vt=function(){return $c(sd)||ad},t.prototype.disable=function(){this.vt().disable(),qc(sd,Xc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Kc||(Kc={}));var ld="0000000000000000",hd="00000000000000000000000000000000",cd={traceId:hd,spanId:ld,traceFlags:Kc.NONE},dd=function(){function t(t){void 0===t&&(t=cd),this.ft=t}return t.prototype.spanContext=function(){return this.ft},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}(),vd=Jc("OpenTelemetry Context Key SPAN");function fd(t){return t.getValue(vd)||void 0}function pd(){return fd(ud.getInstance().active())}function gd(t,e){return t.setValue(vd,e)}function md(t){return t.deleteValue(vd)}function yd(t,e){return gd(t,new dd(e))}function bd(t){var e;return null===(e=fd(t))||void 0===e?void 0:e.spanContext()}var wd=/^([0-9a-f]{32})$/i,_d=/^[0-9a-f]{16}$/i;function Cd(t){return r=t.traceId,wd.test(r)&&r!==hd&&(e=t.spanId,_d.test(e)&&e!==ld);var e,r}function Id(t){return new dd(t)}var Sd=ud.getInstance(),kd=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 dd;var i,n=r&&bd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Cd(n)?new dd(n):new dd},t.prototype.startActiveSpan=function(t,e,r,i){var n,o,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(n=e,s=r):(n=e,o=r,s=i);var a=null!=o?o:Sd.active(),u=this.startSpan(t,n,a),l=gd(a,u);return Sd.with(l,s,void 0,u)}},t}();var xd=new kd,Ad=function(){function t(t,e,r,i){this.tt=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.yt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.yt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.yt=function(){if(this.rt)return this.rt;var t=this.tt.getDelegateTracer(this.name,this.version,this.options);return t?(this.rt=t,this.rt):xd},t}(),Td=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new kd},t}()),Ed=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 Ad(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.rt)&&void 0!==t?t:Td},t.prototype.setDelegate=function(t){this.rt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.rt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Md=ud.getInstance(),Nd=Xc.instance(),Rd="trace",Fd=function(){function t(){this.bt=new Ed,this.wrapSpanContext=Id,this.isSpanContextValid=Cd,this.deleteSpan=md,this.getSpan=fd,this.getActiveSpan=pd,this.getSpanContext=bd,this.setSpan=gd,this.setSpanContext=yd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Zc(Rd,this.bt,Xc.instance());return e&&this.bt.setDelegate(t),e},t.prototype.getTracerProvider=function(){return $c(Rd)||this.bt},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){qc(Rd,Xc.instance()),this.bt=new Ed},t}(),Od=Fd.getInstance(),Pd=Jc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ld(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(Dd(i)){e=i;continue}return!1}return!1}}return!0}(t):Dd(typeof t))}function Dd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var Bd=t=>{Nd.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))};function jd(t){try{Bd(t)}catch(t){}}var Zd,$d=performance,qd="telemetry.sdk.language",Hd="telemetry.sdk.name",Vd="telemetry.sdk.version",zd={[Hd]:"opentelemetry","process.runtime.name":"browser",[qd]:"webjs",[Vd]:"2.2.0"},Gd=Math.pow(10,6),Yd=Math.pow(10,9);function Ud(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Gd)]}function Wd(){var t=$d.timeOrigin;if("number"!=typeof t){var e=$d;t=e.timing&&e.timing.fetchStart}return t}function Xd(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Yd&&(r[1]-=Yd,r[0]+=1);return r}(Ud(Wd()),Ud("number"==typeof t?t:$d.now()))}function Jd(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Wd()?Xd(t):Ud(t);if(t instanceof Date)return Ud(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Zd||(Zd={}));var Kd="[object Object]",Qd="[object Null]",tv="[object Undefined]",ev=Function.prototype.toString,rv=ev.call(Object),iv=Object.getPrototypeOf,nv=Object.prototype,ov=nv.hasOwnProperty,sv=Symbol?Symbol.toStringTag:void 0,av=nv.toString;function uv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?tv:Qd;return sv&&sv in Object(t)?function(t){var e=ov.call(t,sv),r=t[sv],i=!1;try{t[sv]=void 0,i=!0}catch(t){}var n=av.call(t);i&&(e?t[sv]=r:delete t[sv]);return n}(t):function(t){return av.call(t)}(t)}(t)!==Kd)return!1;var e=iv(t);if(null===e)return!0;var r=ov.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ev.call(r)===rv}var lv=20;function hv(t){return vv(t)?t.slice():t}function cv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>lv)){if(r++,gv(t)||gv(e)||fv(e))n=hv(e);else if(vv(t)){if(n=t.slice(),vv(e))for(var o=0,s=e.length;o<s;o++)n.push(hv(e[o]));else if(pv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=hv(e[h])}}else if(pv(t))if(pv(e)){if(!function(t,e){if(!uv(t)||!uv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(gv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(dv(t,f,i)||dv(e,f,i))delete n[f];else{if(pv(g)&&pv(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]=cv(n[f],p,r,i)}}}}else n=e;return n}}function dv(t,e,r){for(var i=r.get(t[e])||[],n=0,o=i.length;n<o;n++){var s=i[n];if(s.key===e&&s.obj===t)return!0}return!1}function vv(t){return Array.isArray(t)}function fv(t){return"function"==typeof t}function pv(t){return!gv(t)&&!vv(t)&&!fv(t)&&"object"==typeof t}function gv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class mv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,mv.prototype)}}function yv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new mv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class bv{constructor(){this.wt=void 0,this._t=void 0,this.Ct=void 0,this.wt=new Promise(((t,e)=>{this._t=t,this.Ct=e}))}get promise(){return this.wt}resolve(t){this._t(t)}reject(t){this.Ct(t)}}class wv{constructor(t,e){this.It=void 0,this.St=void 0,this.kt=!1,this.xt=new bv,this.It=t,this.St=e}get isCalled(){return this.kt}get promise(){return this.xt.promise}call(){if(!this.kt){this.kt=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.It.call(this.St,...e)).then((t=>this.xt.resolve(t)),(t=>this.xt.reject(t)))}catch(t){this.xt.reject(t)}}return this.xt.promise}}var _v={At:function(t,e){return new Promise((r=>{Md.with(function(t){return t.setValue(Pd,!0)}(Md.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function Cv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Nd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Iv{constructor(t,e,r,i,n){this.Tt=void 0,this.Et=void 0,this.Mt=void 0,this.Nt=void 0,this.Rt=void 0,this.Ft=void 0,this.Tt=t,this.Et=e,this.Mt=r,this.Nt=i,this.Rt=n,this.Ft=Nd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Ft.debug("items to be sent",t),this.Nt.hasReachedLimit())e({code:Zd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Et.serializeRequest(t);null!=r?this.Nt.pushPromise(this.Tt.send(r,this.Rt).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Zd.FAILED,error:t.error}):"retryable"===t.status?e({code:Zd.FAILED,error:new Ec("Export failed with retryable status")}):e({code:Zd.FAILED,error:new Ec("Export failed with unknown error")});else{if(null!=t.data)try{this.Mt.handleResponse(this.Et.deserializeResponse(t.data))}catch(e){this.Ft.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Zd.SUCCESS})}}),(t=>e({code:Zd.FAILED,error:t})))):e({code:Zd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Nt.awaitAll()}shutdown(){var t=this;return e((function*(){t.Ft.debug("shutdown started"),yield t.forceFlush(),t.Tt.shutdown()}))()}}function Sv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Rc(t)},n={timeout:t.timeoutMillis},new Iv(i.transport,i.serializer,Cv(),i.promiseHandler,n.timeout);var i,n}function kv(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function xv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=kv(t.charCodeAt(i)),o=kv(t.charCodeAt(i+1));e[r++]=n<<4|o}return e}function Av(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Tv(t){var e,r=Av(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Ev="undefined"!=typeof BigInt?function(t){return Av(t).toString()}:function(t){return t[0]*Yd+t[1]};function Mv(t){return t}function Nv(t){if(void 0!==t)return xv(t)}var Rv={encodeHrTime:Tv,encodeSpanContext:xv,encodeOptionalSpanContext:Nv};function Fv(t,e){return{key:t,value:Ov(e)}}function Ov(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(Ov)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Fv(e,r)}))}}:{}}function Pv(t,e){var r=function(t){var e,r;if(void 0===t)return Rv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Tv:Ev,encodeSpanContext:n?Mv:xv,encodeOptionalSpanContext:n?Mv:Nv}}(e);return{resourceLogs:Lv(t,r)}}function Lv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:o="",schemaUrl:s=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+o+":"+s,l=a.get(u);l||(l=[],a.set(u,l)),l.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=>Fv(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;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Ov(t.body),eventName:t.eventName,attributes:Dv(t.attributes),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}}))}function Dv(t){return Object.keys(t).map((e=>Fv(e,t[e])))}var Bv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class jv{static FromAttributeList(t,e){var r=new jv({},e);return r.Ot=$v(t),r.Pt=t.filter((t=>{var[e,r]=t;return Bv(r)})).length>0,r}constructor(t,e){var r;this.Ot=void 0,this.Pt=!1,this.Lt=void 0,this.Dt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.Ot=Object.entries(i).map((t=>{var[e,r]=t;return Bv(r)&&(this.Pt=!0),[e,r]})),this.Ot=$v(this.Ot),this.Lt=function(t){if("string"==typeof t||void 0===t)return t;return void Nd.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.Pt}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.Ot.length;e++){var[r,i]=t.Ot[e];t.Ot[e]=[r,Bv(i)?yield i:i]}t.Pt=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Nd.error("Accessing resource attributes before async attributes settled"),this.Dt)return this.Dt;var t={};for(var[e,r]of this.Ot){var i;if(Bv(r))Nd.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Pt||(this.Dt=t),t}getRawAttributes(){return this.Ot}get schemaUrl(){return this.Lt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,o=void 0===i||""===i;if(n)return i;if(o)return r;if(r===i)return r;return void Nd.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return jv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Zv(t,e){return jv.FromAttributeList(Object.entries(t),e)}function $v(t){return t.map((t=>{var[e,r]=t;return Bv(r)?[e,r.catch((t=>{Nd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var qv={serializeRequest:t=>{var e=Pv(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Hv{constructor(t){this.Tt=void 0,this.Tt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Tt.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.Tt.send(t,r),o=5,s=1e3;"retryable"===n.status&&o>0;){var a;o--;var u=Math.max(Math.min(s,5e3)+(.4*Math.random()-.2),0);s*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Tt.shutdown()}}function Vv(t){return new Hv(t.transport)}function zv(t){return[429,502,503,504].includes(t)}function Gv(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 r>=0?r:0}}class Yv{constructor(t){this.Bt=void 0,this.Bt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Bt.headers(),n=yield new Promise((n=>{var o=new XMLHttpRequest;o.timeout=r,o.open("POST",i.Bt.url),Object.entries(e).forEach((t=>{var[e,r]=t;o.setRequestHeader(e,r)})),o.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(Nd.debug("XHR success"),n({status:"success"})):o.status&&zv(o.status)?n({status:"retryable",retryInMillis:Gv(o.getResponseHeader("Retry-After"))}):0!==o.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},o.send(t)}));return n}))()}shutdown(){}}class Uv{constructor(t){this.jt=void 0,this.jt=t}send(t){var r=this;return e((function*(){var e=(yield r.jt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.jt.url,new Blob([t],{type:e}))?(Nd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Wv{constructor(t){this.Bt=void 0,this.Bt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var o,s=!!globalThis.location,a=new URL(i.Bt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Bt.headers(),body:t,signal:e.signal,keepalive:s,mode:s?(null==(o=globalThis.location)?void 0:o.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Nd.debug("response success"),{status:"success"}):zv(u.status)?{status:"retryable",retryInMillis:Gv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}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 Xv(t,e){return Sv(t,e,Vv({transport:(r=t,new Yv(r))}));var r}function Jv(t,e){return Sv(t,e,Vv({transport:(r=t,new Wv(r))}));var r}function Kv(t,e){return Sv(t,e,Vv({transport:(r={url:t.url,headers:t.headers},new Uv(r))}));var r}function Qv(t,i,n){return e((function*(){var e=r({},yield n()),o={};return null!=i&&Object.assign(o,yield i()),null!=t&&Object.assign(o,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Nd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(o,e)}))}function tf(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 ef(t,e,i){var n,o;return r({},function(t,e,r){var i,n,o,s,a,u;return{timeoutMillis:Mc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(o=null!==(s=t.concurrencyLimit)&&void 0!==s?s:e.concurrencyLimit)&&void 0!==o?o:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:Qv(t.headers,e.headers,i.headers),url:null!==(n=null!==(o=tf(t.url))&&void 0!==o?o:e.url)&&void 0!==n?n:i.url})}function rf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function nf(t,i,n){return ef({url:t.url,timeoutMillis:t.timeoutMillis,headers:rf(t),concurrencyLimit:t.concurrencyLimit},{},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))}function of(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Jv:Xv:Kv)(nf(t,r,i),e)}class sf extends Tc{constructor(t){void 0===t&&(t={}),super(of(t,qv,"v1/logs",{"Content-Type":"application/json"}))}}class af{set severityText(t){this.Zt()||(this.$t=t)}get severityText(){return this.$t}set severityNumber(t){this.Zt()||(this.qt=t)}get severityNumber(){return this.qt}set body(t){this.Zt()||(this.Ht=t)}get body(){return this.Ht}get eventName(){return this.Vt}set eventName(t){this.Zt()||(this.Vt=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.$t=void 0,this.qt=void 0,this.Ht=void 0,this.Vt=void 0,this.totalAttributesCount=0,this.zt=!1,this.Gt=void 0;var{timestamp:i,observedTimestamp:n,eventName:o,severityNumber:s,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=Jd(null!=i?i:c),this.hrTimeObserved=Jd(null!=n?n:c),h){var d=Od.getSpanContext(h);d&&Cd(d)&&(this.spanContext=d)}this.severityNumber=s,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.Gt=t.logRecordLimits,this.Vt=o,this.setAttributes(l)}setAttribute(t,e){return this.Zt()||null===e?this:0===t.length?(Nd.warn("Invalid attribute key: "+t),this):Ld(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.Gt.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Nd.warn("Dropping extra attributes."),this):(Ld(e)?this.attributes[t]=this.Yt(e):this.attributes[t]=e,this)):(Nd.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}Ut(){this.zt=!0}Yt(t){var e=this.Gt.attributeValueLengthLimit;return e<=0?(Nd.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.Wt(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Wt(t,e):t)):t}Wt(t,e){return t.length<=e?t:t.substring(0,e)}Zt(){return this.zt&&Nd.warn("Can not execute the operation on emitted log record"),this.zt}}class uf{constructor(t,e){this.instrumentationScope=void 0,this.Xt=void 0,this.instrumentationScope=t,this.Xt=e}emit(t){var e=t.context||Md.active(),i=new af(this.Xt,this.instrumentationScope,r({context:e},t));this.Xt.activeProcessor.onEmit(i,e),i.Ut()}}class lf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class hf{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=>yv(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 cf{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 hf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new lf}}class df{constructor(t){var e,r,i;void 0===t&&(t={}),this.Jt=void 0,this.Xt=void 0;var n,o,s,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=cv(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:Zv({"service.name":"unknown_service",[qd]:zd[qd],[Hd]:zd[Hd],[Vd]:zd[Vd]});this.Xt=new cf(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(o=null!==(s=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==s?s:void 0)&&void 0!==o?o:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.Jt=new wv(this.Kt,this)}getLogger(t,e,r){if(this.Jt.isCalled)return Nd.warn("A shutdown LoggerProvider cannot provide a Logger"),bc;t||Nd.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Xt.loggers.has(n)||this.Xt.loggers.set(n,new uf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Xt)),this.Xt.loggers.get(n)}forceFlush(){return this.Jt.isCalled?(Nd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Jt.promise):this.Xt.activeProcessor.forceFlush()}shutdown(){return this.Jt.isCalled?(Nd.warn("shutdown may only be called once per LoggerProvider"),this.Jt.promise):this.Jt.call()}Kt(){return this.Xt.activeProcessor.shutdown()}}class vf{constructor(t,e){var r,i,n,o,s,a,u,l;this.Qt=void 0,this.te=void 0,this.ee=void 0,this.re=void 0,this.ie=void 0,this.ne=!1,this.oe=[],this.se=void 0,this.Jt=void 0,this.Qt=t,this.te=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.ee=null!==(n=null!==(o=null==e?void 0:e.maxQueueSize)&&void 0!==o?o:void 0)&&void 0!==n?n:2048,this.re=null!==(s=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==s?s:5e3,this.ie=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.Jt=new wv(this.Kt,this),this.te>this.ee&&(Nd.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.te=this.ee)}onEmit(t){this.Jt.isCalled||this.ae(t)}forceFlush(){return this.Jt.isCalled?this.Jt.promise:this.ue()}shutdown(){return this.Jt.call()}Kt(){var t=this;return e((function*(){t.onShutdown(),yield t.ue(),yield t.Qt.shutdown()}))()}ae(t){this.oe.length>=this.ee||(this.oe.push(t),this.le())}ue(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.oe.length/this.te),n=0;n<i;n++)r.push(this.he());Promise.all(r).then((()=>{t()})).catch(e)}))}he(){return this.ce(),0===this.oe.length?Promise.resolve():new Promise(((t,e)=>{yv(this.At(this.oe.splice(0,this.te)),this.ie).then((()=>t())).catch(e)}))}le(){if(!this.ne){var t=()=>{this.ne=!0,this.he().then((()=>{this.ne=!1,this.oe.length>0&&(this.ce(),this.le())})).catch((t=>{this.ne=!1,jd(t)}))};if(this.oe.length>=this.te)return t();void 0===this.se&&(this.se=setTimeout((()=>t()),this.re),"number"!=typeof this.se&&this.se.unref())}}ce(){void 0!==this.se&&(clearTimeout(this.se),this.se=void 0)}At(t){var e=()=>_v.At(this.Qt,t).then((t=>{var e;t.code!==Zd.SUCCESS&&jd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(jd),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,jd)}}class ff extends vf{constructor(t,e){super(t,e),this.de=void 0,this.ve=void 0,this.fe(e)}onShutdown(){"undefined"!=typeof document&&(this.de&&document.removeEventListener("visibilitychange",this.de),this.ve&&document.removeEventListener("pagehide",this.ve))}fe(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.de=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.ve=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.de),document.addEventListener("pagehide",this.ve))}}var pf=1e4,gf=function(t,e,r,i,n){for(var o in void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=pf),t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=t[o],a=e?e+"."+o:o;if(Kr(s))gf(s,a,r,i,n);else{if(i-=1,n-=String(s).length,n-=a.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[a]=s}}return r},mf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:no.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Ac.setGlobalLoggerProvider(new df({resource:Zv(e),processors:[new ff(new sf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Ac.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:o}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:o.toString()}}var s=function(n){var o=(t,e)=>e instanceof Error?r({},e,{name:e.name,message:e.message,stack:e.stack}):e,s=no.console[n];no.console[n]=(s=>function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];if(u.length>0){var h=u.map((t=>JSON.stringify(t,o))).join(" ");h.length>pf&&(h=h.slice(0,pf)+"...",i.body_truncated="true"),e.emit({severityText:mf[n],body:h,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":no.location.href},i,Kr(u[0])?gf(u[0]):{})}),s.apply(no.console,u)}})(s)};for(var a of["debug","log","warn","error","info"])s(a)}};var yf=ho("[Error tracking]");function bf(){return new _n([new Pn,new zn,new Dn,new Ln,new Hn,new qn,new jn,new Vn],On())}class wf{constructor(t){var e,r;this.pe=[],this.ge=bf(),this._instance=t,this.pe=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(jo))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.pe=n,this._instance.persistence&&this._instance.persistence.register({[jo]:this.pe,[Zo]:o})}get me(){var t,e=!!this._instance.get_property(Zo),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.ge.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.ye(e)){if(this.be(e))return void yf.info("Skipping exception capture because a suppression rule matched");if(!this.me&&this.we(e))return void yf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._e(e))return void yf.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}be(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ei(r)&&r.length>0&&t.$exception_types.push(r),ei(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.pe.some((t=>{var r=t.values.map((t=>{var r,i=Gl[t.operator],n=Wr(t.value)?t.value:[t.value],o=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}we(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://")))}_e(t){if(t.length>0){var e,r,i,n,o=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],s=o[o.length-1];return null!==(i=null==s||null==(n=s.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ye(t){return!ni(t)&&Wr(t)}}var _f=ho("[ExceptionAutocapture]"),Cf=bf(),If={wrapOnError:t=>{var e=Gn;e||_f.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n[4],a=n[0],u=Cf.buildFromUnknown(s||a,{mechanism:{handled:!1}});return t(u),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=Gn;e||_f.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=Cf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||_f.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=i.find((t=>t instanceof Error)),a=Cf.buildFromUnknown(s||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.errorWrappingFunctions=If,no.posthogErrorWrappingFunctions=If;var Sf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Wr(t)||t.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}e!==ls&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};no.__PosthogExtensions__=no.__PosthogExtensions__||{};var kf={_patchFetch:(t,r,i)=>No(Gn,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return Sf(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>No(Gn.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,u){void 0===s&&(s=!0);var l=new Request(o);return Sf(t,e,r,l),i.call(this,n,l.url,s,a,u)}))};no.__PosthogExtensions__.tracingHeadersPatchFns=kf,no.postHogTracingHeadersPatchFns=kf;var xf,Af,Tf=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ef=function(t){if("loading"===document.readyState)return"loading";var e=Tf();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},Mf=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Nf=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:Mf(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},Rf=-1,Ff=function(){return Rf},Of=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Rf=e.timeStamp,t(e))}),!0)},Pf=function(){var t=Tf();return t&&t.activationStart||0},Lf=function(t,e){var r=Tf(),i="navigate";return Ff()>=0?i="back-forward-cache":r&&(document.prerendering||Pf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Df=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},Bf=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},jf=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Zf=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},$f=function(t){var e=!1;return function(){e||(t(),e=!0)}},qf=-1,Hf=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Vf=function(t){"hidden"===document.visibilityState&&qf>-1&&(qf="visibilitychange"===t.type?t.timeStamp:0,Gf())},zf=function(){addEventListener("visibilitychange",Vf,!0),addEventListener("prerenderingchange",Vf,!0)},Gf=function(){removeEventListener("visibilitychange",Vf,!0),removeEventListener("prerenderingchange",Vf,!0)},Yf=function(){return qf<0&&(qf=Hf(),zf(),Of((function(){setTimeout((function(){qf=Hf(),zf()}),0)}))),{get firstHiddenTime(){return qf}}},Uf=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Wf=[1800,3e3],Xf=function(t,e){e=e||{},Uf((function(){var r,i=Yf(),n=Lf("FCP"),o=Df("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Pf(),0),n.entries.push(t),r(!0)))}))}));o&&(r=Bf(t,n,Wf,e.reportAllChanges),Of((function(i){n=Lf("FCP"),r=Bf(t,n,Wf,e.reportAllChanges),jf((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Jf=[.1,.25],Kf=0,Qf=1/0,tp=0,ep=function(t){t.forEach((function(t){t.interactionId&&(Qf=Math.min(Qf,t.interactionId),tp=Math.max(tp,t.interactionId),Kf=tp?(tp-Qf)/7+1:0)}))},rp=function(){return xf?Kf:performance.interactionCount||0},ip=function(){"interactionCount"in performance||xf||(xf=Df("event",ep,{type:"event",buffered:!0,durationThreshold:0}))},np=[],op=new Map,sp=0,ap=[],up=function(t){if(ap.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=np[np.length-1],r=op.get(t.interactionId);if(r||np.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};op.set(i.id,i),np.push(i)}np.sort((function(t,e){return e.latency-t.latency})),np.length>10&&np.splice(10).forEach((function(t){return op.delete(t.id)}))}}},lp=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=$f(t),"hidden"===document.visibilityState?t():(r=e(t),Zf(t)),r},hp=[200,500],cp=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Uf((function(){var r;ip();var i,n=Lf("INP"),o=function(t){lp((function(){t.forEach(up);var e=function(){var t=Math.min(np.length-1,Math.floor((rp()-sp)/50));return np[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=Df("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=Bf(t,n,hp,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Zf((function(){o(s.takeRecords()),i(!0)})),Of((function(){sp=rp(),np.length=0,op.clear(),n=Lf("INP"),i=Bf(t,n,hp,e.reportAllChanges)})))})))},dp=[],vp=[],fp=0,pp=new WeakMap,gp=new Map,mp=-1,yp=function(t){dp=dp.concat(t),bp()},bp=function(){mp<0&&(mp=lp(wp))},wp=function(){gp.size>10&&gp.forEach((function(t,e){op.has(e)||gp.delete(e)}));var t=np.map((function(t){return pp.get(t.entries[0])})),e=vp.length-50;vp=vp.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<vp.length;i++){var n=vp[i];_p(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=dp.length-1-50;dp=dp.filter((function(t,e){return t.startTime>fp&&e>o||r.has(t)})),mp=-1};ap.push((function(t){t.interactionId&&t.target&&!gp.has(t.interactionId)&&gp.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;fp=Math.max(fp,t.processingEnd);for(var i=vp.length-1;i>=0;i--){var n=vp[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},vp.push(e)),(t.interactionId||"first-input"===t.entryType)&&pp.set(t,e),bp()}));var _p=function(t,e){for(var r,i=[],n=0;r=dp[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},Cp=[2500,4e3],Ip={},Sp={onLCP:function(t,e){!function(t,e){e=e||{},Uf((function(){var r,i=Yf(),n=Lf("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Pf(),0),n.entries=[t],r())}))},s=Df("largest-contentful-paint",o);if(s){r=Bf(t,n,Cp,e.reportAllChanges);var a=$f((function(){Ip[n.id]||(o(s.takeRecords()),s.disconnect(),Ip[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return lp(a)}),{once:!0,capture:!0})})),Zf(a),Of((function(i){n=Lf("LCP"),r=Bf(t,n,Cp,e.reportAllChanges),jf((function(){n.value=performance.now()-i.timeStamp,Ip[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=Tf();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,n.startTime-i);e={element:Nf(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Xf($f((function(){var r,i=Lf("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=Df("layout-shift",s);a&&(r=Bf(t,i,Jf,e.reportAllChanges),Zf((function(){s(a.takeRecords()),r(!0)})),Of((function(){n=0,i=Lf("CLS",0),r=Bf(t,i,Jf,e.reportAllChanges),jf((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:Nf(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:Ef(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Xf((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Ef(Ff())};if(t.entries.length){var r=Tf(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:Ef(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){Af||(Af=Df("long-animation-frame",yp)),cp((function(e){var r=function(t){var e=t.entries[0],r=pp.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=_p(e.startTime,n),a=t.entries.find((function(t){return t.target})),u=a&&a.target||gp.get(e.interactionId),l=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,l),c={interactionTarget:Nf(u),interactionTargetElement:u,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:Ef(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(r)}),e)}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.postHogWebVitalsCallbacks=Sp,no.postHogWebVitalsCallbacks=Sp;class kp{constructor(t){this.disabled=!1===t;var e=Kr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var xp="$copy_autocapture",Ap=ho("[AutoCapture]");function Tp(t,e){return e.length>t?e.slice(0,t)+"...":e}function Ep(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ds(e));return e}function Mp(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};Cs.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=Tp(1024,$s(t)):o.$el_text=Tp(1024,ws(t)));var s=ys(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),fo(t.attributes,(function(r){var n;if((!Fs(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Zs(r.value)&&(n=r.name,!ei(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=gs(s).join(" ")),o["attr__"+r.name]=Tp(1024,s)}}));for(var a=1,u=1,l=t;l=Ep(l);)a++,l.tagName===t.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function Np(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!vs(h,"body");)ps(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(fo(l,(t=>{var e=Rs(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zs(f)&&f),qr(ys(t),"ph-no-capture")&&(p=!0),d.push(Mp(t,o,s,a));var r=function(t){if(!Rs(t))return{};var e={};return fo(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zs(i)&&(e[r]=i)}})),e}(t);po(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$s(t):d[0].$el_text=ws(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=xo(f))?void 0:g.host,b=null==Gn||null==(m=Gn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:po({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Hs(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class Rp{constructor(t){this.Ce=!1,this.Ie=null,this.Se=!1,this.instance=t,this.rageclicks=new kp(t.config.rageclick),this.ke=null}get xe(){var t,e,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Ae(){if(this.isBrowserSupported()){if(Gn&&Kn){var t=t=>{t=t||(null==Gn?void 0:Gn.event);try{this.Te(t)}catch(t){Ap.error("Failed to capture event",t)}};if(ko(Kn,"submit",t,{capture:!0}),ko(Kn,"change",t,{capture:!0}),ko(Kn,"click",t,{capture:!0}),this.xe.capture_copied_text){var e=t=>{t=t||(null==Gn?void 0:Gn.event),this.Te(t,xp)};ko(Kn,"copy",e,{capture:!0}),ko(Kn,"cut",e,{capture:!0})}}}else Ap.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ce&&(this.Ae(),this.Ce=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Se=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Lo]:!!t.autocapture_opt_out}),this.Ie=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.ke=t}getElementSelectors(t){var e,r=[];return null==(e=this.ke)||e.forEach((e=>{var i=null==Kn?void 0:Kn.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[Lo],i=this.Ie;if(ii(i)&&!ai(r)&&!this.instance.Ee())return!1;var n=null!==(e=this.Ie)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Te(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_s(t);if(fs(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())&&Ts(i,this.instance.config.rageclick)&&this.Te(t,"$rageclick");var n=e===xp;if(i&&Ns(i,t,this.xe,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Np(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xe.element_attribute_ignorelist,elementsChainAsString:this.Se});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===xp){var u,l=bs(null==Gn||null==(u=Gn.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;o.$selected_content=l,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Xr(null==Kn?void 0:Kn.querySelectorAll)}}var Fp={};function Op(t){return function(t,e){var r=Fp[t];if(r)return r;var i=e[t];if(Jr(i)&&!oo())return Fp[t]=i.bind(e);var n=e.document;if(n&&Xr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){lo.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Xr(i)?Fp[t]=i.bind(e):i}("MutationObserver",t)}function Pp(t,e){return oi(t)&&t>=e}class Lp{Me(t){var e,r,i,n,o,s=this.Ne((null==t?void 0:t.__onCapture)||this.Re.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(t,e){this.Fe=[],this.Ne=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.Oe=t=>{var e=function(t){var e=_s(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ii(e)||this.Pe(e)||this.Fe.push(e),this.Fe.length&&ti(this.Le)&&(this.Le=no.setTimeout((()=>{this.De()}),1e3))},this.Be=()=>{var t=Date.now();t%50==0&&this.Fe.forEach((e=>{ti(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.je=()=>{this.Ze=Date.now()},this.instance=t,this.xe=this.Me(e),this._onCapture=this.xe.__onCapture}start(t){this.$e(),this.qe(),this.He(),this.Ve(t)}Ve(t){if(!this.ze){var e=Op(no);this.ze=new e((t=>{this.Ge(t)})),this.ze.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.ze)||t.disconnect(),this.ze=void 0,no.removeEventListener("click",this.Oe),no.removeEventListener("scroll",this.Be,{capture:!0}),no.removeEventListener("selectionchange",this.je)}Ge(t){this.Ye=Date.now()}$e(){ko(no,"click",this.Oe)}qe(){ko(no,"scroll",this.Be,{capture:!0})}He(){ko(no,"selectionchange",this.je)}Pe(t){if(!t)return!0;if(!this.xe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(cs(t.node))return!0;var r=this.Fe.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!vs(t.node,"html")&&ds(t.node)&&!Cs.includes(t.node.tagName.toLowerCase()))}De(){if(this.Fe.length){clearTimeout(this.Le),this.Le=void 0;var t=this.Fe;for(var e of(this.Fe=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Ye&&e.timestamp<=this.Ye?this.Ye-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ze&&e.timestamp<=this.Ze?this.Ze-e.timestamp:void 0;var i=Pp(e.scrollDelayMs,this.xe.scroll_threshold_ms),n=Pp(e.selectionChangedDelayMs,this.xe.selection_change_threshold_ms),o=Pp(e.mutationDelayMs,this.xe.mutation_threshold_ms),s=Pp(e.absoluteDelayMs,1.1*this.xe.mutation_threshold_ms),a=oi(e.scrollDelayMs)&&e.scrollDelayMs<this.xe.scroll_threshold_ms,u=oi(e.mutationDelayMs)&&e.mutationDelayMs<this.xe.mutation_threshold_ms,l=oi(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.xe.selection_change_threshold_ms;a||u||l||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Ye,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.xe.mutation_threshold_ms&&this.Fe.push(e))}this.Fe.length&&ti(this.Le)&&(this.Le=no.setTimeout((()=>{this.De()}),1e3))}}Re(t,e){this.instance.capture("$dead_click",r({},e,Np(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lp(t,e);var Dp=ho("[ExternalScriptsLoader]"),Bp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Dp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Kn?void 0:Kn.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Kn)return r("document not found");var i=Kn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Kn.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Kn.body.appendChild(i)};null!=Kn&&Kn.body?a():null==Kn||Kn.addEventListener("DOMContentLoaded",a)};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);Bp(t,o,r)},no.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Bp(t,i,r)};var jp="";var Zp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function $p(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Kn),jp)return jp;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_"+Qu();!jp&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",jp=o)}return jp}(t);if(!r){var i=(t=>{var e=t.match(Zp);return e?e[0]:""})(t);i!==r&&lo.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var qp={Ue:()=>!!Kn,We:function(t){lo.error("cookieStore error: "+t)},Xe:function(t){if(Kn){try{for(var e=t+"=",r=Kn.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Je:function(t){var e;try{e=JSON.parse(qp.Xe(t))||{}}catch(t){}return e},Ke:function(t,e,r,i,n){if(Kn)try{var o="",s="",a=$p(Kn.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),o="; expires="+u.toUTCString()}n&&(s="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&lo.warn("cookieStore warning: large cookie, len="+l.length),Kn.cookie=l,l}catch(t){return}},Qe:function(t,e){if(null!=Kn&&Kn.cookie)try{qp.Ke(t,"",-1,e)}catch(t){return}}},Hp=null,Vp={Ue:function(){if(!ii(Hp))return Hp;var t=!0;if(ti(Gn))t=!1;else try{var e="__mplssupport__";Vp.Ke(e,"xyz"),'"xyz"'!==Vp.Xe(e)&&(t=!1),Vp.Qe(e)}catch(e){t=!1}return t||lo.error("localStorage unsupported; falling back to cookie store"),Hp=t,t},We:function(t){lo.error("localStorage error: "+t)},Xe:function(t){try{return null==Gn?void 0:Gn.localStorage.getItem(t)}catch(t){Vp.We(t)}return null},Je:function(t){try{return JSON.parse(Vp.Xe(t))||{}}catch(t){}return null},Ke:function(t,e){try{null==Gn||Gn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Vp.We(t)}},Qe:function(t){try{null==Gn||Gn.localStorage.removeItem(t)}catch(t){Vp.We(t)}}},zp=["$device_id","distinct_id",Go,Yo,as,ss],Gp={},Yp={Ue:function(){return!0},We:function(t){lo.error("memoryStorage error: "+t)},Xe:function(t){return Gp[t]||null},Je:function(t){return Gp[t]||null},Ke:function(t,e){Gp[t]=e},Qe:function(t){delete Gp[t]}},Up=null,Wp={Ue:function(){if(!ii(Up))return Up;if(Up=!0,ti(Gn))Up=!1;else try{var t="__support__";Wp.Ke(t,"xyz"),'"xyz"'!==Wp.Xe(t)&&(Up=!1),Wp.Qe(t)}catch(t){Up=!1}return Up},We:function(t){lo.error("sessionStorage error: ",t)},Xe:function(t){try{return null==Gn?void 0:Gn.sessionStorage.getItem(t)}catch(t){Wp.We(t)}return null},Je:function(t){try{return JSON.parse(Wp.Xe(t))||null}catch(t){}return null},Ke:function(t,e){try{null==Gn||Gn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Wp.We(t)}},Qe:function(t){try{null==Gn||Gn.sessionStorage.removeItem(t)}catch(t){Wp.We(t)}}},Xp=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Jp{constructor(t){this._instance=t}get xe(){return this._instance.config}get consent(){return this.tr()?Xp.DENIED:this.er}isOptedOut(){return"always"===this.xe.cookieless_mode||(this.consent===Xp.DENIED||this.consent===Xp.PENDING&&(this.xe.opt_out_capturing_by_default||"on_reject"===this.xe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Xp.DENIED}optInOut(t){this.rr.Ke(this.ir,t?1:0,this.xe.cookie_expiration,this.xe.cross_subdomain_cookie,this.xe.secure_cookie)}reset(){this.rr.Qe(this.ir,this.xe.cross_subdomain_cookie)}get ir(){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 er(){var t=this.rr.Xe(this.ir);return fi(t)?Xp.GRANTED:qr(pi,t)?Xp.DENIED:Xp.PENDING}get rr(){if(!this.nr){var t=this.xe.opt_out_capturing_persistence_type;this.nr="localStorage"===t?Vp:qp;var e="localStorage"===t?qp:Vp;e.Xe(this.ir)&&(this.nr.Xe(this.ir)||this.optInOut(fi(e.Xe(this.ir))),e.Qe(this.ir,this.xe.cross_subdomain_cookie))}return this.nr}tr(){return!!this.xe.respect_dnt&&!!So([null==Jn?void 0:Jn.doNotTrack,null==Jn?void 0:Jn.msDoNotTrack,no.doNotTrack],(t=>fi(t)))}}var Kp=ho("[Dead Clicks]"),Qp=()=>!0,tg=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qo)),i=t.instance.config.capture_dead_clicks;return ai(i)?i:!!Kr(i)||r};class eg{get lazyLoadedDeadClicksAutocapture(){return this.sr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qo]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.ar((()=>{this.ur()}))}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Kp.error("failed to load script",e):t()}))}ur(){var t;if(Kn){if(!this.sr&&null!=(t=no.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.sr=no.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.sr.start(Kn),Kp.info("starting...")}}else Kp.error("`document` not found. Cannot start.")}stop(){this.sr&&(this.sr.stop(),this.sr=void 0,Kp.info("stopping..."))}}var rg=ho("[ExceptionAutocapture]");class ig{constructor(t){var e,r,i;this.lr=()=>{var t;if(Gn&&this.isEnabled&&null!=(t=no.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=no.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=no.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=no.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hr&&this.xe.capture_unhandled_errors&&(this.hr=e(this.captureException.bind(this))),!this.cr&&this.xe.capture_unhandled_rejections&&(this.cr=r(this.captureException.bind(this))),!this.dr&&this.xe.capture_console_errors&&(this.dr=i(this.captureException.bind(this)))}catch(t){rg.error("failed to start",t),this.vr()}}},this._instance=t,this.pr=!(null==(e=this._instance.persistence)||!e.props[Bo]),this.gr=new mi({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,m:rg}),this.xe=this.mr(),this.startIfEnabledOrStop()}mr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(t)?e=r({},e,t):(ti(t)?this.pr:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.xe.capture_console_errors||this.xe.capture_unhandled_errors||this.xe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(rg.info("enabled"),this.vr(),this.ar(this.lr)):this.vr()}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return rg.error("failed to load script",e);t()}))}vr(){var t,e,r;null==(t=this.hr)||t.call(this),this.hr=void 0,null==(e=this.cr)||e.call(this),this.cr=void 0,null==(r=this.dr)||r.call(this),this.dr=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.pr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Bo]:this.pr}),this.xe=this.mr(),this.startIfEnabledOrStop()}onConfigChange(){this.xe=this.mr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.gr.consumeRateLimit(i)?rg.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class ng{constructor(t){var e;this._instance=t,this.yr=(null==Gn||null==(e=Gn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(lo.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.br&&this.br(),this.br=void 0,lo.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Gn&&Gn.history){var r=this;null!=(t=Gn.history.pushState)&&t.__posthog_wrapped__||No(Gn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.wr("pushState")})),null!=(e=Gn.history.replaceState)&&e.__posthog_wrapped__||No(Gn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.wr("replaceState")})),this._r()}}wr(t){try{var e,r=null==Gn||null==(e=Gn.location)?void 0:e.pathname;if(!r)return;r!==this.yr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.yr=r}catch(e){lo.error("Error capturing "+t+" pageview",e)}}_r(){if(!this.br){var t=()=>{this.wr("popstate")};ko(Gn,"popstate",t),this.br=()=>{Gn&&Gn.removeEventListener("popstate",t)}}}}var og=ho("[SegmentIntegration]");function sg(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()||Qu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(es,"identified")),e()},n=r.user();"then"in n&&Xr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||og.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()||(og.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(og.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var ag="posthog-js";function ug(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class lg{constructor(t,e,r,i,n,o){this.name=ag,this.setupOnce=function(s){s(ug(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var hg=null!=Gn&&Gn.location?Mo(Gn.location.hash,"__posthog")||Mo(location.hash,"state"):null,cg="_postHogToolbarParams",dg=ho("[Toolbar]"),vg=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(vg||{});class fg{constructor(t){this.instance=t}Cr(t){no.ph_toolbar_state=t}Ir(){var t;return null!==(t=no.ph_toolbar_state)&&void 0!==t?t:vg.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Gn||!Kn)return!1;t=null!=t?t:Gn.location,r=null!=r?r:Gn.history;try{if(!e){try{Gn.localStorage.setItem("test","test"),Gn.localStorage.removeItem("test")}catch(t){return!1}e=null==Gn?void 0:Gn.localStorage}var i,n=hg||Mo(t.hash,"__posthog")||Mo(t.hash,"state"),o=n?yo((()=>JSON.parse(atob(decodeURIComponent(n)))))||yo((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(cg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Sr(t){var e=no.ph_load_toolbar||no.ph_load_editor;!ni(e)&&Xr(e)?e(t,this.instance):dg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Kn||!Kn.getElementById(us));if(!Gn||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(Gn.localStorage.setItem(cg,JSON.stringify(r({},n,{source:void 0}))),this.Ir()===vg.LOADED)this.Sr(n);else if(this.Ir()===vg.UNINITIALIZED){var o;this.Cr(vg.LOADING),null==(o=no.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return dg.error("[Toolbar] Failed to load",t),void this.Cr(vg.UNINITIALIZED);this.Cr(vg.LOADED),this.Sr(n)})),ko(Gn,"turbolinks:load",(()=>{this.Cr(vg.UNINITIALIZED),this.loadToolbar(n)}))}return!0}kr(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var pg=ho("[TracingHeaders]");class gg{constructor(t){this.Ar=void 0,this.Tr=void 0,this.lr=()=>{var t,e;ti(this.Ar)&&(null==(t=no.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ti(this.Tr)&&(null==(e=no.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return pg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.ar(this.lr):(null==(t=this.Ar)||t.call(this),null==(e=this.Tr)||e.call(this),this.Ar=void 0,this.Tr=void 0)}}var mg="https?://(.*)",yg=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],bg=go(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],yg),wg="<masked>",_g=["li_fat_id"];function Cg(t,e,r){if(!Kn)return{};var i,n=e?go([],yg,r||[]):[],o=Ig(Eo(Kn.URL,n,wg),t),s=(i={},fo(_g,(function(t){var e=qp.Xe(t);i[t]=e||null})),i);return po(s,o)}function Ig(t,e){var r=bg.concat(e||[]),i={};return fo(r,(function(e){var r=To(t,e);i[e]=r||null})),i}function Sg(t){var e=function(t){return t?0===t.search(mg+"google.([^/?]*)")?"google":0===t.search(mg+"bing.com")?"bing":0===t.search(mg+"yahoo.com")?"yahoo":0===t.search(mg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ii(e)){i.$search_engine=e;var n=Kn?To(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function kg(){return navigator.language||navigator.userLanguage}function xg(){return(null==Kn?void 0:Kn.referrer)||"$direct"}function Ag(t,e){var r=t?go([],yg,e||[]):[],i=null==Qn?void 0:Qn.href.substring(0,1e3);return{r:xg().substring(0,1e3),u:i?Eo(i,r,wg):void 0}}function Tg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=xo(r))?void 0:e.host};if(i){n.$current_url=i;var o=xo(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=Ig(i);po(n,s)}if(r){var a=Sg(r);po(n,a)}return n}function Eg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Mg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Ng(t,e){if(!io)return{};var r,i=t?go([],yg,e||[]):[],[n,o]=function(t){for(var e=0;e<gn.length;e++){var[r,i]=gn[e],n=r.exec(t),o=n&&(Xr(i)?i(n,t):i);if(o)return o}return["",""]}(io);return po(wo({$os:n,$os_version:o,$browser:vn(io,navigator.vendor),$device:mn(io),$device_type:yn(io),$timezone:Eg(),$timezone_offset:Mg()}),{$current_url:Eo(null==Qn?void 0:Qn.href,i,wg),$host:null==Qn?void 0:Qn.host,$pathname:null==Qn?void 0:Qn.pathname,$raw_user_agent:io.length>1e3?io.substring(0,997)+"...":io,$browser_version:pn(io,navigator.vendor),$browser_language:kg(),$browser_language_prefix:(r=kg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Gn?void 0:Gn.screen.height,$screen_width:null==Gn?void 0:Gn.screen.width,$viewport_height:null==Gn?void 0:Gn.innerHeight,$viewport_width:null==Gn?void 0:Gn.innerWidth,$lib:"web",$lib_version:ao.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Rg=ho("[Web Vitals]"),Fg=9e5;class Og{constructor(t){var e;this.Er=!1,this.Ce=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Mr=()=>{clearTimeout(this.Nr),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ae=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ti(i))Rg.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Rr();if(!ti(n))if(ni(null==t?void 0:t.name)||ni(null==t?void 0:t.value))Rg.error("Invalid metric received",t);else if(this.Fr&&t.value>=this.Fr)Rg.error("Ignoring metric with value >= "+this.Fr,t);else this.R.url!==n&&(this.Mr(),this.Nr=setTimeout(this.Mr,this.flushToCaptureTimeoutMs)),ti(this.R.url)&&(this.R.url=n),this.R.firstMetricTimestamp=ti(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.R.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.Mr()}},this.lr=()=>{var t,e,r,i,n=no.__PosthogExtensions__;ti(n)||ti(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ae.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ae.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ae.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ae.bind(this)),this.Ce=!0):Rg.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Er=!(null==(e=this._instance.persistence)||!e.props[$o]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Kr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return ti(r)?(null==(e=this._instance.persistence)?void 0:e.props[Vo])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Fr(){var t=Kr(this._instance.config.capture_performance)&&oi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Fg;return 0<t&&t<=6e4?Fg:t}get isEnabled(){var t=null==Qn?void 0:Qn.protocol;if("http:"!==t&&"https:"!==t)return Rg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ai(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ai(e)?e:this.Er}startIfEnabled(){this.isEnabled&&!this.Ce&&(Rg.info("enabled, starting..."),this.ar(this.lr))}onRemoteConfig(t){var e=Kr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Kr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$o]:e}),this._instance.persistence.register({[Vo]:r})),this.Er=e,this.startIfEnabled()}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Rg.error("failed to load script",e):t()}))}Rr(){var t=Gn?Gn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?go([],yg,r||[]):[];return Eo(t,i,wg)}Rg.error("Could not determine current URL")}}var Pg=ho("[Heatmaps]");function Lg(t){return Kr(t)&&"clientX"in t&&"clientY"in t&&oi(t.clientX)&&oi(t.clientY)}class Dg{constructor(t){var e;this.Er=!1,this.Ce=!1,this.Or=null,this.instance=t,this.Er=!(null==(e=this.instance.persistence)||!e.props[Do]),this.rageclicks=new kp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Kr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return ti(this.instance.config.capture_heatmaps)?ti(this.instance.config.enable_heatmaps)?this.Er:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ce)return;Pg.info("starting..."),this.Pr(),this.Lr()}else{var t;clearInterval(null!==(t=this.Or)&&void 0!==t?t:void 0),this.Dr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Do]:e}),this.Er=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Br(t){this.Oe(t.originalEvent,"deadclick")}Lr(){this.Or&&clearInterval(this.Or),this.Or=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Kn)?setInterval(this.jr.bind(this),this.flushIntervalMilliseconds):null}Pr(){Gn&&Kn&&(this.Zr=this.jr.bind(this),ko(Gn,"beforeunload",this.Zr),this.$r=t=>this.Oe(t||(null==Gn?void 0:Gn.event)),ko(Kn,"click",this.$r,{capture:!0}),this.qr=t=>this.Hr(t||(null==Gn?void 0:Gn.event)),ko(Kn,"mousemove",this.qr,{capture:!0}),this.Vr=new eg(this.instance,Qp,this.Br.bind(this)),this.Vr.startIfEnabled(),this.zr=this.Lr.bind(this),ko(Kn,"visibilitychange",this.zr),this.Ce=!0)}Dr(){var t;Gn&&Kn&&(this.Zr&&Gn.removeEventListener("beforeunload",this.Zr),this.$r&&Kn.removeEventListener("click",this.$r,{capture:!0}),this.qr&&Kn.removeEventListener("mousemove",this.qr,{capture:!0}),this.zr&&Kn.removeEventListener("visibilitychange",this.zr),clearTimeout(this.Gr),null==(t=this.Vr)||t.stop(),this.Ce=!1)}Yr(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&ds(i)&&!vs(i,"body");){if(i===r)return!1;if(qr(e,null==Gn?void 0:Gn.getComputedStyle(i).position))return!0;i=Ss(i)}return!1}(_s(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}Oe(t,e){var i;if(void 0===e&&(e="click"),!cs(t.target)&&Lg(t)){var n=this.Yr(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Ur(r({},n,{type:"rageclick"})),this.Ur(n)}}Hr(t){!cs(t.target)&&Lg(t)&&(clearTimeout(this.Gr),this.Gr=setTimeout((()=>{this.Ur(this.Yr(t,"mousemove"))}),500))}Ur(t){if(Gn){var e=Gn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?go([],yg,i||[]):[],o=Eo(e,n,wg);this.R=this.R||{},this.R[o]||(this.R[o]=[]),this.R[o].push(t)}}jr(){this.R&&!Qr(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Bg{constructor(t){this.Wr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(lo.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Xr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Jr()}Jr(){var t;this.Kr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Wr)}destroy(){var t;null==(t=this.Kr)||t.call(this),this.Kr=void 0}doPageView(t,e){var r,i=this.Qr(t,e);return this.Xr={pathname:null!==(r=null==Gn?void 0:Gn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.Qr(t,null==(e=this.Xr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Xr)?void 0:t.pageViewId}}Qr(t,e){var r=this.Xr;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ti(o)||ti(s)||ti(a)||ti(u)||ti(l)||ti(h))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=o<=1?1:gi(s/o,0,1,lo),d=o<=1?1:gi(a/o,0,1,lo),v=u<=1?1:gi(l/u,0,1,lo),f=u<=1?1:gi(h/u,0,1,lo);i=po(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$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 jg=ho("[FeatureFlags]"),Zg=ho("[FeatureFlags]",{debugEnabled:!0}),$g="$active_feature_flags",qg="$override_feature_flags",Hg="$feature_flag_payloads",Vg="$override_feature_flag_payloads",zg="$feature_flag_request_id",Gg="$feature_flag_evaluated_at",Yg=t=>{var e={};for(var[r,i]of mo(t||{}))i&&(e[r]=i);return e},Ug=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]})))):jg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Wg=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Xg{constructor(t){this.ti=!1,this.ei=!1,this.ri=!1,this.ii=!1,this.ni=!1,this.oi=!1,this.si=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}ui(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ai||(jg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ai=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}li(){return this.ui().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ci({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Xo),e=this._instance.get_property(qg),i=this._instance.get_property(Vg);if(!i&&!e)return t||{};var n=po({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,u,l=n[s],h=null==e?void 0:e[s],c=ti(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ti(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[s],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[s]=f}return this.ti||(jg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ti=!0),n}getFlagVariants(){var t=this._instance.get_property(Uo),e=this._instance.get_property(qg);if(!e)return t||{};for(var r=po({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ti||(jg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ti=!0),r}getFlagPayloads(){var t=this._instance.get_property(Hg),e=this._instance.get_property(Vg);if(!e)return t||{};for(var r=po({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ti||(jg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ti=!0),r}reloadFeatureFlags(){this.ii||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.ci()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ii=t}ci(t){var e;if(this.di(),!this._instance.Ee())if(this.ri)this.ni=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Jo)||{}),group_properties:this._instance.get_property(Ko)};ii(n)||ti(n)||(o.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.li()&&(o.evaluation_contexts=this.ui());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);s&&(o.timezone=Eg()),this.ri=!0,this._instance._send_request({method:"POST",url:l,data:o,compression:this._instance.config.disable_compression?void 0:rl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i=!0;(200===t.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),i=!1),this.ri=!1,this.oi)||(this.oi=!0,this._instance.vi(null!==(r=t.json)&&void 0!==r?r:{}));if(!o.disable_flags||this.ni)if(this.si=!i,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(Wg.FeatureFlags))jg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var n;if(!o.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},i);this.ni&&(this.ni=!1,this.ci())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(zg)||void 0,o=this._instance.get_property(Gg)||void 0,s=this._instance.get_property(ts)||{};if((e.send_event||!("send_event"in e))&&(!(t in s)||!s[t].includes(i))){var a,u,l,h,c,d,v,f,p;Wr(s[t])?s[t].push(i):s[t]=[i],null==(a=this._instance.persistence)||a.register({[ts]:s});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:o,$feature_flag_bootstrapped_response:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlags)?void 0:u[t])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[t])||null,$used_bootstrap_value:!this.si};ti(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),ti(null==g?void 0:g.original_variant)&&ti(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ti(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return r}jg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.li()&&(i.evaluation_contexts=this.ui()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:rl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ti(r)?void 0:!!r}jg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=Ug(t),a=s.flags,u=s.featureFlags,l=s.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Wr(u)){jg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[$g]:u,[Uo]:d})}else{var f=u,p=l,g=a;t.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),e&&e.register(r({[$g]:Object.keys(Yg(f)),[Uo]:f||{},[Hg]:p||{},[Xo]:g||{}},h?{[zg]:h}:{},c?{[Gg]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.fi(e)}}override(t,e){void 0===e&&(e=!1),jg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return jg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(qg),this._instance.persistence.unregister(Vg),this.fi(),Zg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ti=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(qg),Zg.info("Flag overrides cleared");else if(r.flags){if(Wr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[qg]:i})}else this._instance.persistence.register({[qg]:r.flags});Zg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Vg),Zg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Vg]:r.payloads}),Zg.info("Payload overrides set",{payloads:r.payloads}))),void this.fi()}this.fi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:e,flagVariants:r}=this.pi();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wo)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[$g]:Object.keys(Yg(u)),[Uo]:u}),this.fi()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wo),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wo),null==(i=this._instance.persistence)||i.register({[Wo]:n}),t(n)}}})}pi(){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)),{})}}fi(t){var{flags:e,flagVariants:r}=this.pi();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Jo)||{};this._instance.register({[Jo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Jo)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Ko)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Ko]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Ko)||{};this._instance.register({[Ko]:r({},e,{[t]:{}})})}else this._instance.unregister(Ko)}reset(){this.ei=!1,this.ri=!1,this.ii=!1,this.ni=!1,this.oi=!1,this.si=!1,this.$anon_distinct_id=void 0,this.di(),this.ti=!1}}var Jg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Kg{constructor(t,e){this.xe=t,this.props={},this.gi=!1,this.mi=(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.rr=this.yi(t),this.load(),t.debug&&lo.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.bi}yi(t){-1===Jg.indexOf(t.persistence.toLowerCase())&&(lo.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...zp,...t];return r({},Vp,{Je:function(t){try{var e={};try{e=qp.Je(t)||{}}catch(t){}var r=po(e,JSON.parse(Vp.Xe(t)||"{}"));return Vp.Ke(t,r),r}catch(t){}return null},Ke:function(t,r,i,n,o,s){try{Vp.Ke(t,r,void 0,void 0,s);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&qp.Ke(t,a,i,n,o,s)}catch(t){Vp.We(t)}},Qe:function(t,e){try{null==Gn||Gn.localStorage.removeItem(t),qp.Qe(t,e)}catch(t){Vp.We(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Vp.Ue()?Vp:"localstorage+cookie"===i&&e.Ue()?e:"sessionstorage"===i&&Wp.Ue()?Wp:"memory"===i?Yp:"cookie"===i?qp:e.Ue()?e:qp}properties(){var t={};return fo(this.props,(function(e,r){if(r===Uo&&Kr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ii(o=hs)?a:Xn&&o.indexOf===Xn?-1!=o.indexOf(s):(fo(o,(function(t){if(a||(a=t===s))return co})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.bi){var t=this.rr.Je(this.mi);t&&(this.props=po({},t))}}save(){this.bi||this.rr.Ke(this.mi,this.props,this.wi,this.Ci,this.Ii,this.xe.debug)}remove(){this.rr.Qe(this.mi,!1),this.rr.Qe(this.mi,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Kr(t)){ti(e)&&(e="None"),this.wi=ti(r)?this.Si:r;var i=!1;if(fo(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Kr(t)){this.wi=ti(e)?this.Si:e;var r=!1;if(fo(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.gi){var t=Cg(this.xe.custom_campaign_params,this.xe.mask_personal_data_properties,this.xe.custom_personal_data_properties);Qr(wo(t))||this.register(t),this.gi=!0}}update_search_keyword(){var t;this.register((t=null==Kn?void 0:Kn.referrer)?Sg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:xg(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(t=xo(Kn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ns]||this.props[os]||this.register_once({[ss]:Ag(this.xe.mask_personal_data_properties,this.xe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};fo([os,ns],(e=>{var r=this.props[e];r&&fo(r,(function(e,r){t["$initial_"+Vr(r)]=e}))}));var e,r,i=this.props[ss];if(i){var n=(e=Tg(i),r={},fo(e,(function(t,e){r["$initial_"+Vr(e)]=t})),r);po(t,n)}return t}safe_merge(t){return fo(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Si=this.wi=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.yi(t),n=this.props;this.clear(),this.rr=i,this.props=n,this.save()}}set_disabled(t){this.bi=t,this.bi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ci&&(this.Ci=t,this.remove(),this.save())}set_secure(t){t!==this.Ii&&(this.Ii=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Po]||{};r[t]=e,this.props[Po]=r,this.save()}remove_event_timer(t){var e=(this.props[Po]||{})[t];return ti(e)||(delete this.props[Po][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Qg=ho("[Product Tours]"),tm="ph_product_tours";class em{constructor(t){this.ki=null,this.xi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Ho]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.ki||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Ho))||this.ar((()=>this.Ai()))}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Qg.error("Could not load product tours script",e):t()}))}Ai(){var t;!this.ki&&null!=(t=no.__PosthogExtensions__)&&t.generateProductTours&&(this.ki=no.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wr(this.xi)||e){var r=this._instance.persistence;if(r){var i=r.props[tm];if(Wr(i)&&!e)return this.xi=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 Qg.error(n),void t([],{isLoaded:!1,error:n})}var o=Wr(e.json.product_tours)?e.json.product_tours:[];this.xi=o,r&&r.register({[tm]:o}),t(o,{isLoaded:!0})}})}else t(this.xi,{isLoaded:!0})}getActiveProductTours(t){ni(this.ki)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ki.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ki)||e.showTourById(t)}previewTour(t){this.ki?this.ki.previewTour(t):this.ar((()=>{var e;this.Ai(),null==(e=this.ki)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ki)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ki)||t.nextStep()}previousStep(){var t;null==(t=this.ki)||t.previousStep()}clearCache(){var t;this.xi=null,null==(t=this._instance.persistence)||t.unregister(tm)}resetTour(t){var e;null==(e=this.ki)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ki)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ki)||e.cancelPendingTour(t)}}class rm{constructor(){this.Ti={},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)}}function im(t,e,r){if(ni(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class nm{constructor(t){this.Ei=new rm,this.Mi=(t,e)=>this.Ni(t,e)&&this.Ri(t,e)&&this.Fi(t,e)&&this.Oi(t,e),this.Ni=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Pi=new Set,this.Li=new Set}init(){var t;if(!ti(null==(t=this._instance)?void 0:t.Di)){var e;null==(e=this._instance)||e.Di(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ti(null==(e=this._instance)?void 0:e.Di)&&(t.forEach((t=>{var e,r;null==(e=this.Li)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Pi)||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.Pi.has(t)||this.Pi.has(null==e?void 0:e.event))&&this.Li&&(null==(r=this.Li)?void 0:r.size)>0&&this.Li.forEach((t=>{this.Bi(e,t)&&this.Ei.emit("actionCaptured",t.name)}))}ji(t){this.onAction("actionCaptured",(e=>t(e)))}Bi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Mi(t,r))return!0;return!1}onAction(t,e){return this.Ei.on(t,e)}Ri(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(!im(i,e.url,e.url_matching||"contains"))return!1}return!0}Fi(t,e){return!!this.Zi(t,e)&&(!!this.$i(t,e)&&!!this.qi(t,e))}Zi(t,e){var r;if(null==e||!e.href)return!0;var i=this.Hi(t);if(i.length>0)return i.some((t=>im(t.href,e.href,e.href_matching||"exact")));var n,o=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!o&&im((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}$i(t,e){var r;if(null==e||!e.text)return!0;var i=this.Hi(t);if(i.length>0)return i.some((t=>im(t.text,e.text,e.text_matching||"exact")||im(t.$el_text,e.text,e.text_matching||"exact")));var n,o,s,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!ni(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),o=e.text,s=e.text_matching||"exact",n.some((t=>im(t,o,s))))}qi(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch(t){return!1}return!1}Hi(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Oi(t,e){return null==e||!e.properties||0===e.properties.length||Ul(e.properties.reduce(((t,e)=>{var r=Wr(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 om{constructor(t){this._instance=t,this.Vi=new Map,this.zi=new Map,this.Gi=new Map}Yi(t,e){return!!t&&Ul(t.propertyFilters,null==e?void 0:e.properties)}Ui(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}Wi(t,e,r){var i=(r===Su.Activation?this.Vi:this.zi).get(t),n=[];return this.Xi((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Yi(o,e)}))}register(t){var e;ti(null==(e=this._instance)?void 0:e.Di)||(this.Ji(t),this.Ki(t))}Ki(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Qi){this.Qi=new nm(this._instance),this.Qi.init();this.Qi.ji((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Qi)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.Gi.get(e.name);r&&r.push(t.id),this.Gi.set(e.name,r||[t.id])}})))}))}}Ji(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e.Di(((t,e)=>{this.onEvent(t,e)})),this.Vi=this.Ui(t,Su.Activation),this.zi=this.Ui(t,Su.Cancellation)}}onEvent(t,e){var r,i=this.et(),n=this.tn(),o=this.en(),s=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(o===t&&e&&s.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:s});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=s.indexOf(l);h>=0&&(s.splice(h,1),this.rn(s))}}else{if(this.zi.has(t)){var c=this.Wi(t,e,Su.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=s.indexOf(t.id);e>=0&&s.splice(e,1),this.nn(t.id)})),this.rn(s))}if(this.Vi.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Vi.get(t)});var d=this.Wi(t,e,Su.Activation);this.rn(s.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.Gi.has(t)&&this.rn(i.concat(this.Gi.get(t)||[]))}rn(t){var e,r=this.et(),i=this.tn(),n=[...new Set(t)].filter((t=>!this.sn(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(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Vi}an(){return this.Qi}}class sm extends om{constructor(t){super(t)}tn(){return"$surveys_activated"}en(){return Ru.SHOWN}Xi(t){var e;null==(e=this._instance)||e.getSurveys(t)}nn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}et(){return Pu}sn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class am{constructor(t){this.un=void 0,this._surveyManager=null,this.ln=!1,this.hn=[],this.cn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ni(e))return Pu.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.un=r?e.length>0:e,Pu.info("flags response received, isSurveysEnabled: "+this.un),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(ju)||null!=r&&r.startsWith(Zu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.ln)Pu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Pu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Pu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==no?void 0:no.__PosthogExtensions__;if(t){if(!ti(this.un)||this._instance.config.advanced_enable_surveys){var e=this.un||this._instance.config.advanced_enable_surveys;this.ln=!0;try{var r=t.generateSurveys;if(r)return void this.dn(r,e);var i=t.loadExternalDependency;if(!i)return void this.vn("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.vn("Could not load surveys script",r):this.dn(t.generateSurveys,e)}))}catch(t){throw this.vn("Error initializing surveys",t),t}finally{this.ln=!1}}}else Pu.error("PostHog Extensions not found.")}}dn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new sm(this._instance),Pu.info("Surveys loaded successfully"),this.fn({isLoaded:!0})}vn(t,e){Pu.error(t,e),this.fn({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.hn.push(t),this._surveyManager&&this.fn({isLoaded:!0}),()=>{this.hn=this.hn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Pu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(Qo);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.cn?this.cn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.cn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.cn=null;var n=e.statusCode;if(200!==n||!e.json){var o="Surveys API could not be loaded, status: "+n;Pu.error(o);var s={isLoaded:!1,error:o};return t([],s),void(null==r||r({surveys:[],context:s}))}var a,u=e.json.surveys||[],l=u.filter((t=>Lu(t)&&(Du(t)||Bu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[Qo]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}fn(t){for(var e of this.hn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Pu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Pu.warn("init was not called")}pn(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}gn(t){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.pn(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ni(this._surveyManager))return Pu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.gn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ni(this._surveyManager)?(Pu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.gn(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(ni(this._surveyManager))Pu.warn("init was not called");else{var n="string"==typeof t?this.pn(t):t;if(null!=n&&n.id)if(zu.includes(n.type)){var o=null==Kn?void 0:Kn.querySelector(e);if(o)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Pu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Pu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,o,r),Pu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o,r);Pu.warn("Survey element not found")}else Pu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Pu.warn("Survey not found")}}displaySurvey(t,e){var i;if(ni(this._surveyManager))Pu.warn("init was not called");else{var n=this.pn(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void Pu.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Ou.Inline?this._surveyManager.handlePopoverSurvey(o,e.properties):this.renderSurvey(o,e.selector,e.properties)}else Pu.warn("Survey not found")}}cancelPendingSurvey(t){ni(this._surveyManager)?Pu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var um=ho("[Conversations]");class lm{constructor(t){this.mn=void 0,this._conversationsManager=null,this.yn=!1,this.bn=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;ni(e)||(ai(e)?this.mn=e:(this.mn=e.enabled,this.bn=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.mn=void 0,this.bn=null}loadIfEnabled(){if(!this._conversationsManager&&!this.yn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==no?void 0:no.__PosthogExtensions__;if(t&&!ti(this.mn)&&this.mn)if(this.bn&&this.bn.token){this.yn=!0;try{var e=t.initConversations;if(e)return this.wn(e),void(this.yn=!1);var r=t.loadExternalDependency;if(!r)return void this._n("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this._n("Could not load conversations script",e):this.wn(t.initConversations),this.yn=!1}))}catch(t){this._n("Error initializing conversations",t),this.yn=!1}}else um.error("Conversations enabled but missing token in remote config.")}}wn(t){if(this.bn)try{this._conversationsManager=t(this.bn,this._instance),um.info("Conversations loaded successfully")}catch(t){this._n("Error completing conversations initialization",t)}else um.error("Cannot complete initialization: remote config is null")}_n(t,e){um.error(t,e),this._conversationsManager=null,this.yn=!1}show(){this._conversationsManager?this._conversationsManager.show():um.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.mn&&!ii(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(um.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(um.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(um.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(um.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class hm{constructor(t){var e;this.Cn=!1,this.In=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Cn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!ni(r)&&r&&(this.Cn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Cn&&!this.In){var t=ho("[logs]"),e=null==no?void 0:no.__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.In=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var cm=ho("[RateLimiter]");class dm{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=>{cm.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void cm.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:o}=this,s=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(is))&&void 0!==e?e:{tokens:n,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>n&&(a.tokens=n);var u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(is,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var vm=ho("[RemoteConfig]");class fm{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=no._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Sn(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(vm.error("PostHog Extensions not found. Cannot load remote config."),t())}kn(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 vm.info("Using preloaded remote config",this.remoteConfig),void this.vi(this.remoteConfig);if(this._instance.Ee())return void vm.warn("Remote config is disabled. Falling back to local config.");this.Sn((t=>{if(!t)return vm.info("No config found after loading remote JS config. Falling back to JSON."),void this.kn((t=>{this.vi(t)}));this.vi(t)}))}catch(t){vm.error("Error loading remote config",t)}}vi(t){t?this._instance.config.__preview_remote_config?(this._instance.vi(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):vm.info("__preview_remote_config is disabled. Logging config instead",t):vm.error("Failed to fetch remote config from PostHog.")}}var pm=3e3;class gm{constructor(t,e){this.xn=!0,this.An=[],this.Tn=gi((null==e?void 0:e.flush_interval_ms)||pm,250,5e3,lo.createLogger("flush interval"),pm),this.En=t}enqueue(t){this.An.push(t),this.Mn||this.Nn()}unload(){this.Rn();var t=this.An.length>0?this.Fn():{},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.En(r({},t,{transport:"sendBeacon"}))}))}enable(){this.xn=!1,this.Nn()}Nn(){var t=this;this.xn||(this.Mn=setTimeout((()=>{if(this.Rn(),this.An.length>0){var e=this.Fn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&fo(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.En(r)};for(var i in e)r()}}),this.Tn))}Rn(){clearTimeout(this.Mn),this.Mn=void 0}Fn(){var t={};return fo(this.An,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;ti(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.An=[],t}}var mm=["retriesPerformedSoFar"];class ym{constructor(t){this.On=!1,this.Pn=3e3,this.An=[],this._instance=t,this.An=[],this.Ln=!0,!ti(Gn)&&"onLine"in Gn.navigator&&(this.Ln=Gn.navigator.onLine,this.Dn=()=>{this.Ln=!0,this.jr()},this.Bn=()=>{this.Ln=!1},ko(Gn,"online",this.Dn),ko(Gn,"offline",this.Bn))}get length(){return this.An.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,mm);si(e)&&(n.url=Zl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.jn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}jn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.An.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),lo.warn(n),this.On||(this.On=!0,this.Zn())}Zn(){if(this.$n&&clearTimeout(this.$n),0===this.An.length)return this.On=!1,void(this.$n=void 0);this.$n=setTimeout((()=>{this.Ln&&this.An.length>0&&this.jr(),this.Zn()}),this.Pn)}jr(){var t=Date.now(),e=[],r=this.An.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.An=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.$n&&(clearTimeout(this.$n),this.$n=void 0),this.On=!1,ti(Gn)||(this.Dn&&(Gn.removeEventListener("online",this.Dn),this.Dn=void 0),this.Bn&&(Gn.removeEventListener("offline",this.Bn),this.Bn=void 0)),this.An))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){lo.error(t)}this.An=[]}}class bm{constructor(t){this.qn=()=>{var t,e,r,i;this.Hn||(this.Hn={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),u=(null==n?void 0:n.scrollHeight)||0;this.Hn.lastScrollY=Math.ceil(o),this.Hn.maxScrollY=Math.max(o,null!==(t=this.Hn.maxScrollY)&&void 0!==t?t:0),this.Hn.maxScrollHeight=Math.max(s,null!==(e=this.Hn.maxScrollHeight)&&void 0!==e?e:0),this.Hn.lastContentY=a,this.Hn.maxContentY=Math.max(a,null!==(r=this.Hn.maxContentY)&&void 0!==r?r:0),this.Hn.maxContentHeight=Math.max(u,null!==(i=this.Hn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Hn}resetContext(){var t=this.Hn;return setTimeout(this.qn,0),t}startMeasuringScrollPosition(){ko(Gn,"scroll",this.qn,{capture:!0}),ko(Gn,"scrollend",this.qn,{capture:!0}),ko(Gn,"resize",this.qn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Gn?void 0:Gn.document.documentElement;var t=Wr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Gn?void 0:Gn.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Gn&&(Gn.scrollY||Gn.pageYOffset||Gn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Gn&&(Gn.scrollX||Gn.pageXOffset||Gn.document.documentElement.scrollLeft)||0}}var wm=t=>Ag(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class _m{constructor(t,e,r,i){this.Vn=t=>{var e=this.zn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Gn(this._instance)};this.Yn.register({[rs]:r})}},this._instance=t,this.Un=e,this.Yn=r,this.Gn=i||wm,this.Un.onSessionId(this.Vn)}zn(){return this.Yn.props[rs]}getSetOnceProps(){var t,e=null==(t=this.zn())?void 0:t.props;return e?"r"in e?Tg(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 fo(wo(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Vr(r)]=e})),t}}var Cm=ho("[SessionId]");class Im{on(t,e){return this.Wn.on(t,e)}constructor(t,e,r){var i;if(this.Xn=[],this.Jn=void 0,this.Wn=new rm,this.Kn=(t,e)=>!(!si(t)||!si(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.xe=t.config,this.Yn=t.persistence,this.Qn=void 0,this.eo=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ro=e||Qu,this.io=r||Qu;var n=this.xe.persistence_name||this.xe.token,o=this.xe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gi(o,60,36e3,Cm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.oo="ph_"+n+"_window_id",this.so="ph_"+n+"_primary_window_exists",this.ao()){var s=Wp.Je(this.oo),a=Wp.Je(this.so);s&&!a?this.Qn=s:Wp.Qe(this.oo),Wp.Ke(this.so,!0)}if(null!=(i=this.xe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.xe.bootstrap.sessionID);this.uo(this.xe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){Cm.error("Invalid sessionID in bootstrap",t)}this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ti(this.Xn)&&(this.Xn=[]),this.Xn.push(t),this.eo&&t(this.eo,this.Qn),()=>{this.Xn=this.Xn.filter((e=>e!==t))}}ao(){return"memory"!==this.xe.persistence&&!this.Yn.bi&&Wp.Ue()}ho(t){t!==this.Qn&&(this.Qn=t,this.ao()&&Wp.Ke(this.oo,t))}co(){return this.Qn?this.Qn:this.ao()?Wp.Je(this.oo):null}uo(t,e,r){t===this.eo&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.eo=t,this.Yn.register({[Go]:[e,t,r]}))}do(){var t=this.Yn.props[Go];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.uo(null,null,null)}destroy(){clearTimeout(this.vo),this.vo=void 0,this.Jn&&Gn&&(Gn.removeEventListener("beforeunload",this.Jn,{capture:!1}),this.Jn=void 0),this.Xn=[]}lo(){this.Jn=()=>{this.ao()&&Wp.Qe(this.so)},ko(Gn,"beforeunload",this.Jn,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.xe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.do(),s=this.co(),a=si(o)&&Math.abs(r-o)>864e5,u=!1,l=!n,h=!l&&!t&&this.Kn(r,i);l||h||a?(n=this.ro(),s=this.io(),Cm.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,u=!0):s||(s=this.io(),u=!0);var c=!!si(i)&&t&&!a?i:r,d=!si(o)?(new Date).getTime():o;return this.ho(s),this.uo(n,c,d),t||this.no(),u&&this.Xn.forEach((t=>t(n,s,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}no(){clearTimeout(this.vo),this.vo=setTimeout((()=>{var[t]=this.do();if(this.Kn((new Date).getTime(),t)){var e=this.eo;this.resetSessionId(),this.Wn.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var Sm=["$set_once","$set"],km=ho("[SiteApps]");class xm{constructor(t){this._instance=t,this.fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}po(t,e){if(e){var r=this.globalsForEvent(e);this.fo.push(r),this.fo.length>1e3&&(this.fo=this.fo.slice(10))}}get siteAppLoaders(){var t;return null==(t=no._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Di(this.po.bind(this));this.mo=()=>{t(),this.fo=[],this.mo=void 0}}}globalsForEvent(t){var e,n,o,s,a,u,l;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,Sm),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.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.fo.length&&(km.info("Processing "+this.fo.length+" events for site app with id "+t.id),this.fo.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.mo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,km.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){km.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){km.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}yo(){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)}bo(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){km.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.yo(),void this._instance.on("eventCaptured",(t=>this.bo(t)))):void km.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.mo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;no["__$$ph_site_app_"+t]=n._instance,null==(e=no.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return km.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else km.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Am=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Zr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Zr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Tm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),Em="i.posthog.com";class Mm{constructor(t){this.wo={},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("."+Em,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.wo[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.wo[this.apiHost]=Tm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.wo[this.apiHost]=Tm.EU:this.wo[this.apiHost]=Tm.CUSTOM),this.wo[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===Tm.CUSTOM)return this.apiHost+e;var r=Em+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Nm={icontains:(t,e)=>!!Gn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Gn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Gn&&Vl(e.href,t),not_regex:(t,e)=>!!Gn&&!Vl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Rm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Rm._o("retrieved web experiments from the server"),e.Co=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Co)Rm._o("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Co)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ei(i)&&t.variants[i]&&e.Io(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];Rm.So(o)&&e.Io(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Rm._o("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.Co))return this.Co=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rm._o("applying feature flags",t),t.forEach((t=>{var e;if(this.Co&&null!=(e=this.Co)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Co)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Io(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Rm.getWindowLocation();if(null!=t&&t.search){var e=To(null==t?void 0:t.search,"__experiment_id"),r=To(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Rm._o("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ko(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}ko(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Rm._o("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Io(i[0].name,e,i[0].variants[e].transforms))}static So(t){return!ni(t.conditions)&&(Rm.xo(t)&&Rm.Ao(t))}static xo(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=Rm.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||Nm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Gn?void 0:Gn.location}static Ao(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Cg();if(r.utm_source){var i,n,o,s,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.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 _o(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];lo.info("[WebExperiments] "+t,r)}Io(t,e,r){this._is_bot()?Rm._o("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Rm._o("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)}))}})):Rm._o("Control variants leave the page unmodified.")}_is_bot(){return Jn&&this._instance?Am(Jn,this._instance.config.custom_blocked_useragents):void 0}}var Fm=ho("[PostHog ExternalIntegrations]"),Om={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Pm{constructor(t){this._instance=t}ar(t,e){var r;null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Fm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=no.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.ar(Om[e],(()=>{var r;null==(r=no.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=no.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=no.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var Lm="[SessionRecording]",Dm=ho(Lm);class Bm{get started(){var t;return!(null==(t=this.To)||!t.isStarted)}get status(){return this.To?this.To.status:this.Eo&&!this.Mo?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Eo=!1,this.No=void 0,this._instance=t,!this._instance.sessionManager)throw Dm.error("started without valid sessionManager"),new Error(Lm+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Lm+' cannot be used with cookieless_mode="always"')}get Mo(){var t,e=!(null==(t=this._instance.get_property(zo))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Gn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Mo||null==(e=this.To)||!e.isStarted){var r=!ti(Object.assign)&&!ti(Array.from);this.Mo&&r?(this.Ro(t),Dm.info("starting")):this.stopRecording()}}Ro(t){var e,r,i;this.Mo&&(null!=no&&null!=(e=no.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=no.__PosthogExtensions__)&&r.initSessionRecording?this.Fo(t):null==(i=no.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Oo,(e=>{if(e)return Dm.error("could not load recorder",e);this.Fo(t)})))}stopRecording(){var t,e;null==(t=this.No)||t.call(this),this.No=void 0,null==(e=this.To)||e.stop()}Po(){var t;null==(t=this._instance.persistence)||t.unregister(Yo)}Lo(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.Po();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[zo]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ti(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.No)||e.call(this),this.No=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Lo(t),this.Eo=!0,this.startIfEnabledOrStop()):this.Eo=!0:Dm.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.To)&&r.log?this.To.log(t,e):Dm.warn("log called before recorder was ready")}get Oo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(zo);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Fo(t){var e,r;if(null==(e=no.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.To||(this.To=null==(r=no.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.To._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.To.start(t)}onRRwebEmit(t){var e;null==(e=this.To)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.To||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.To)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.To||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.To)||t.overrideSampling()}overrideTrigger(t){var e,r;this.To||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.To)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.To)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.To)||!r.tryAddCustomEvent(t,e))}}var jm={},Zm=()=>{},$m="posthog",qm=!Bl&&-1===(null==io?void 0:io.indexOf("MSIE"))&&-1===(null==io?void 0:io.indexOf("Mozilla")),Hm=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Io(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Zm,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:Qn&&ei(null==Qn?void 0:Qn.search)&&-1!==Qn.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Gn||null==(e=Gn.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;lo.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:pm},error_tracking:{},_onCapture:Zm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Vm=t=>{var e={};ti(t.process_person)||(e.person_profiles=t.process_person),ti(t.xhr_headers)||(e.request_headers=t.xhr_headers),ti(t.cookie_name)||(e.persistence_name=t.cookie_name),ti(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ti(t.store_google)||(e.save_campaign_params=t.store_google),ti(t.verbose)||(e.debug=t.verbose);var r=po({},e,t);return Wr(t.property_blacklist)&&(ti(t.property_denylist)?r.property_denylist=t.property_blacklist:Wr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:lo.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class zm{constructor(){this.__forceAllowLocalhost=!1}get Do(){return this.__forceAllowLocalhost}set Do(t){lo.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Gm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new zm,this.Bo=!1,this.version=ao.LIB_VERSION,this.jo=new rm,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Hm(),this.SentryIntegration=lg,this.sentryIntegration=t=>function(t,e){var r=ug(t,e);return{name:ag,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Zo=!1,this.$o=null,this.qo=null,this.Ho=null,this.featureFlags=new Xg(this),this.toolbar=new fg(this),this.scrollManager=new bm(this),this.pageViewManager=new Bg(this),this.surveys=new am(this),this.conversations=new lm(this),this.logs=new hm(this),this.experiments=new Rm(this),this.exceptions=new wf(this),this.rateLimiter=new dm(this),this.requestRouter=new Mm(this),this.consent=new Jp(this),this.externalIntegrations=new Pm(this),this.people={set:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>lo.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==$m){var i,n=null!==(i=jm[r])&&void 0!==i?i:new Gm;return n._init(t,e,r),jm[r]=n,jm[$m][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ti(t)||ri(t))return lo.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.Vo(e.debug),this.zo=e,this.Go=[],e.person_profiles&&(this.qo=e.person_profiles),this.set_config(po({},Hm(e.defaults),Vm(e),{name:i,token:t})),this.config.on_xhr_error&&lo.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:rl.GZipJS;var o=this.Yo();this.persistence=new Kg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Kg(r({},this.config,{persistence:"sessionStorage"}),o);var s=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Uo=new gm((t=>this.Wo(t)),this.config.request_queue_config),this.Xo=new ym(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new Im(this),this.sessionPropsManager=new _m(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(lo.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Jo(u)}),0)):(lo.info("Initializing extensions synchronously"),this.Jo(u)),ao.DEBUG=ao.DEBUG||this.config.debug,ao.DEBUG&&lo.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(Qu()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(es,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.Ko()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:ls,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Qu());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(es,"anonymous")}return ko(Gn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?sg(this,(()=>this.Qo())):this.Qo(),Xr(this.config._onCapture)&&this.config._onCapture!==Zm&&(lo.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&lo.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Jo(t){var e=performance.now();this.historyAutocapture=new ng(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new gg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new xm(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Bm(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Rp(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new em(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Dg(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Og(this)})),r.push((()=>{this.exceptionObserver=new ig(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new eg(this,tg),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.ts){var t=this.ts;this.ts=void 0,this.vi(t)}})),this.es(r,e)}es(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.es(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){lo.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&lo.info("PostHog extensions initialized ("+i+"ms)")}vi(t){var e,r,i,n,o,s,a,u,l;if(!Kn||!Kn.body)return lo.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.vi(t)}),500);this.config.__preview_deferred_init_extensions&&(this.ts=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=qr(t.supportedCompression,rl.GZipJS)?rl.GZipJS:qr(t.supportedCompression,rl.Base64)?rl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.qo?this.qo:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(s=this.productTours)||s.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}Qo(){try{this.config.loaded(this)}catch(t){lo.critical("`loaded` function failed",t)}this.rs(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.ns()}),1),new fm(this).load(),this.featureFlags.flags()}rs(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Uo)||t.enable()))}_dom_loaded(){this.is_capturing()&&vo(this.__request_queue,(t=>this.Wo(t))),this.__request_queue=[],this.rs()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.os()&&this.capture("$pageleave"),null==(t=this.Uo)||t.unload(),null==(e=this.Xo)||e.unload()):this.os()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(qm?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Zl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=Zl(o.url,{_:(new Date).getTime().toString(),ver:ao.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Hl.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),u=null!==(i=null==(n=So(a,(t=>t.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(o)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}Wo(t){this.Xo?this.Xo.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];vo(t,(t=>{t&&(e=t[0],Wr(e)?n.push(t):Xr(t)?t.call(this):Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&Xr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){vo(t,(function(t){if(Wr(t[0])){var r=e;fo(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}Ko(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Uo){if(this.is_capturing())if(!ti(t)&&ei(t)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=e&&e.$current_url&&!ei(null==e?void 0:e.$current_url)&&(lo.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(null==i?void 0:i.timestamp)||a,l=Qu(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.ss(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=_o(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ti(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Ru.DISMISSED||t===Ru.SENT){var v=null==e?void 0:e[Fu.SURVEY_ID],f=null==e?void 0:e[Fu.SURVEY_ITERATION];Vu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[$u({id:v,current_iteration:f},t===Ru.SENT?"responded":"dismissed")]:!0})}else t===Ru.SHOWN&&(h.$set=r({},h.$set,{[Fu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(Qr(p)||this.setPersonPropertiesForFlags(p),!ni(this.config.before_send)){var g=this.us(h);if(!g)return;h=g}this.jo.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Wo(m):this.Uo.enqueue(m),h}lo.critical("This capture call is ignored due to client rate limiting.")}}else lo.error("No event name provided to posthog.capture")}else lo.uninitializedWarning("posthog.capture")}Di(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ei(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&lo.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=Ng(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&po(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&po(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Xo)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Tm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=po(a,l),"$pageview"===t&&Kn&&(a.title=Kn.title),!ti(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}io&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=po({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?fo(this.config.property_denylist,(function(t){delete a[t]})):lo.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.ls();return a.$process_person_profile=g,g&&!o&&this.hs("_calculate_event_properties"),a}ss(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.ls())return t;if(this.Bo)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=po({},i,n||{},t||{}),s=this.config.sanitize_properties;return s&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),e&&(this.Bo=!0),Qr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}cs(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},o=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=r({},n,t),a=r({},o,e),u={};for(var[l,h]of Object.entries(s)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ti(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.jo.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Gu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return lo.uninitializedWarning("posthog.identify");if(oi(t)&&(t=t.toString(),lo.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))lo.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ls){if(this.hs("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Oo)&&(this.unregister(Oo),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(es)||"anonymous");t!==n&&s?(this.persistence.set_property(es,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Ho=zl(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(ts))}}else lo.critical('The string "'+ls+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else lo.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.hs("posthog.setPersonProperties")){var i=zl(this.get_distinct_id(),t,e);this.Ho!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ho=i):lo.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else lo.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.hs("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(lo.info("reset"),!this.__loaded)return lo.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(es,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Ho=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ls,$device_id:null},"");else{var s=this.config.get_device_id(Qu());this.register_once({distinct_id:s,$device_id:t?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(t,e){return t===this.get_property(Fo)?(lo.critical("Attempting to create alias for existing People user - aborting."),-2):this.hs("posthog.alias")?(ti(e)&&(e=this.get_distinct_id()),t!==e?(this.cs(Oo,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(lo.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Kr(t)){var i,n,o,s,a,u,l;po(this.config,Vm(t));var h=this.Yo();null==(i=this.persistence)||i.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Kg(r({},this.config,{persistence:"sessionStorage"}),h);var c=this.Vo(this.config.debug);ai(c)&&(this.config.debug=c),ai(this.config.debug)&&(this.config.debug?(ao.DEBUG=!0,Vp.Ue()&&Vp.Ke("ph_debug","true"),lo.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ao.DEBUG=!1,Vp.Ue()&&Vp.Qe("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.ds(),null==(l=this.externalIntegrations)||l.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:$m;return e!==$m&&(e=$m+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(es))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(es))}ls(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Oo])&&(null==(e=this.persistence)||null==(e=e.props)||!e[as]))}os(){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.ls()||this.hs("posthog.createPersonProfile")&&this.setPersonProperties({},{})}hs(t){return"never"===this.config.person_profiles?(lo.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.cs(as,!0),!0)}Yo(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}ds(){var t,e,r,i,n=this.Yo();(null==(t=this.persistence)?void 0:t.bi)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.bi)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Im(this),this.pageViewManager=new Bg(this),this.persistence&&(this.sessionPropsManager=new _m(this,this.sessionManager,this.persistence)),this.sessionRecording=new Bm(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.ds(),this.rs(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.ns()}else lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ds(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ls,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.ns())):lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Xp.GRANTED?"granted":t===Xp.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ds()}_is_bot(){return Jn?Am(Jn,this.config.custom_blocked_useragents):void 0}ns(){Kn&&("visible"===Kn.visibilityState?this.Zo||(this.Zo=!0,this.capture("$pageview",{title:Kn.title},{send_instantly:!0}),this.$o&&(Kn.removeEventListener("visibilitychange",this.$o),this.$o=null)):this.$o||(this.$o=this.ns.bind(this),ko(Kn,"visibilitychange",this.$o)))}debug(t){!1===t?(null==Gn||Gn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Gn||Gn.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}))}Ee(){var t,e,r,i,n,o,s,a=this.zo||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(lo.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=lo,o=(e="advanced_disable_flags")in(t=a)&&!ti(t[e]),s=r in t&&!ti(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}us(t){if(ni(this.config.before_send))return t;var e=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ni(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return li(t.event)?lo.warn(n+". This can cause unexpected behavior."):lo.info(n),null}r.properties&&!Qr(r.properties)||lo.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Xr)?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)})}Vo(t){var e=ai(t)&&!t,r=Vp.Ue()&&"true"===Vp.Xe("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=bo(t.prototype[e[r]])}(Gm,["identify"]);var Ym,Um={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Wm=(Ym=jm[$m]=new Gm,function(){function t(){t.done||(t.done=!0,qm=!1,fo(jm,(function(t){t._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?t():ko(Kn,"DOMContentLoaded",t,{capture:!1}):Gn&&lo.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Ym);export{rl as Compression,Um as DEFAULT_PRODUCT_TOUR_APPEARANCE,Ou as DisplaySurveyType,Gm as PostHog,Ru as SurveyEventName,Fu as SurveyEventProperties,Su as SurveyEventType,xu as SurveyPosition,Mu as SurveyQuestionBranchingType,Eu as SurveyQuestionType,Nu as SurveySchedule,Au as SurveyTabPosition,Tu as SurveyType,ku as SurveyWidgetType,Wm as default,Wm as posthog,el as severityLevels};
1
+ function t(t,e,r,i,n,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,u,"next",e)}function u(e){t(s,n,o,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function 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 C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function M(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 N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(N,((t,r,i,n,o,s)=>{var a,u=i||o||s,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var o=i(V);if(","===o.slice(-1))o=Y(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=Y(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var M=null;x&&(M=I(x)),M&&(delete y.rel,delete y.href,y._cssText=M)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var N=I(t.sheet);N&&(y._cssText=N)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=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(l.type,l.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="+q+"! 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}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"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:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:R=!0}=e;E||(E=Q(t,s,a,void 0===E));var N,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;N=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"===M(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:N});if(i.add(t,O),N===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(C(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===M(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?st[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ut[n]=s,s.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Mt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Nt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),jt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jt||{}),Zt=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Zt||{}),$t=(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))($t||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(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&&qt(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 Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Mt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ut(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Wt(this.droppedSet,s)||Ut(this.removes,s,this.mirror)?Wt(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=R(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===h?l:[l,h]:s._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Mt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=jt.Mouse;break;case"touch":u=jt.Touch;break;case"pen":u=jt.Pen}u===jt.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):jt.Pen}else Tt(i)&&(u=jt.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===jt.Touch||l.startsWith("Mouse")&&u===jt.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var u="#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,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),o.media||500))),u=[ft("play",a($t.Play),s),ft("pause",a($t.Pause),s),ft("seeked",a($t.Seeked),s),ft("volumechange",a($t.VolumeChange),s),ft("ratechange",a($t.RateChange),s)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var u,[l,h,c]=s;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=se(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:oe(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,s)=>{var a,[l]=s;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(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 ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,o,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));s.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Me{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),u=new Map,l=new Re;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:Zt["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.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});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:Zt["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:Zt["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,Zt.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,Zt.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Ne{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Nt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function je(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=t;Vt=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=_),Be.reset();var L,D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=wt(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(s),r);else if(P){var a={type:"rrweb",event:Z(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Lt.FullSnapshot)L=s,j=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&s.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Ne({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Me({recordCanvas:I,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:M,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!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 rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Rt(t,Be)&&z.trackLinkElement(t),Mt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:N,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=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}je.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},je.freezePage=()=>{Kt.forEach((t=>t.freeze()))},je.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},je.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var Ze,$e=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(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),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Ue?Ue[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var o=ur(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lr[n]=s,s.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(s in e){var h=e[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==(Ze=xr.contentWindow)?void 0:Ze.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Mr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Rr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Nr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Nr(u.length?u[0]:null):s[a]=u}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,o=Mr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Mr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Mr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:h,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),jr=["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"],Zr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return jr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},$r=["$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 qr(t,e){return-1!==t.indexOf(e)}var Hr=function(t){return t.trim()},Vr=function(t){return t.replace(/^\$/,"")};var zr=Array.isArray,Gr=Object.prototype,Yr=Gr.hasOwnProperty,Ur=Gr.toString,Wr=zr||function(t){return"[object Array]"===Ur.call(t)},Xr=t=>"function"==typeof t,Jr=t=>Xr(t)&&-1!==t.toString().indexOf("[native code]"),Kr=t=>t===Object(t)&&!Wr(t),Qr=t=>{if(Kr(t)){for(var e in t)if(Yr.call(t,e))return!1;return!0}return!1},ti=t=>void 0===t,ei=t=>"[object String]"==Ur.call(t),ri=t=>ei(t)&&0===t.trim().length,ii=t=>null===t,ni=t=>ti(t)||ii(t),oi=t=>"[object Number]"==Ur.call(t)&&t==t,si=t=>oi(t)&&t>0,ai=t=>"[object Boolean]"===Ur.call(t),ui=t=>t instanceof FormData,li=t=>qr($r,t);function hi(t){return null===t||"object"!=typeof t}function ci(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function di(t){return!ti(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var vi=[!0,"true",1,"1","yes"],fi=t=>qr(vi,t),pi=[!1,"false",0,"0","no"];function gi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),oi(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),gi(n||r,e,r,i))}class mi{constructor(t){this.i={},this.o=t.o,this.h=gi(t.bucketSize,0,100,t.m),this.C=gi(t.refillRate,0,this.h,t.m),this.I=gi(t.refillInterval,0,864e5,t.m)}S(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.I);if(i>0){var n=i*this.C;t.tokens=Math.min(t.tokens+n,this.h),t.lastAccess=t.lastAccess+i*this.I}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.i[i];return n?this.S(n,r):(n={tokens:this.h,lastAccess:r},this.i[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.o)||e.call(this,t)),0===n.tokens)}stop(){this.i={}}}var yi="Mobile",bi="iOS",wi="Android",_i="Tablet",Ci=wi+" "+_i,Ii="iPad",Si="Apple",ki=Si+" Watch",xi="Safari",Ai="BlackBerry",Ti="Samsung",Ei=Ti+"Browser",Ri=Ti+" Internet",Mi="Chrome",Ni=Mi+" OS",Fi=Mi+" "+bi,Oi="Internet Explorer",Pi=Oi+" "+yi,Li="Opera",Di=Li+" Mini",Bi="Edge",ji="Microsoft "+Bi,Zi="Firefox",$i=Zi+" "+bi,qi="Nintendo",Hi="PlayStation",Vi="Xbox",zi=wi+" "+yi,Gi=yi+" "+xi,Yi="Windows",Ui=Yi+" Phone",Wi="Nokia",Xi="Ouya",Ji="Generic",Ki=Ji+" "+yi.toLowerCase(),Qi=Ji+" "+_i.toLowerCase(),tn="Konqueror",en="(\\d+(\\.\\d+)?)",rn=new RegExp("Version/"+en),nn=new RegExp(Vi,"i"),on=new RegExp(Hi+" \\w+","i"),sn=new RegExp(qi+" \\w+","i"),an=new RegExp(Ai+"|PlayBook|BB10","i"),un={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var ln,hn,cn,dn=(t,e)=>e&&qr(e,Si)||function(t){return qr(t,xi)&&!qr(t,Mi)&&!qr(t,wi)}(t),vn=function(t,e){return e=e||"",qr(t," OPR/")&&qr(t,"Mini")?Di:qr(t," OPR/")?Li:an.test(t)?Ai:qr(t,"IE"+yi)||qr(t,"WPDesktop")?Pi:qr(t,Ei)?Ri:qr(t,Bi)||qr(t,"Edg/")?ji:qr(t,"FBIOS")?"Facebook "+yi:qr(t,"UCWEB")||qr(t,"UCBrowser")?"UC Browser":qr(t,"CriOS")?Fi:qr(t,"CrMo")||qr(t,Mi)?Mi:qr(t,wi)&&qr(t,xi)?zi:qr(t,"FxiOS")?$i:qr(t.toLowerCase(),tn.toLowerCase())?tn:dn(t,e)?qr(t,yi)?Gi:xi:qr(t,Zi)?Zi:qr(t,"MSIE")||qr(t,"Trident/")?Oi:qr(t,"Gecko")?Zi:""},fn={[Pi]:[new RegExp("rv:"+en)],[ji]:[new RegExp(Bi+"?\\/"+en)],[Mi]:[new RegExp("("+Mi+"|CrMo)\\/"+en)],[Fi]:[new RegExp("CriOS\\/"+en)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+en)],[xi]:[rn],[Gi]:[rn],[Li]:[new RegExp("(Opera|OPR)\\/"+en)],[Zi]:[new RegExp(Zi+"\\/"+en)],[$i]:[new RegExp("FxiOS\\/"+en)],[tn]:[new RegExp("Konqueror[:/]?"+en,"i")],[Ai]:[new RegExp(Ai+" "+en),rn],[zi]:[new RegExp("android\\s"+en,"i")],[Ri]:[new RegExp(Ei+"\\/"+en)],[Oi]:[new RegExp("(rv:|MSIE )"+en)],Mozilla:[new RegExp("rv:"+en)]},pn=function(t,e){var r=vn(t,e),i=fn[r];if(ti(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},gn=[[new RegExp(Vi+"; "+Vi+" (.*?)[);]","i"),t=>[Vi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(Hi,"i"),[Hi,""]],[an,[Ai,""]],[new RegExp(Yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ui,""];if(new RegExp(yi).test(e)&&!/IEMobile\b/.test(e))return[Yi+" "+yi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=un[i]||"";return/arm/i.test(e)&&(n="RT"),[Yi,n]}return[Yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[bi,e.join(".")]}return[bi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ti(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+wi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[wi,e.join(".")]}return[wi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ni,""]],[/Linux|debian/i,["Linux",""]]],mn=function(t){return sn.test(t)?qi:on.test(t)?Hi:nn.test(t)?Vi:new RegExp(Xi,"i").test(t)?Xi:new RegExp("("+Ui+"|WPDesktop)","i").test(t)?Ui:/iPad/.test(t)?Ii:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ki:an.test(t)?Ai:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wi,"i").test(t)?Wi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(yi).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)?wi:Ci:new RegExp("(pda|"+yi+")","i").test(t)?Ki:new RegExp(_i,"i").test(t)&&!new RegExp(_i+" pc","i").test(t)?Qi:""},yn=function(t){var e=mn(t);return e===Ii||e===Ci||"Kobo"===e||"Kindle Fire"===e||e===Qi?_i:e===qi||e===Vi||e===Hi||e===Xi?"Console":e===ki?"Wearable":e?yi:"Desktop"},bn=t=>t instanceof Error;function wn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return cn&&r.length===hn||(hn=r.length,cn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,ln[i]=[u,l];break}}return r}),{})),cn}}class _n{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:wn(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Cn="?";function In(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?Cn:r,in_app:!0};return ti(i)||(o.lineno=i),ti(n)||(o.colno=n),o}var Sn=(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]:Cn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},kn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,An=/\((\S*)(?::(\d+))(?::(\d+))\)/,Tn=(t,e)=>{var r=kn.exec(t);if(r){var[,i,n,o]=r;return In(e,i,Cn,+n,+o)}var s=xn.exec(t);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=An.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[u,l]=Sn(s[1]||Cn,s[2]);return In(e,l,u,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},En=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mn=(t,e)=>{var r=En.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Rn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||Cn;return[o,n]=Sn(o,n),In(e,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Nn=/\(error: (.*)\)/,Fn=50;function On(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var o=[],s=e.split("\n"),a=n;a<s.length;a++){var u=s[a];if(!(u.length>1024)){var l=Nn.test(u)?u.replace(Nn,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){o.push(c);break}}if(o.length>=Fn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Fn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Cn});var i}))}(o)}}("web:javascript",Tn,Mn)}class Pn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ei(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return ci(t,"DOMException")}isDOMError(t){return ci(t,"DOMError")}}class Ln{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Dn{constructor(){}match(t){return ci(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class jn{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(Bn);return i&&(e=i[1],r=i[2]),[e,r]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return di(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return ei(t)&&!ri(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(bn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return di(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$n(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vn{match(t){return hi(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 zn{match(t){return ci(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return hi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(hi(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Gn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Gn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Un=Array.prototype,Wn=Un.forEach,Xn=Un.indexOf,Jn=null==Yn?void 0:Yn.navigator,Kn=null==Yn?void 0:Yn.document,Qn=null==Yn?void 0:Yn.location,to=null==Yn?void 0:Yn.fetch,eo=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ro=null==Yn?void 0:Yn.AbortController,io=null==Jn?void 0:Jn.userAgent,no=null!=Gn?Gn:{},oo=()=>!!Gn.Zone,so=t=>t instanceof Document,ao={DEBUG:!1,LIB_VERSION:"1.331.3"},uo=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k:function(e){if(Gn&&(ao.DEBUG||no.POSTHOG_DEBUG||r)&&!ti(Gn.console)&&Gn.console){for(var i=("__rrweb_original__"in Gn.console[e]?Gn.console[e].__rrweb_original__:Gn.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(t,...o)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.k("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>uo(t+" "+e,r)};return i},lo=uo("[PostHog.js]"),ho=lo.createLogger,co={};function vo(t,e,r){if(Wr(t))if(Wn&&t.forEach===Wn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===co)return}function fo(t,e,r){if(!ni(t)){if(Wr(t))return vo(t,e,r);if(ui(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===co)return}else for(var n in t)if(Yr.call(t,n)&&e.call(r,t[n],n)===co)return}}var po=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return vo(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},go=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return vo(r,(function(e){vo(e,(function(e){t.push(e)}))})),t};function mo(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 yo=function(t){try{return t()}catch(t){return}},bo=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){lo.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),lo.critical(t)}}},wo=function(t){var e={};return fo(t,(function(t,r){(ei(t)&&t.length>0||oi(t))&&(e[r]=t)})),e};function _o(t,e){return r=t,i=t=>ei(t)&&!ii(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Wr(e)?(o=[],vo(e,(e=>{o.push(t(e))}))):(o={},fo(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var Co=["herokuapp.com","vercel.app","netlify.app"];function Io(t){var e=null==t?void 0:t.hostname;if(!ei(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Co)if(r===i)return!1;return!0}function So(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function ko(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var xo=t=>{var e=null==Kn?void 0:Kn.createElement("a");return ti(e)?null:(e.href=t,e)},Ao=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return fo(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},To=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Wr(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){lo.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Eo=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Wr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=o&&(v+="#"+o),v},Ro=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Mo(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function No(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Fo="$people_distinct_id",Oo="__alias",Po="__timers",Lo="$autocapture_disabled_server_side",Do="$heatmaps_enabled_server_side",Bo="$exception_capture_enabled_server_side",jo="$error_tracking_suppression_rules",Zo="$error_tracking_capture_extension_exceptions",$o="$web_vitals_enabled_server_side",qo="$dead_clicks_enabled_server_side",Ho="$product_tours_enabled_server_side",Vo="$web_vitals_allowed_metrics",zo="$session_recording_remote_config",Go="$sesid",Yo="$session_is_sampled",Uo="$enabled_feature_flags",Wo="$early_access_features",Xo="$feature_flag_details",Jo="$stored_person_properties",Ko="$stored_group_properties",Qo="$surveys",ts="$flag_call_reported",es="$user_state",rs="$client_session_props",is="$capture_rate_limit",ns="$initial_campaign_params",os="$initial_referrer_info",ss="$initial_person_info",as="$epp",us="__POSTHOG_TOOLBAR__",ls="$posthog_cookieless",hs=[Fo,Oo,"__cmpns",Po,"$session_recording_enabled_server_side",Do,Go,Uo,jo,es,Wo,Xo,Ko,Jo,Qo,ts,rs,is,ns,os,as,ss,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function cs(t){return t instanceof Element&&(t.id===us||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ds(t){return!!t&&1===t.nodeType}function vs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function fs(t){return!!t&&3===t.nodeType}function ps(t){return!!t&&11===t.nodeType}function gs(t){return t?Hr(t).split(/\s+/):[]}function ms(t){var e=null==Gn?void 0:Gn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ys(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 gs(e)}function bs(t){return ni(t)?null:Hr(t).split(/(\s+)/).filter((t=>Zs(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ws(t){var e="";return Ns(t)&&!Fs(t)&&t.childNodes&&t.childNodes.length&&fo(t.childNodes,(function(t){var r;fs(t)&&t.textContent&&(e+=null!==(r=bs(t.textContent))&&void 0!==r?r:"")})),Hr(e)}function _s(t){return ti(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Cs=["a","button","form","input","select","textarea","label"];function Is(t,e){if(ti(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Ss(t){var e=t.parentNode;return!(!e||!ds(e))&&e}var ks=["next","previous","prev",">","<"],xs=10;var As=[".ph-no-rageclick",".ph-no-capture"];function Ts(t,e){if(!Gn||Es(t))return!1;var r,i,n;ai(e)?(r=!!e&&As,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:As,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Rs(t,!1);return!function(t,e){if(!1===t||ti(t))return!1;var r;if(!0===t)r=ks;else{if(!Wr(t))return!1;if(t.length>xs)return lo.error("[PostHog] content_ignorelist array cannot exceed "+xs+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,o.map((t=>{var e;return{safeText:ws(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Is(o,r)}var Es=t=>!t||vs(t,"html")||!ds(t),Rs=(t,e)=>{if(!Gn||Es(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!vs(n,"body");)if(ps(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=Ss(n);if(!o)break;if(e||Cs.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Gn.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Ms(t,e,r,i,n){var o,s,a,u;if(void 0===r&&(r=void 0),!Gn||Es(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!ms(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&ms(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Rs(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ti(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!Is(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Gn.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&&(Cs.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ns(t){for(var e=t;e.parentNode&&!vs(e,"body");e=e.parentNode){var r=ys(e);if(qr(r,"ph-sensitive")||qr(r,"ph-no-capture"))return!1}if(qr(ys(t),"ph-include"))return!0;var i=t.type||"";if(ei(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ei(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fs(t){return!!(vs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vs(t,"select")||vs(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Os="(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})",Ps=new RegExp("^(?:"+Os+")$"),Ls=new RegExp(Os),Ds="\\d{3}-?\\d{2}-?\\d{4}",Bs=new RegExp("^("+Ds+")$"),js=new RegExp("("+Ds+")");function Zs(t,e){if(void 0===e&&(e=!0),ni(t))return!1;if(ei(t)){if(t=Hr(t),(e?Ps:Ls).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Bs:js).test(t))return!1}return!0}function $s(t){var e=ws(t);return Zs(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&fo(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ws(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){lo.error("[AutoCapture]",t)}})),e}function Hs(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return mo(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Vs(e.toString())]=Vs(r.toString())})),n+=":",n+=mo(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:zs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return mo(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Vs(t){return t.replace(/"|\\"/g,'\\"')}function zs(t){var e=t.attr__class;return e?Wr(e)?e:gs(e):void 0}var Gs={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"]},Ys=ho("[Recorder]"),Us=t=>"navigation"===t.entryType,Ws=t=>"resource"===t.entryType;function Xs(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Us(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ia({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=>Us(t)||Ws(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function Js(t,e){return!!e&&(ai(e)||e[t])}function Ks(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(ai(r))return!0;if(Wr(r))return o(r);var s=r[e];return ai(s)?s:o(s)}function Qs(t,e,r,i,n,o){return ta.apply(this,arguments)}function ta(){return ta=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return Ys.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ws(t)&&t.initiatorType===e&&(ti(i)||t.startTime>=i)&&(ti(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Qs(t,e,r,i,n,o+1))})),ta.apply(this,arguments)}function ea(t){var{body:e,options:r,url:i}=t;if(ni(e))return null;var{hostname:n,isHostDenied:o}=No(i,r);if(o)return n+" is in deny list";if(ei(e))return e;if(so(e))return e.textContent;if(ui(e))return Ao(e);if(Kr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ra=t=>!ii(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ia(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ti(a)?void 0:Math.round(a),endTime:ti(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(ra(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 na=["video/","audio/"];function oa(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function sa(){return sa=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=No(i,r);return o?Promise.resolve(n+" is in deny list"):oa(e)})),sa.apply(this,arguments)}function aa(){return aa=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=na.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=No(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return ii(n)?oa(e):Promise.resolve(n)})),aa.apply(this,arguments)}function ua(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Js("request",i.recordHeaders),o=Js("response",i.recordHeaders),s=Mo(r,"fetch",(s=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Ks({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return sa.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield s(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Ks({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return aa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Qs(r,"fetch",c.url,l,h).then((e=>{var r,i=ia({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var la=null;function ha(t,e,i){if(!("performance"in e))return()=>{};if(la)return Ys.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Gs,i):Gs,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Xs(o,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Js("request",r.recordHeaders),n=Js("response",r.recordHeaders),o=Mo(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,h){void 0===u&&(u=!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=>(Ks({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ea({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),Ks({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ea({body:v.response,options:r,url:a})),Qs(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ia({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),u,l,h)}));return()=>{o()}}(o,e,n),u=ua(o,e,n)),la=()=>{s(),a(),u(),la=null}}var ca=t=>({name:"rrweb/network@1",observer:ha,options:t});no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ca},no.__PosthogExtensions__.rrweb={record:je,version:"v2"},no.rrweb={record:je,version:"v2"},no.rrwebConsoleRecord={getRecordConsolePlugin:Br},no.getRecordNetworkPlugin=ca;var da,va,fa,pa,ga,ma,ya,ba,wa,_a,Ca,Ia,Sa={},ka=[],xa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Aa=Array.isArray;function Ta(t,e){for(var r in e)t[r]=e[r];return t}function Ea(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ra(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?da.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Ma(t,s,i,n,null)}function Ma(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++fa:n,__i:-1,__u:0};return null==n&&null!=va.vnode&&va.vnode(o),o}function Na(t){return t.children}function Fa(t,e){this.props=t,this.context=e}function Oa(t,e){if(null==e)return t.__?Oa(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Oa(t):null}function Pa(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Pa(t)}}function La(t){(!t.__d&&(t.__d=!0)&&pa.push(t)&&!$.__r++||ga!=va.debounceRendering)&&((ga=va.debounceRendering)||ma)($)}function $(){for(var t,e,r,i,n,o,s,a=1;pa.length;)pa.length>a&&pa.sort(ya),t=pa.shift(),a=pa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,o=[],s=[],e.__P&&((r=Ta({},i)).__v=i.__v+1,va.vnode&&va.vnode(r),Ha(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,o,null==n?Oa(i):n,!!(32&i.__u),s),r.__v=i.__v,r.__.__k[r.__i]=r,za(o,r,s),i.__e=i.__=null,r.__e!=n&&Pa(r)));$.__r=0}function Da(t,e,r,i,n,o,s,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||ka,b=e.length;for(u=function(t,e,r,i,n){var o,s,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),o=0;o<n;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=Ma(null,s,null,null,null):Aa(s)?s=t.__k[o]=Ma(Na,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Ma(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,u=o+d,s.__=t,s.__b=t.__b+1,a=null,-1!=(l=s.__i=ja(s,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,s.__u|=4))):t.__k[o]=null;if(c)for(o=0;o<h;o++)null!=(a=r[o])&&0==(2&a.__u)&&(a.__e==i&&(i=Oa(a)),Ua(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Sa:y[v.__i]||Sa,v.__i=c,g=Ha(t,v,d,n,o,s,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ya(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?u=Ba(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ba(t,e,r,i){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Ba(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Oa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function ja(t,e,r,i){var n,o,s,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,o=r+1;n>=0||o<e.length;)if(null!=(l=e[s=n>=0?n--:o++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function Za(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||xa.test(e)?r:r+"px"}function $a(t,e,r,i,n){var o,s;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||Za(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Za(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(ba,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=wa,t.addEventListener(e,o?Ca:_a,o)):t.removeEventListener(e,o?Ca:_a,o);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 qa(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=wa++;else if(e.t<r.u)return;return r(va.event?va.event(e):e)}}}function Ha(t,e,r,i,n,o,s,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[a=e.__e=r.__e]),(h=va.__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 Fa(m,w),c.constructor=x,c.render=Wa),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=Ta({},c.__s)),Ta(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&&s.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,_=va.__r,C=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++C<25);c.state=c.__s,null!=c.getChildContext&&(i=Ta(Ta({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Na&&null==h.key&&(S=Ga(h.props.children)),a=Da(t,Aa(S)?S:[S],e,r,i,n,o,s,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=o)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else{for(k=o.length;k--;)Ea(o[k]);Va(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Va(e);va.__e(t,e,r)}else null==o&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,o,s,a,u){var l,h,c,d,v,f,p,g=r.props||Sa,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!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,o[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(va.__m&&va.__m(e,o),a=!1),o=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(o=o&&da.call(t.childNodes),!a&&null!=o)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;$a(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||$a(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Da("template"==e.type?t.content:t,Aa(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:r.__k&&Oa(r,0),a,u),null!=o)for(l=o.length;l--;)Ea(o[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&$a(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&$a(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,o,s,u,l);return(h=va.diffed)&&h(e),128&e.__u?void 0:a}function Va(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Va)}function za(t,e,r){for(var i=0;i<r.length;i++)Ya(r[i],r[++i],r[++i]);va.__c&&va.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){va.__e(t,e.__v)}}))}function Ga(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Aa(t)?t.map(Ga):Ta({},t)}function Ya(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){va.__e(t,r)}}function Ua(t,e,r){var i,n;if(va.unmount&&va.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ya(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){va.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ua(i[n],e,r||"function"!=typeof t.type);r||Ea(t.__e),t.__c=t.__=t.__e=void 0}function Wa(t,e,r){return this.constructor(t,r)}function Xa(t,e,r){var i,n,o;e==document&&(e=document.documentElement),va.__&&va.__(t,e),i=!1?null:e.__k,n=[],o=[],Ha(e,t=e.__k=Ra(Na,null,[t]),i||Sa,Sa,e.namespaceURI,i?null:e.firstChild?da.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),za(n,t,o)}function Ja(t,e,r){var i,n,o,s,a=Ta({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?da.call(arguments,2):r),Ma(t.type,a,i||t.key,n||t.ref,null)}da=ka.slice,va={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},fa=0,Fa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ta({},this.state),"function"==typeof t&&(t=t(Ta({},r),this.props)),t&&Ta(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),La(this))},Fa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),La(this))},Fa.prototype.render=Na,pa=[],ma="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ya=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,ba=/(PointerCapture)$|Capture$/i,wa=0,_a=qa(!1),Ca=qa(!0),Ia=0;var Ka,Qa,tu,eu,ru=0,iu=[],nu=va,ou=nu.__b,su=nu.__r,au=nu.diffed,uu=nu.__c,lu=nu.unmount,hu=nu.__;function cu(t,e){nu.__h&&nu.__h(Qa,t,ru||e),ru=0;var r=Qa.__H||(Qa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function du(t){return ru=1,function(t,e,r){var i=cu(Ka++,2);if(i.t=t,!i.__c&&(i.__=[Iu(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=Qa,!Qa.__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!o||o.call(this,t,e,r);var s=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]&&(s=!0)}})),o&&o.call(this,t,e,r)||s};Qa.__f=!0;var o=Qa.shouldComponentUpdate,s=Qa.componentWillUpdate;Qa.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Qa.shouldComponentUpdate=n}return i.__N||i.__}(Iu,t)}function vu(t,e){var r=cu(Ka++,3);!nu.__s&&Cu(r.__H,e)&&(r.__=t,r.u=e,Qa.__H.__h.push(r))}function fu(t){return ru=5,pu((function(){return{current:t}}),[])}function pu(t,e){var r=cu(Ka++,7);return Cu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function gu(t){var e=Qa.context[t.__c],r=cu(Ka++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Qa)),e.props.value):t.__}function mu(){for(var t;t=iu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(wu),t.__H.__h.forEach(_u),t.__H.__h=[]}catch(e){t.__H.__h=[],nu.__e(e,t.__v)}}nu.__b=function(t){Qa=null,ou&&ou(t)},nu.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),hu&&hu(t,e)},nu.__r=function(t){su&&su(t),Ka=0;var e=(Qa=t.__c).__H;e&&(tu===Qa?(e.__h=[],Qa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(wu),e.__h.forEach(_u),e.__h=[],Ka=0)),tu=Qa},nu.diffed=function(t){au&&au(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==iu.push(e)&&eu===nu.requestAnimationFrame||((eu=nu.requestAnimationFrame)||bu)(mu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),tu=Qa=null},nu.__c=function(t,e){e.some((function(t){try{t.__h.forEach(wu),t.__h=t.__h.filter((function(t){return!t.__||_u(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],nu.__e(r,t.__v)}})),uu&&uu(t,e)},nu.unmount=function(t){lu&&lu(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{wu(t)}catch(t){e=t}})),r.__H=void 0,e&&nu.__e(e,r.__v))};var yu="function"==typeof requestAnimationFrame;function bu(t){var e,r=function(){clearTimeout(i),yu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);yu&&(e=requestAnimationFrame(r))}function wu(t){var e=Qa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Qa=e}function _u(t){var e=Qa;t.__c=t.__(),Qa=e}function Cu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Iu(t,e){return"function"==typeof e?e(t):e}var Su=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),ku=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),xu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Au=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Tu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Eu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Ru=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Mu=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Nu=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Fu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Ou=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Pu=ho("[Surveys]");function Lu(t){return!(!t.start_date||t.end_date)}function Du(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Bu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var ju="seenSurvey_",Zu="inProgressSurvey_",$u=(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},qu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Hu=t=>qu(ju,t),Vu=t=>{localStorage.getItem(Hu(t))||localStorage.setItem(Hu(t),"true")},zu=[Tu.Popover,Tu.Widget,Tu.API],Gu={ignoreConditions:!1,ignoreDelay:!1,displayType:Ou.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return oi(t)&&isFinite(t)&&Math.floor(t)===t});var Yu="0123456789abcdef";class Uu{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Uu(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Yu.charAt(this.bytes[e]>>>4)+Yu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Uu(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Wu{constructor(){this.A=0,this.T=0,this.R=new Ku}generate(){var t=this.generateOrAbort();if(ti(t)){this.A=0;var e=this.generateOrAbort();if(ti(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.M();else{if(!(t+1e4>this.A))return;this.T++,this.T>4398046511103&&(this.A++,this.M())}return Uu.fromFieldsV7(this.A,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.R.nextUint32())}M(){this.T=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var Xu,Ju=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Gn&&!ti(Gn.crypto)&&crypto.getRandomValues&&(Ju=t=>crypto.getRandomValues(t));class Ku{constructor(){this.N=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.N.length&&(Ju(this.N),this.F=0),this.N[this.F++]}}var Qu=()=>tl().toString(),tl=()=>(Xu||(Xu=new Wu)).generate(),el=["fatal","error","warning","log","info","debug"],rl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),il=Uint8Array,nl=Uint16Array,ol=Uint32Array,sl=new il([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]),al=new il([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]),ul=new il([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ll=function(t,e){for(var r=new nl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new ol(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},hl=ll(sl,2),cl=hl[0],dl=hl[1];cl[28]=258,dl[258]=28;for(var vl=ll(al,0)[1],fl=new nl(32768),pl=0;pl<32768;++pl){var gl=(43690&pl)>>>1|(21845&pl)<<1;gl=(61680&(gl=(52428&gl)>>>2|(13107&gl)<<2))>>>4|(3855&gl)<<4,fl[pl]=((65280&gl)>>>8|(255&gl)<<8)>>>1}var ml=function(t,e,r){for(var i=t.length,n=0,o=new nl(e);n<i;++n)++o[t[n]-1];var s,a=new nl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new nl(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[fl[c]>>>u]=l}else for(s=new nl(i),n=0;n<i;++n)s[n]=fl[a[t[n]-1]++]>>>15-t[n];return s},yl=new il(288);for(pl=0;pl<144;++pl)yl[pl]=8;for(pl=144;pl<256;++pl)yl[pl]=9;for(pl=256;pl<280;++pl)yl[pl]=7;for(pl=280;pl<288;++pl)yl[pl]=8;var bl=new il(32);for(pl=0;pl<32;++pl)bl[pl]=5;var wl=ml(yl,9,0),_l=ml(bl,5,0),Cl=function(t){return(t/8>>0)+(7&t&&1)},Il=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof nl?nl:t instanceof ol?ol:il)(r-e);return i.set(t.subarray(e,r)),i},Sl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},kl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},xl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new il(0),0];if(1==n){var s=new il(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new nl(d+1),f=Al(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new il(v),f]},Al=function(t,e,r){return-1==t.s?Math.max(Al(t.l,e,r+1),Al(t.r,e,r+1)):e[t.s]=r},Tl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},El=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Rl=function(t,e,r){var i=r.length,n=Cl(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},Ml=function(t,e,r,i,n,o,s,a,u,l,h){Sl(e,h++,r),++n[256];for(var c=xl(n,15),d=c[0],v=c[1],f=xl(o,15),p=f[0],g=f[1],m=Tl(d),y=m[0],b=m[1],w=Tl(p),_=w[0],C=w[1],I=new nl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=xl(I,7),x=k[0],A=k[1],T=19;T>4&&!x[ul[T-1]];--T);var E,R,M,N,F=l+5<<3,O=El(n,yl)+El(o,bl)+s,P=El(n,d)+El(o,p)+s+14+3*T+El(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Rl(e,h,t.subarray(u,u+l));if(Sl(e,h,1+(P<O)),h+=2,P<O){E=ml(d,v,0),R=d,M=ml(p,g,0),N=p;var L=ml(x,A,0);Sl(e,h,b-257),Sl(e,h+5,C-1),Sl(e,h+10,T-4),h+=14;for(S=0;S<T;++S)Sl(e,h+3*S,x[ul[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];Sl(e,h,L[Z]),h+=x[Z],Z>15&&(Sl(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=wl,R=yl,M=_l,N=bl;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;kl(e,h,E[Z+257]),h+=R[Z+257],Z>7&&(Sl(e,h,i[S]>>>23&31),h+=sl[Z]);var q=31&i[S];kl(e,h,M[q]),h+=N[q],q>3&&(kl(e,h,i[S]>>>5&8191),h+=al[q])}else kl(e,h,E[i[S]]),h+=R[i[S]];return kl(e,h,E[256]),h+R[256]},Nl=new ol([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fl=function(){for(var t=new ol(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ol=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new il(i+s+5*(1+Math.floor(s/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?l=Rl(u,l,t.subarray(h,c)):(u[h]=o,l=Rl(u,l,t.subarray(h,s)))}else{for(var d=Nl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new nl(32768),m=new nl(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 ol(25e3),C=new nl(288),I=new nl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=w(h),R=32767&h,M=m[E];if(g[R]=M,m[E]=R,A<=h){var N=s-h;if((S>7e3||x>24576)&&N>423){l=Ml(t,u,0,_,C,I,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=R-M&32767;if(N>2&&E==w(h-D))for(var B=Math.min(v,N)-1,j=Math.min(32767,h),Z=Math.min(258,N);D<=j&&--L&&R!=M;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,M=z)}}}D+=(R=M)-(M=g[R])+32768&32767}if(P){_[x++]=268435456|dl[O]<<18|vl[P];var Y=31&dl[O],U=31&vl[P];k+=sl[Y]+al[U],++C[257+Y],++I[U],A=h+O,++S}else _[x++]=t[h],++C[t[h]]}}l=Ml(t,u,o,_,C,I,k,x,T,h-T,l)}return Il(a,0,i+Cl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Pl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ll(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Fl[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Ol(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Pl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Pl(n,o-8,r.d()),Pl(n,o-4,i),n}var Dl=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ii(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Bl=!!eo||!!to,jl="text/plain",Zl=function(t,e,i){var n;void 0===i&&(i=!0);var[o,s]=t.split("?"),a=r({},e),u=null!==(n=null==s?void 0:s.split("&").map((t=>{var e,[r,n]=t.split("="),o=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],l=Ao(a);return l&&u.push(l),o+"?"+u.join("&")},$l=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),ql=t=>{var{data:e,compression:r}=t;if(e){if(r===rl.GZipJS){var i=Ll(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new il(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new il(n+8+(r-s<<1));a.set(i),i=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Il(i,0,n)}($l(e)),{mtime:0}),n=new Blob([i],{type:jl});return{contentType:jl,body:n,estimatedSize:n.size}}if(r===rl.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=Dl(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[u++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}($l(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:$l(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=$l(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hl=[];to&&Hl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=ql(t))&&void 0!==e?e:{},a=new Headers;fo(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(ro){var h=new ro;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}to(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){lo.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{lo.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),eo&&Hl.push({transport:"XHR",method:t=>{var e,r=new eo;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=ql(t))&&void 0!==e?e:{};fo(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&&Hl.push({transport:"sendBeacon",method:t=>{var e=Zl(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=ql(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Jn.sendBeacon(e,o)}catch(t){}}});var Vl=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 zl(t,e,r){return $l({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Gl={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=>Vl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Vl(e,t))))),icontains:(t,e)=>e.map(Yl).some((e=>t.map(Yl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Yl).every((e=>t.map(Yl).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)))}))},Yl=t=>t.toLowerCase();function Ul(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ti(n)||ii(n))return!1;var o=[String(n)],s=Gl[i.operator];return!!s&&s(i.values,o)}))}var Wl=ho("[Stylesheet Loader]"),Xl=Gn,Jl=Kn;function Kl(t){return"$survey_response_"+t}var Ql="#020617",th={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:xu.Right,widgetType:ku.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ql,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function eh(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 rh(t){var e;void 0===t&&(t=th.backgroundColor),"#"===t[0]&&(e=eh(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=eh(r)),!e)return Ql;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Ql:"white"}return Ql}function ih(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Wl.error("prepare_external_dependency_stylesheet returned null"),null)})(Jl,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.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)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var nh=(t,e,i)=>{var n=kh(t),o=Jl.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Jl.createElement("div");((t,e,i)=>{var n=r({},th,i),o=t.style,s=![xu.Center,xu.Left,xu.Right].includes(n.position)||e===Tu.Widget&&(null==i?void 0:i.widgetType)===ku.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||rh(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",rh(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||rh(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",rh(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||rh(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),u=ih(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return Jl.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},oh=(t,e)=>{if(!e)return null;var r=t[Kl(e)];return Wr(r)?[...r]:r},sh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s,properties:a}=t;o?(Vu(i),o.capture(Nu.SENT,r({[Fu.SURVEY_NAME]:i.name,[Fu.SURVEY_ID]:i.id,[Fu.SURVEY_ITERATION]:i.current_iteration,[Fu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Fu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:oh(e,t.id)}))),[Fu.SURVEY_SUBMISSION_ID]:n,[Fu.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,a,{$set:{[$u(i,"responded")]:!0}})),s&&(Xl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Sh(i))):Pu.error("[survey sent] event not captured, PostHog instance not found.")},ah=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!ni(t))).length>0,uh=(t,e,i)=>r({[Fu.SURVEY_NAME]:t.name,[Fu.SURVEY_ID]:t.id,[Fu.SURVEY_ITERATION]:t.current_iteration,[Fu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Fu.SURVEY_PARTIALLY_COMPLETED]:ah(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Fu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Fu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:oh((null==e?void 0:e.responses)||{},t.id)})))}),lh=(t,e,i)=>{if(e){if(!i){var n=Ch(t);e.capture(Nu.DISMISSED,r({},uh(t,n,e),{$set:{[$u(t,"dismissed")]:!0}})),Sh(t),Vu(t),Xl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Pu.error("[survey dismissed] event not captured, PostHog instance not found.")},hh=(t,e)=>{if(e){var r=(t=>qu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Ch(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Nu.ABANDONED,uh(t,i,e),{transport:"sendBeacon"})}}else Pu.error("[survey abandoned] event not captured, PostHog instance not found.")},ch=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),dh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,vh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?dh(t.questions,ch(t.questions)):t.questions,fh=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===Mu.Always||Ih(t)},ph=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,La(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"+Ia++,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}),gh=()=>gu(ph),mh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return Ja(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function yh(t){return null!=t?t:"icontains"}function bh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Xl||null==(r=Xl.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=yh(null==(i=t.conditions)?void 0:i.urlMatchType);return Gl[s](o,[n])}var wh=t=>{var e=""+Zu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Zu+t.id+"_"+t.current_iteration),e},_h=(t,e)=>{try{localStorage.setItem(wh(t),JSON.stringify(e))}catch(t){Pu.error("Error setting in-progress survey state in localStorage",t)}},Ch=t=>{try{var e=localStorage.getItem(wh(t));if(e)return JSON.parse(e)}catch(t){Pu.error("Error getting in-progress survey state from localStorage",t)}return null},Ih=t=>{var e=Ch(t);return!ni(null==e?void 0:e.surveySubmissionId)},Sh=t=>{try{localStorage.removeItem(wh(t))}catch(t){Pu.error("Error clearing in-progress survey state from localStorage",t)}};function kh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function xh(t,e,r){if(void 0===e&&(e=xu.Right),t===Tu.ExternalSurvey)return{};switch(e){case xu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case xu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case xu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case xu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case xu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case xu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case xu.Left:return{left:"30px"};case xu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case xu.Right:return{right:t===Tu.Widget&&r===ku.Tab?"60px":"30px"}}}var Ah=0;function Th(t,e,r,i,n,o){e||(e={});var s,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?s=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ah,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return va.vnode&&va.vnode(l),l}var Eh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Rh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Mh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Nh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Fh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Oh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Ph=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Lh=Th("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[Th("title",{id:"close-survey-title",children:"Close survey"}),Th("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:"currentColor"})]}),Dh=Th("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Th("g",{"clip-path":"url(#clip0_2415_6911)",children:[Th("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Th("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Th("g",{mask:"url(#mask0_2415_6911)",children:[Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"})]})]}),Th("defs",{children:Th("clipPath",{id:"clip0_2415_6911",children:Th("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Bh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Th("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Dh]})}function jh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:u}=gu(ph);return Th("div",{className:"bottom-section",children:[!a&&Th("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Gn||Gn.open(o)),u?null==s||s():n()},children:e}),!i.whiteLabel&&Th(Bh,{urlParams:{utm_source:"survey-footer"}})]})}function Zh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Th("div",{class:"question-header",children:[Th(e.type===Eu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&mh({component:Ra("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function $h(t){var{onClick:e}=t,{isPreviewMode:r}=gu(ph);return Th("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Lh})}Th("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Th("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 qh=Gn;function Hh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=gu(ph);return vu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return ko(qh,"keydown",t),()=>{qh.removeEventListener("keydown",t)}}),[s]),Th("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&Th($h,{onClick:()=>s()}),Th("h3",{className:"thank-you-message-header",children:e}),r&&mh({component:Ra("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Th(jh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Vh=t=>Wr(t)&&t.every((t=>ei(t)));function zh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:u}=gh(),l=fu(null),[h,c]=du((()=>ei(a)?a:""));vu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+s;return Th(Na,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:e,forceDisableHtml:r,htmlFor:d}),Th("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:i,onSubmit:()=>n(h),onPreviewSubmit:()=>o(h)})]})}function Gh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return Th(Na,{children:[Th("div",{className:"question-container",children:Th(Zh,{question:e,forceDisableHtml:r})}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Yh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=du((()=>oi(u)?u:Wr(u)&&u.length>0&&oi(parseInt(u[0]))?parseInt(u[0]):ei(u)&&oi(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=gh(),p=t=>f?a(t):s(t);return Th(Na,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:r,forceDisableHtml:i}),Th("div",{className:"rating-section",children:[Th("div",{className:"rating-options",children:["emoji"===r.display&&Th("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=Qh[r.scale])?void 0:e.map(((t,e)=>Th("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&&Th("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:tc(r.scale).map(((t,e)=>Th(Uh,{displayQuestionIndex:n,active:c===t,appearance:o,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Th("div",{className:"rating-text",children:[Th("div",{children:r.lowerBoundLabel}),Th("div",{children:r.upperBoundLabel})]})]})]}),Th(jh,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:ii(c)&&!r.optional,appearance:o,onSubmit:()=>s(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Uh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Th("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Wh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=fu(null),h=pu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=dh(e,ch(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=du((()=>((t,e)=>ei(t)||Vh(t)?t:e===Eu.SingleChoice?null:[])(u,e.type))),[v,f]=du((()=>((t,e)=>{if(ei(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Vh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=gh(),g=e.type===Eu.SingleChoice,m=e.type===Eu.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=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Wr(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||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!ii(c)||(!(!Wr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Wr(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return Th(Na,{children:[Th("div",{className:"question-container",children:[Th(Zh,{question:e,forceDisableHtml:i}),Th("fieldset",{className:"multiple-choice-options limit-height",children:[Th("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===t:Wr(c)&&c.includes(t);return Th("label",{className:i?"choice-option-open":"",children:[Th("div",{className:"response-choice",children:[Th("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),Th("span",{children:i?t+":":t})]}),i&&Th("input",{type:"text",ref:l,id:s,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)}))]})]}),Th(jh,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Xh=[1,2,3,4,5],Jh=[1,2,3,4,5,6,7],Kh=[0,1,2,3,4,5,6,7,8,9,10],Qh={2:[Oh,Ph],3:[Mh,Rh,Eh],5:[Nh,Mh,Rh,Eh,Fh]};function tc(t){switch(t){case 5:default:return Xh;case 7:return Jh;case 10:return Kh}}var ec=ho("[Surveys]");function rc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Ru.End:o;if(n.branching.type===Ru.End)return Ru.End;if(n.branching.type===Ru.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Ru.ResponseBased){if(n.type===Eu.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Ru.End?Ru.End:o}}else if(n.type===Eu.Rating){var l;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(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Ru.End?Ru.End:o}}return o}return ec.warn("Falling back to next question index due to unexpected branching type"),o}var ic=Gn,nc=Kn,oc="ph:show_survey_widget",sc="PHWidgetSurveyClickListener",ac=250,uc=20,lc=12;class hc{constructor(t){var e=this;this.O=new Map,this.P=new Map,this.L=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Qo);if(t)for(var e of t)Ih(e)&&hh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i;this.D(t.id),this.B(t);var n=(null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0,{shadow:o}=nh(t,this._posthog);if(n<=0)return Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j,properties:e}),o);var s=setTimeout((()=>{if(this.O.delete(t.id),!bh(t))return this.j(t);Xa(Th(fc,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.j,properties:e}),o)}),1e3*n);this.O.set(t.id,s)},this.Z=t=>{var{shadow:e,isNewlyCreated:r}=nh(t,this._posthog);r&&Xa(Th(gc,{posthog:this._posthog,survey:t},t.id),e)},this.$=t=>{this.q(t);var e=this.P.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(sc),this.P.delete(t.id),Pu.info("Removed click listener for survey "+t.id))},this.H=(t,e)=>{var r=nc.querySelector(e),i=this.P.get(t.id);if(r){if(this.Z(t),i){if(r===i.element)return;Pu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.$(t)}if(!r.hasAttribute(sc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===xu.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=ic.innerHeight,n=ic.innerWidth,o=ac,s=r.left+r.width/2-e/2;s+e>n-uc&&(s=n-e-uc),s<uc&&(s=uc);var a=lc,u=i-r.bottom,l=r.top,h=u<o&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:th.zIndex}}catch(t){return Pu.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||th.maxWidth)):{};ic.dispatchEvent(new CustomEvent(oc,{detail:{surveyId:t.id,position:n}}))};ko(r,"click",n),r.setAttribute(sc,"true"),this.P.set(t.id,{element:r,listener:n,survey:t}),Pu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.$(t)},this.renderPopover=t=>{var{shadow:e}=nh(t,this._posthog);Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.V(t),Xa(Th(fc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.j,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.Y(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===Tu.Popover||t.type===Tu.Widget)),i=e.W(r),n=new Set;i.forEach((t=>{if(t.type===Tu.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===ku.Tab)return void e.Z(t);if((null==(i=t.appearance)?void 0:i.widgetType)===ku.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.H(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ii(e.X)&&t.type===Tu.Popover&&e.handlePopoverSurvey(t)})),e.P.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.$(r)}))}),t)},this.B=t=>{ii(this.X)||Pu.error("Survey "+this.X+" already in focus. Cannot add survey "+t.id+"."),this.X=t.id},this.j=t=>{this.X!==t.id&&Pu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.D(t.id),this.X=null,this.q(t)},this._posthog=t,this.X=null}D(t){var e=this.O.get(t);e&&(clearTimeout(e),this.O.delete(t))}cancelSurvey(t){this.O.has(t)&&(Pu.info("Cancelled pending survey "+t),this.D(t),this.X===t&&(this.X=null))}W(t){return t.sort(((t,e)=>{var r,i,n=Ih(t),o=Ih(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===Mu.Always,a=e.schedule===Mu.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}V(t){if(!this.L.has(t.id))try{var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ti(a)){var u=decodeURIComponent(s),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(ic.location.search);if(0===Object.keys(e).length)return;Pu.info("[Survey Prefill] Detected URL prefill parameters");var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],o=Kl(t.id);try{switch(t.type){case Eu.SingleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=t.choices.length)return void lo.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[s];break;case Eu.MultipleChoice:if(!t.choices||0===t.choices.length)return void lo.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void lo.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&lo.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=u;break;case Eu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void lo.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=l;break;default:lo.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){lo.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return void Pu.warn("[Survey Prefill] No valid responses after conversion");var i=Qu(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:s}=function(t,e,r){for(var i=0,n={},o=t.questions.length+1;i<t.questions.length&&0<o&&e.includes(i);){var s=t.questions[i];if(!s||!("skipSubmitButton"in s)||!s.skipSubmitButton)break;if(s.id){var a=Kl(s.id);ti(r[a])||(n[a]=r[a])}var u=rc(t,i,s.id?r[Kl(s.id)]:null);if(u===Ru.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=o>=t.questions.length;_h(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?t.questions.length-1:o}),Pu.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(s).length>0&&t.enable_partial_responses||a)&&sh({responses:a?r:s,survey:t,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this.L.add(t.id)}catch(t){Pu.error("[Survey Prefill] Error handling URL prefill:",t)}}J(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}G(t){return!t.conditions||bh(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!io)return!1;var n=yn(io);return Gl[yh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Jl||!Jl.querySelector(t.conditions.selector))}(t)}K(t){return fh(t)||this.J(t.internal_targeting_flag_key)||Ih(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Lu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!zu.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.J(t.linked_flag_key,n)?this.J(t.targeting_flag_key)?this.K(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Hu(t))&&!fh(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)}Y(t){var e;if(!Du(t)&&!Bu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.J(r)}))}q(t){try{var e=nc.querySelector(kh(t,!0));null!=e&&e.shadowRoot&&Xa(null,e.shadowRoot),null==e||e.remove()}catch(e){Pu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.B,removeSurveyFromFocus:this.j,surveyInFocus:this.X,surveyTimeouts:this.O,handleWidget:this.Z,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.H,sortSurveysByAppearanceDelay:this.W,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.J.bind(this)}}}function cc(t,e){if(nc&&ic){var r,i=new hc(t);if(t.config.disable_surveys_automatic_display)return Pu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Pu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ti(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),ko(nc,"visibilitychange",(()=>{nc.hidden?ti(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function dc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;vu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===Tu.Widget,o=bh(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===ku.Tab&&n;if(!o)return Pu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(Pu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};ko(ic,"popstate",o),ko(ic,"hashchange",o);var s=ic.history.pushState,a=ic.history.replaceState;return ic.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},ic.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{ic.removeEventListener("popstate",o),ic.removeEventListener("hashchange",o),ic.history.pushState=s,ic.history.replaceState=a}}}),[n,e,r,i])}function vc(t){switch(void 0===t&&(t=Au.Right),t){case Au.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Au.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Au.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Au.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function fc(t){var e,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y}=t,b=fu(null),w=Number.isInteger(d),_=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:C,isSurveySent:I,hidePopupWithViewTransition:S}=function(t,e,r,i,n,o,s){var[a,u]=du(i||0===r||t.type===Tu.ExternalSurvey),[l,h]=du(!1),c=()=>{var e=()=>{o&&n(t),u(!1)};nc.startViewTransition?nc.startViewTransition((()=>{var t;null==s||null==(t=s.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return vu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();h(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{bh(t)&&(u(!0),ic.dispatchEvent(new Event("PHSurveyShown")),e.capture(Nu.SHOWN,{[Fu.SURVEY_NAME]:t.name,[Fu.SURVEY_ID]:t.id,[Fu.SURVEY_ITERATION]:t.current_iteration,[Fu.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(ko(ic,"PHSurveyClosed",d),ko(ic,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),ic.removeEventListener("PHSurveyClosed",d),ic.removeEventListener("PHSurveySent",n)}}return o(),()=>{ic.removeEventListener("PHSurveyClosed",d),ic.removeEventListener("PHSurveySent",n)}}}else Pu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:l,setIsPopupVisible:u,hidePopupWithViewTransition:c}}(u,h,_,w,v,f,b),k=I||d===u.questions.length,x=pu((()=>{var t=Ch(u);return{isPreviewMode:w,previewPageIndex:d,onPopupSurveyDismissed:()=>{lh(u,h,w),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Qu(),onPreviewSubmit:p,posthog:h,properties:y}}),[w,d,f,h,u,g,p,y]);return C?Th(ph.Provider,{value:x,children:Th("div",{className:"ph-survey",style:r({},xh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:b,children:k?Th(Hh,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=u.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||th,onClose:()=>{S(),m()}}):Th(pc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function pc(t){var e,{survey:i,forceDisableHtml:n,posthog:o}=t,[s,a]=du((()=>{var t=Ch(i);return null!=t&&t.responses&&Pu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=gu(ph),[p,g]=du((()=>{var t=Ch(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=pu((()=>vh(i)),[i]);vu((()=>{v&&!ti(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Th("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Th($h,{onClick:()=>{l()}}),Th("div",{className:"survey-box",children:mc({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||th,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(o)if(u){var l=Kl(u),h=r({},s,{[l]:e});a(h);var c=rc(i,n,e),v=c===Ru.End;v||(g(c),_h(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&sh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:o,properties:f})}else Pu.error("onNextButtonClick called without a questionId.");else Pu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?s[Kl(y.id)]:void 0})})]}):null}function gc(t){var e,r,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=du(!0),[f,p]=du(!1),[g,m]=du({}),y=()=>{p(!f)};if(vu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.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)===u.id&&(Pu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return ko(ic,oc,e),()=>{ic.removeEventListener(oc,e)}}}else Pu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),dc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Mu.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Th(Na,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Th("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===Au.Top?"widget-tab-top":""),onClick:y,disabled:c,style:vc(null==(s=u.appearance)?void 0:s.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Th(fc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var mc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Eu.Open:return Ra(zh,r({},l,{question:e,key:e.id}));case Eu.Link:return Ra(Gh,r({},l,{question:e,key:e.id}));case Eu.Rating:return Ra(Yh,r({},l,{question:e,key:e.id}));case Eu.SingleChoice:case Eu.MultipleChoice:return Ra(Wh,r({},l,{question:e,key:e.id}));default:return Pu.error("Unsupported question type: "+e.type),null}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.generateSurveys=cc,no.extendPostHogWithSurveys=cc;class yc{emit(t){}}var bc=new yc;var wc=new class{getLogger(t,e,r){return new yc}};class _c{constructor(t,e,r,i){this.tt=t,this.name=e,this.version=r,this.options=i}emit(t){this.et().emit(t)}et(){if(this.rt)return this.rt;var t=this.tt.it(this.name,this.version,this.options);return t?(this.rt=t,this.rt):bc}}class Cc{getLogger(t,e,r){var i;return null!==(i=this.it(t,e,r))&&void 0!==i?i:new _c(this,t,e,r)}nt(){var t;return null!==(t=this.rt)&&void 0!==t?t:wc}ot(t){this.rt=t}it(t,e,r){var i;return null===(i=this.rt)||void 0===i?void 0:i.getLogger(t,e,r)}}var Ic="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sc=Symbol.for("io.opentelemetry.js.api.logs"),kc=Ic;class xc{constructor(){this.st=new Cc}static getInstance(){return this._instance||(this._instance=new xc),this._instance}setGlobalLoggerProvider(t){return kc[Sc]?this.getLoggerProvider():(kc[Sc]=(e=1,r=t,i=wc,t=>t===e?r:i),this.st.ot(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=kc[Sc])||void 0===t?void 0:t.call(kc,1))&&void 0!==e?e:this.st}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete kc[Sc],this.st=new Cc}}var Ac=xc.getInstance();class Tc{constructor(t){this.rt=void 0,this.rt=t}export(t,e){this.rt.export(t,e)}forceFlush(){return this.rt.forceFlush()}shutdown(){return this.rt.shutdown()}}class Ec 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 Rc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Mc{constructor(t){this.ut=void 0,this.ht=[],this.ut=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.ht.push(t);var e=()=>{var e=this.ht.indexOf(t);this.ht.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.ht.length>=this.ut}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.ht)}))()}}function Nc(t){return new Mc(t.concurrencyLimit)}var Fc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Oc="1.9.0",Pc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Lc=function(t){var e=new Set([t]),r=new Set,i=t.match(Pc);if(!i)return function(){return!1};var n=+i[1],o=+i[2],s=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(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(Pc);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?o===h&&s<=c?u(t):a(t):o<=h?u(t):a(t)}}(Oc),Dc=Oc.split(".")[0],Bc=Symbol.for("opentelemetry.js.api."+Dc),jc=Fc;function Zc(t,e,r,i){var n;void 0===i&&(i=!1);var o=jc[Bc]=null!==(n=jc[Bc])&&void 0!==n?n:{version:Oc};if(!i&&o[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(o.version!==Oc){s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Oc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Oc+"."),!0}function $c(t){var e,r,i=null===(e=jc[Bc])||void 0===e?void 0:e.version;if(i&&Lc(i))return null===(r=jc[Bc])||void 0===r?void 0:r[t]}function qc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Oc+".");var r=jc[Bc];r&&delete r[t]}var Hc,Vc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},zc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Gc=function(){function t(t){this.ct=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("debug",this.ct,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("error",this.ct,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("info",this.ct,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("warn",this.ct,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yc("verbose",this.ct,t)},t}();function Yc(t,e,r){var i=$c("diag");if(i)return r.unshift(e),i[t].apply(i,zc([],Vc(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"}(Hc||(Hc={}));var Uc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},Wc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Xc=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=$c("diag");if(i)return i[t].apply(i,Wc([],Uc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,o;if(void 0===r&&(r={logLevel:Hc.INFO}),t===e){var s=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=s.stack)&&void 0!==i?i:s.message),!1}"number"==typeof r&&(r={logLevel:r});var a=$c("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Hc.NONE?t=Hc.NONE:t>Hc.ALL&&(t=Hc.ALL),e=e||{},{error:r("error",Hc.ERROR),warn:r("warn",Hc.WARN),info:r("info",Hc.INFO),debug:r("debug",Hc.DEBUG),verbose:r("verbose",Hc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Hc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Zc("diag",u,e,!0)},e.disable=function(){qc("diag",e)},e.createComponentLogger=function(t){return new Gc(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 Jc(t){return Symbol.for(t)}var Kc,Qc=function t(e){var r=this;r.dt=e?new Map(e):new Map,r.getValue=function(t){return r.dt.get(t)},r.setValue=function(e,i){var n=new t(r.dt);return n.dt.set(e,i),n},r.deleteValue=function(e){var i=new t(r.dt);return i.dt.delete(e),i}},td=new Qc,ed=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},rd=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},id=function(){function t(){}return t.prototype.active=function(){return td},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,rd([r],ed(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),nd=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},od=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},sd="context",ad=new id,ud=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Zc(sd,t,Xc.instance())},t.prototype.active=function(){return this.vt().active()},t.prototype.with=function(t,e,r){for(var i,n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return(i=this.vt()).with.apply(i,od([t,e,r],nd(n),!1))},t.prototype.bind=function(t,e){return this.vt().bind(t,e)},t.prototype.vt=function(){return $c(sd)||ad},t.prototype.disable=function(){this.vt().disable(),qc(sd,Xc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Kc||(Kc={}));var ld="0000000000000000",hd="00000000000000000000000000000000",cd={traceId:hd,spanId:ld,traceFlags:Kc.NONE},dd=function(){function t(t){void 0===t&&(t=cd),this.ft=t}return t.prototype.spanContext=function(){return this.ft},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}(),vd=Jc("OpenTelemetry Context Key SPAN");function fd(t){return t.getValue(vd)||void 0}function pd(){return fd(ud.getInstance().active())}function gd(t,e){return t.setValue(vd,e)}function md(t){return t.deleteValue(vd)}function yd(t,e){return gd(t,new dd(e))}function bd(t){var e;return null===(e=fd(t))||void 0===e?void 0:e.spanContext()}var wd=/^([0-9a-f]{32})$/i,_d=/^[0-9a-f]{16}$/i;function Cd(t){return r=t.traceId,wd.test(r)&&r!==hd&&(e=t.spanId,_d.test(e)&&e!==ld);var e,r}function Id(t){return new dd(t)}var Sd=ud.getInstance(),kd=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 dd;var i,n=r&&bd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Cd(n)?new dd(n):new dd},t.prototype.startActiveSpan=function(t,e,r,i){var n,o,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(n=e,s=r):(n=e,o=r,s=i);var a=null!=o?o:Sd.active(),u=this.startSpan(t,n,a),l=gd(a,u);return Sd.with(l,s,void 0,u)}},t}();var xd=new kd,Ad=function(){function t(t,e,r,i){this.tt=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.yt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.yt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.yt=function(){if(this.rt)return this.rt;var t=this.tt.getDelegateTracer(this.name,this.version,this.options);return t?(this.rt=t,this.rt):xd},t}(),Td=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new kd},t}()),Ed=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 Ad(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.rt)&&void 0!==t?t:Td},t.prototype.setDelegate=function(t){this.rt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.rt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Rd=ud.getInstance(),Md=Xc.instance(),Nd="trace",Fd=function(){function t(){this.bt=new Ed,this.wrapSpanContext=Id,this.isSpanContextValid=Cd,this.deleteSpan=md,this.getSpan=fd,this.getActiveSpan=pd,this.getSpanContext=bd,this.setSpan=gd,this.setSpanContext=yd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Zc(Nd,this.bt,Xc.instance());return e&&this.bt.setDelegate(t),e},t.prototype.getTracerProvider=function(){return $c(Nd)||this.bt},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){qc(Nd,Xc.instance()),this.bt=new Ed},t}(),Od=Fd.getInstance(),Pd=Jc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ld(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(Dd(i)){e=i;continue}return!1}return!1}}return!0}(t):Dd(typeof t))}function Dd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var Bd=t=>{Md.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))};function jd(t){try{Bd(t)}catch(t){}}var Zd,$d=performance,qd="telemetry.sdk.language",Hd="telemetry.sdk.name",Vd="telemetry.sdk.version",zd={[Hd]:"opentelemetry","process.runtime.name":"browser",[qd]:"webjs",[Vd]:"2.2.0"},Gd=Math.pow(10,6),Yd=Math.pow(10,9);function Ud(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Gd)]}function Wd(){var t=$d.timeOrigin;if("number"!=typeof t){var e=$d;t=e.timing&&e.timing.fetchStart}return t}function Xd(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Yd&&(r[1]-=Yd,r[0]+=1);return r}(Ud(Wd()),Ud("number"==typeof t?t:$d.now()))}function Jd(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Wd()?Xd(t):Ud(t);if(t instanceof Date)return Ud(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Zd||(Zd={}));var Kd="[object Object]",Qd="[object Null]",tv="[object Undefined]",ev=Function.prototype.toString,rv=ev.call(Object),iv=Object.getPrototypeOf,nv=Object.prototype,ov=nv.hasOwnProperty,sv=Symbol?Symbol.toStringTag:void 0,av=nv.toString;function uv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?tv:Qd;return sv&&sv in Object(t)?function(t){var e=ov.call(t,sv),r=t[sv],i=!1;try{t[sv]=void 0,i=!0}catch(t){}var n=av.call(t);i&&(e?t[sv]=r:delete t[sv]);return n}(t):function(t){return av.call(t)}(t)}(t)!==Kd)return!1;var e=iv(t);if(null===e)return!0;var r=ov.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ev.call(r)===rv}var lv=20;function hv(t){return vv(t)?t.slice():t}function cv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>lv)){if(r++,gv(t)||gv(e)||fv(e))n=hv(e);else if(vv(t)){if(n=t.slice(),vv(e))for(var o=0,s=e.length;o<s;o++)n.push(hv(e[o]));else if(pv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=hv(e[h])}}else if(pv(t))if(pv(e)){if(!function(t,e){if(!uv(t)||!uv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(gv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(dv(t,f,i)||dv(e,f,i))delete n[f];else{if(pv(g)&&pv(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]=cv(n[f],p,r,i)}}}}else n=e;return n}}function dv(t,e,r){for(var i=r.get(t[e])||[],n=0,o=i.length;n<o;n++){var s=i[n];if(s.key===e&&s.obj===t)return!0}return!1}function vv(t){return Array.isArray(t)}function fv(t){return"function"==typeof t}function pv(t){return!gv(t)&&!vv(t)&&!fv(t)&&"object"==typeof t}function gv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class mv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,mv.prototype)}}function yv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new mv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class bv{constructor(){this.wt=void 0,this._t=void 0,this.Ct=void 0,this.wt=new Promise(((t,e)=>{this._t=t,this.Ct=e}))}get promise(){return this.wt}resolve(t){this._t(t)}reject(t){this.Ct(t)}}class wv{constructor(t,e){this.It=void 0,this.St=void 0,this.kt=!1,this.xt=new bv,this.It=t,this.St=e}get isCalled(){return this.kt}get promise(){return this.xt.promise}call(){if(!this.kt){this.kt=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.It.call(this.St,...e)).then((t=>this.xt.resolve(t)),(t=>this.xt.reject(t)))}catch(t){this.xt.reject(t)}}return this.xt.promise}}var _v={At:function(t,e){return new Promise((r=>{Rd.with(function(t){return t.setValue(Pd,!0)}(Rd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function Cv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Md.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Iv{constructor(t,e,r,i,n){this.Tt=void 0,this.Et=void 0,this.Rt=void 0,this.Mt=void 0,this.Nt=void 0,this.Ft=void 0,this.Tt=t,this.Et=e,this.Rt=r,this.Mt=i,this.Nt=n,this.Ft=Md.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Ft.debug("items to be sent",t),this.Mt.hasReachedLimit())e({code:Zd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Et.serializeRequest(t);null!=r?this.Mt.pushPromise(this.Tt.send(r,this.Nt).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Zd.FAILED,error:t.error}):"retryable"===t.status?e({code:Zd.FAILED,error:new Ec("Export failed with retryable status")}):e({code:Zd.FAILED,error:new Ec("Export failed with unknown error")});else{if(null!=t.data)try{this.Rt.handleResponse(this.Et.deserializeResponse(t.data))}catch(e){this.Ft.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Zd.SUCCESS})}}),(t=>e({code:Zd.FAILED,error:t})))):e({code:Zd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Mt.awaitAll()}shutdown(){var t=this;return e((function*(){t.Ft.debug("shutdown started"),yield t.forceFlush(),t.Tt.shutdown()}))()}}function Sv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Nc(t)},n={timeout:t.timeoutMillis},new Iv(i.transport,i.serializer,Cv(),i.promiseHandler,n.timeout);var i,n}function kv(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function xv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=kv(t.charCodeAt(i)),o=kv(t.charCodeAt(i+1));e[r++]=n<<4|o}return e}function Av(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Tv(t){var e,r=Av(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Ev="undefined"!=typeof BigInt?function(t){return Av(t).toString()}:function(t){return t[0]*Yd+t[1]};function Rv(t){return t}function Mv(t){if(void 0!==t)return xv(t)}var Nv={encodeHrTime:Tv,encodeSpanContext:xv,encodeOptionalSpanContext:Mv};function Fv(t,e){return{key:t,value:Ov(e)}}function Ov(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(Ov)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Fv(e,r)}))}}:{}}function Pv(t,e){var r=function(t){var e,r;if(void 0===t)return Nv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Tv:Ev,encodeSpanContext:n?Rv:xv,encodeOptionalSpanContext:n?Rv:Mv}}(e);return{resourceLogs:Lv(t,r)}}function Lv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:o="",schemaUrl:s=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+o+":"+s,l=a.get(u);l||(l=[],a.set(u,l)),l.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=>Fv(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;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Ov(t.body),eventName:t.eventName,attributes:Dv(t.attributes),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}}))}function Dv(t){return Object.keys(t).map((e=>Fv(e,t[e])))}var Bv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class jv{static FromAttributeList(t,e){var r=new jv({},e);return r.Ot=$v(t),r.Pt=t.filter((t=>{var[e,r]=t;return Bv(r)})).length>0,r}constructor(t,e){var r;this.Ot=void 0,this.Pt=!1,this.Lt=void 0,this.Dt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.Ot=Object.entries(i).map((t=>{var[e,r]=t;return Bv(r)&&(this.Pt=!0),[e,r]})),this.Ot=$v(this.Ot),this.Lt=function(t){if("string"==typeof t||void 0===t)return t;return void Md.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.Pt}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.Ot.length;e++){var[r,i]=t.Ot[e];t.Ot[e]=[r,Bv(i)?yield i:i]}t.Pt=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Md.error("Accessing resource attributes before async attributes settled"),this.Dt)return this.Dt;var t={};for(var[e,r]of this.Ot){var i;if(Bv(r))Md.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Pt||(this.Dt=t),t}getRawAttributes(){return this.Ot}get schemaUrl(){return this.Lt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,o=void 0===i||""===i;if(n)return i;if(o)return r;if(r===i)return r;return void Md.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return jv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Zv(t,e){return jv.FromAttributeList(Object.entries(t),e)}function $v(t){return t.map((t=>{var[e,r]=t;return Bv(r)?[e,r.catch((t=>{Md.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var qv={serializeRequest:t=>{var e=Pv(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Hv{constructor(t){this.Tt=void 0,this.Tt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Tt.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.Tt.send(t,r),o=5,s=1e3;"retryable"===n.status&&o>0;){var a;o--;var u=Math.max(Math.min(s,5e3)+(.4*Math.random()-.2),0);s*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Tt.shutdown()}}function Vv(t){return new Hv(t.transport)}function zv(t){return[429,502,503,504].includes(t)}function Gv(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 r>=0?r:0}}class Yv{constructor(t){this.Bt=void 0,this.Bt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Bt.headers(),n=yield new Promise((n=>{var o=new XMLHttpRequest;o.timeout=r,o.open("POST",i.Bt.url),Object.entries(e).forEach((t=>{var[e,r]=t;o.setRequestHeader(e,r)})),o.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(Md.debug("XHR success"),n({status:"success"})):o.status&&zv(o.status)?n({status:"retryable",retryInMillis:Gv(o.getResponseHeader("Retry-After"))}):0!==o.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},o.send(t)}));return n}))()}shutdown(){}}class Uv{constructor(t){this.jt=void 0,this.jt=t}send(t){var r=this;return e((function*(){var e=(yield r.jt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.jt.url,new Blob([t],{type:e}))?(Md.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Wv{constructor(t){this.Bt=void 0,this.Bt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var o,s=!!globalThis.location,a=new URL(i.Bt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Bt.headers(),body:t,signal:e.signal,keepalive:s,mode:s?(null==(o=globalThis.location)?void 0:o.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Md.debug("response success"),{status:"success"}):zv(u.status)?{status:"retryable",retryInMillis:Gv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}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 Xv(t,e){return Sv(t,e,Vv({transport:(r=t,new Yv(r))}));var r}function Jv(t,e){return Sv(t,e,Vv({transport:(r=t,new Wv(r))}));var r}function Kv(t,e){return Sv(t,e,Vv({transport:(r={url:t.url,headers:t.headers},new Uv(r))}));var r}function Qv(t,i,n){return e((function*(){var e=r({},yield n()),o={};return null!=i&&Object.assign(o,yield i()),null!=t&&Object.assign(o,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Md.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(o,e)}))}function tf(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 ef(t,e,i){var n,o;return r({},function(t,e,r){var i,n,o,s,a,u;return{timeoutMillis:Rc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(o=null!==(s=t.concurrencyLimit)&&void 0!==s?s:e.concurrencyLimit)&&void 0!==o?o:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:Qv(t.headers,e.headers,i.headers),url:null!==(n=null!==(o=tf(t.url))&&void 0!==o?o:e.url)&&void 0!==n?n:i.url})}function rf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function nf(t,i,n){return ef({url:t.url,timeoutMillis:t.timeoutMillis,headers:rf(t),concurrencyLimit:t.concurrencyLimit},{},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))}function of(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Jv:Xv:Kv)(nf(t,r,i),e)}class sf extends Tc{constructor(t){void 0===t&&(t={}),super(of(t,qv,"v1/logs",{"Content-Type":"application/json"}))}}class af{set severityText(t){this.Zt()||(this.$t=t)}get severityText(){return this.$t}set severityNumber(t){this.Zt()||(this.qt=t)}get severityNumber(){return this.qt}set body(t){this.Zt()||(this.Ht=t)}get body(){return this.Ht}get eventName(){return this.Vt}set eventName(t){this.Zt()||(this.Vt=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.$t=void 0,this.qt=void 0,this.Ht=void 0,this.Vt=void 0,this.totalAttributesCount=0,this.zt=!1,this.Gt=void 0;var{timestamp:i,observedTimestamp:n,eventName:o,severityNumber:s,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=Jd(null!=i?i:c),this.hrTimeObserved=Jd(null!=n?n:c),h){var d=Od.getSpanContext(h);d&&Cd(d)&&(this.spanContext=d)}this.severityNumber=s,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.Gt=t.logRecordLimits,this.Vt=o,this.setAttributes(l)}setAttribute(t,e){return this.Zt()||null===e?this:0===t.length?(Md.warn("Invalid attribute key: "+t),this):Ld(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.Gt.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Md.warn("Dropping extra attributes."),this):(Ld(e)?this.attributes[t]=this.Yt(e):this.attributes[t]=e,this)):(Md.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}Ut(){this.zt=!0}Yt(t){var e=this.Gt.attributeValueLengthLimit;return e<=0?(Md.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.Wt(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Wt(t,e):t)):t}Wt(t,e){return t.length<=e?t:t.substring(0,e)}Zt(){return this.zt&&Md.warn("Can not execute the operation on emitted log record"),this.zt}}class uf{constructor(t,e){this.instrumentationScope=void 0,this.Xt=void 0,this.instrumentationScope=t,this.Xt=e}emit(t){var e=t.context||Rd.active(),i=new af(this.Xt,this.instrumentationScope,r({context:e},t));this.Xt.activeProcessor.onEmit(i,e),i.Ut()}}class lf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class hf{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=>yv(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 cf{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 hf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new lf}}class df{constructor(t){var e,r,i;void 0===t&&(t={}),this.Jt=void 0,this.Xt=void 0;var n,o,s,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=cv(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:Zv({"service.name":"unknown_service",[qd]:zd[qd],[Hd]:zd[Hd],[Vd]:zd[Vd]});this.Xt=new cf(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(o=null!==(s=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==s?s:void 0)&&void 0!==o?o:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.Jt=new wv(this.Kt,this)}getLogger(t,e,r){if(this.Jt.isCalled)return Md.warn("A shutdown LoggerProvider cannot provide a Logger"),bc;t||Md.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Xt.loggers.has(n)||this.Xt.loggers.set(n,new uf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Xt)),this.Xt.loggers.get(n)}forceFlush(){return this.Jt.isCalled?(Md.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Jt.promise):this.Xt.activeProcessor.forceFlush()}shutdown(){return this.Jt.isCalled?(Md.warn("shutdown may only be called once per LoggerProvider"),this.Jt.promise):this.Jt.call()}Kt(){return this.Xt.activeProcessor.shutdown()}}class vf{constructor(t,e){var r,i,n,o,s,a,u,l;this.Qt=void 0,this.te=void 0,this.ee=void 0,this.re=void 0,this.ie=void 0,this.ne=!1,this.oe=[],this.se=void 0,this.Jt=void 0,this.Qt=t,this.te=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.ee=null!==(n=null!==(o=null==e?void 0:e.maxQueueSize)&&void 0!==o?o:void 0)&&void 0!==n?n:2048,this.re=null!==(s=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==s?s:5e3,this.ie=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.Jt=new wv(this.Kt,this),this.te>this.ee&&(Md.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.te=this.ee)}onEmit(t){this.Jt.isCalled||this.ae(t)}forceFlush(){return this.Jt.isCalled?this.Jt.promise:this.ue()}shutdown(){return this.Jt.call()}Kt(){var t=this;return e((function*(){t.onShutdown(),yield t.ue(),yield t.Qt.shutdown()}))()}ae(t){this.oe.length>=this.ee||(this.oe.push(t),this.le())}ue(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.oe.length/this.te),n=0;n<i;n++)r.push(this.he());Promise.all(r).then((()=>{t()})).catch(e)}))}he(){return this.ce(),0===this.oe.length?Promise.resolve():new Promise(((t,e)=>{yv(this.At(this.oe.splice(0,this.te)),this.ie).then((()=>t())).catch(e)}))}le(){if(!this.ne){var t=()=>{this.ne=!0,this.he().then((()=>{this.ne=!1,this.oe.length>0&&(this.ce(),this.le())})).catch((t=>{this.ne=!1,jd(t)}))};if(this.oe.length>=this.te)return t();void 0===this.se&&(this.se=setTimeout((()=>t()),this.re),"number"!=typeof this.se&&this.se.unref())}}ce(){void 0!==this.se&&(clearTimeout(this.se),this.se=void 0)}At(t){var e=()=>_v.At(this.Qt,t).then((t=>{var e;t.code!==Zd.SUCCESS&&jd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(jd),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,jd)}}class ff extends vf{constructor(t,e){super(t,e),this.de=void 0,this.ve=void 0,this.fe(e)}onShutdown(){"undefined"!=typeof document&&(this.de&&document.removeEventListener("visibilitychange",this.de),this.ve&&document.removeEventListener("pagehide",this.ve))}fe(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.de=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.ve=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.de),document.addEventListener("pagehide",this.ve))}}var pf=1e4,gf=function(t,e,r,i,n){for(var o in void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=pf),t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=t[o],a=e?e+"."+o:o;if(Kr(s))gf(s,a,r,i,n);else{if(i-=1,n-=String(s).length,n-=a.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[a]=s}}return r},mf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:no.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Ac.setGlobalLoggerProvider(new df({resource:Zv(e),processors:[new ff(new sf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Ac.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:o}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:o.toString()}}var s=function(n){var o=(t,e)=>e instanceof Error?r({},e,{name:e.name,message:e.message,stack:e.stack}):e,s=no.console[n];no.console[n]=(s=>function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];if(u.length>0){var h=u.map((t=>JSON.stringify(t,o))).join(" ");h.length>pf&&(h=h.slice(0,pf)+"...",i.body_truncated="true"),e.emit({severityText:mf[n],body:h,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":no.location.href},i,Kr(u[0])?gf(u[0]):{})}),s.apply(no.console,u)}})(s)};for(var a of["debug","log","warn","error","info"])s(a)}};var yf=ho("[Error tracking]");function bf(){return new _n([new Pn,new zn,new Dn,new Ln,new Hn,new qn,new jn,new Vn],On())}class wf{constructor(t){var e,r;this.pe=[],this.ge=bf(),this._instance=t,this.pe=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(jo))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.pe=n,this._instance.persistence&&this._instance.persistence.register({[jo]:this.pe,[Zo]:o})}get me(){var t,e=!!this._instance.get_property(Zo),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.ge.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.ye(e)){if(this.be(e))return void yf.info("Skipping exception capture because a suppression rule matched");if(!this.me&&this.we(e))return void yf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._e(e))return void yf.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}be(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ei(r)&&r.length>0&&t.$exception_types.push(r),ei(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.pe.some((t=>{var r=t.values.map((t=>{var r,i=Gl[t.operator],n=Wr(t.value)?t.value:[t.value],o=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}we(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://")))}_e(t){if(t.length>0){var e,r,i,n,o=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],s=o[o.length-1];return null!==(i=null==s||null==(n=s.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ye(t){return!ni(t)&&Wr(t)}}var _f=ho("[ExceptionAutocapture]"),Cf=bf(),If={wrapOnError:t=>{var e=Gn;e||_f.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n[4],a=n[0],u=Cf.buildFromUnknown(s||a,{mechanism:{handled:!1}});return t(u),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=Gn;e||_f.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=Cf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||_f.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=i.find((t=>t instanceof Error)),a=Cf.buildFromUnknown(s||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.errorWrappingFunctions=If,no.posthogErrorWrappingFunctions=If;var Sf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Wr(t)||t.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}e!==ls&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};no.__PosthogExtensions__=no.__PosthogExtensions__||{};var kf={_patchFetch:(t,r,i)=>Mo(Gn,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return Sf(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Mo(Gn.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,u){void 0===s&&(s=!0);var l=new Request(o);return Sf(t,e,r,l),i.call(this,n,l.url,s,a,u)}))};no.__PosthogExtensions__.tracingHeadersPatchFns=kf,no.postHogTracingHeadersPatchFns=kf;var xf,Af,Tf=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ef=function(t){if("loading"===document.readyState)return"loading";var e=Tf();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},Rf=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Mf=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:Rf(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},Nf=-1,Ff=function(){return Nf},Of=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Nf=e.timeStamp,t(e))}),!0)},Pf=function(){var t=Tf();return t&&t.activationStart||0},Lf=function(t,e){var r=Tf(),i="navigate";return Ff()>=0?i="back-forward-cache":r&&(document.prerendering||Pf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Df=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},Bf=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},jf=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Zf=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},$f=function(t){var e=!1;return function(){e||(t(),e=!0)}},qf=-1,Hf=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Vf=function(t){"hidden"===document.visibilityState&&qf>-1&&(qf="visibilitychange"===t.type?t.timeStamp:0,Gf())},zf=function(){addEventListener("visibilitychange",Vf,!0),addEventListener("prerenderingchange",Vf,!0)},Gf=function(){removeEventListener("visibilitychange",Vf,!0),removeEventListener("prerenderingchange",Vf,!0)},Yf=function(){return qf<0&&(qf=Hf(),zf(),Of((function(){setTimeout((function(){qf=Hf(),zf()}),0)}))),{get firstHiddenTime(){return qf}}},Uf=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Wf=[1800,3e3],Xf=function(t,e){e=e||{},Uf((function(){var r,i=Yf(),n=Lf("FCP"),o=Df("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Pf(),0),n.entries.push(t),r(!0)))}))}));o&&(r=Bf(t,n,Wf,e.reportAllChanges),Of((function(i){n=Lf("FCP"),r=Bf(t,n,Wf,e.reportAllChanges),jf((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Jf=[.1,.25],Kf=0,Qf=1/0,tp=0,ep=function(t){t.forEach((function(t){t.interactionId&&(Qf=Math.min(Qf,t.interactionId),tp=Math.max(tp,t.interactionId),Kf=tp?(tp-Qf)/7+1:0)}))},rp=function(){return xf?Kf:performance.interactionCount||0},ip=function(){"interactionCount"in performance||xf||(xf=Df("event",ep,{type:"event",buffered:!0,durationThreshold:0}))},np=[],op=new Map,sp=0,ap=[],up=function(t){if(ap.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=np[np.length-1],r=op.get(t.interactionId);if(r||np.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};op.set(i.id,i),np.push(i)}np.sort((function(t,e){return e.latency-t.latency})),np.length>10&&np.splice(10).forEach((function(t){return op.delete(t.id)}))}}},lp=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=$f(t),"hidden"===document.visibilityState?t():(r=e(t),Zf(t)),r},hp=[200,500],cp=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Uf((function(){var r;ip();var i,n=Lf("INP"),o=function(t){lp((function(){t.forEach(up);var e=function(){var t=Math.min(np.length-1,Math.floor((rp()-sp)/50));return np[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=Df("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=Bf(t,n,hp,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Zf((function(){o(s.takeRecords()),i(!0)})),Of((function(){sp=rp(),np.length=0,op.clear(),n=Lf("INP"),i=Bf(t,n,hp,e.reportAllChanges)})))})))},dp=[],vp=[],fp=0,pp=new WeakMap,gp=new Map,mp=-1,yp=function(t){dp=dp.concat(t),bp()},bp=function(){mp<0&&(mp=lp(wp))},wp=function(){gp.size>10&&gp.forEach((function(t,e){op.has(e)||gp.delete(e)}));var t=np.map((function(t){return pp.get(t.entries[0])})),e=vp.length-50;vp=vp.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<vp.length;i++){var n=vp[i];_p(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=dp.length-1-50;dp=dp.filter((function(t,e){return t.startTime>fp&&e>o||r.has(t)})),mp=-1};ap.push((function(t){t.interactionId&&t.target&&!gp.has(t.interactionId)&&gp.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;fp=Math.max(fp,t.processingEnd);for(var i=vp.length-1;i>=0;i--){var n=vp[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},vp.push(e)),(t.interactionId||"first-input"===t.entryType)&&pp.set(t,e),bp()}));var _p=function(t,e){for(var r,i=[],n=0;r=dp[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},Cp=[2500,4e3],Ip={},Sp={onLCP:function(t,e){!function(t,e){e=e||{},Uf((function(){var r,i=Yf(),n=Lf("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Pf(),0),n.entries=[t],r())}))},s=Df("largest-contentful-paint",o);if(s){r=Bf(t,n,Cp,e.reportAllChanges);var a=$f((function(){Ip[n.id]||(o(s.takeRecords()),s.disconnect(),Ip[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return lp(a)}),{once:!0,capture:!0})})),Zf(a),Of((function(i){n=Lf("LCP"),r=Bf(t,n,Cp,e.reportAllChanges),jf((function(){n.value=performance.now()-i.timeStamp,Ip[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=Tf();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,n.startTime-i);e={element:Mf(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Xf($f((function(){var r,i=Lf("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=Df("layout-shift",s);a&&(r=Bf(t,i,Jf,e.reportAllChanges),Zf((function(){s(a.takeRecords()),r(!0)})),Of((function(){n=0,i=Lf("CLS",0),r=Bf(t,i,Jf,e.reportAllChanges),jf((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:Mf(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:Ef(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Xf((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Ef(Ff())};if(t.entries.length){var r=Tf(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:Ef(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){Af||(Af=Df("long-animation-frame",yp)),cp((function(e){var r=function(t){var e=t.entries[0],r=pp.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=_p(e.startTime,n),a=t.entries.find((function(t){return t.target})),u=a&&a.target||gp.get(e.interactionId),l=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,l),c={interactionTarget:Mf(u),interactionTargetElement:u,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(h-n,0),loadState:Ef(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(r)}),e)}};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.postHogWebVitalsCallbacks=Sp,no.postHogWebVitalsCallbacks=Sp;class kp{constructor(t){this.disabled=!1===t;var e=Kr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var xp="$copy_autocapture",Ap=ho("[AutoCapture]");function Tp(t,e){return e.length>t?e.slice(0,t)+"...":e}function Ep(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ds(e));return e}function Rp(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};Cs.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=Tp(1024,$s(t)):o.$el_text=Tp(1024,ws(t)));var s=ys(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),fo(t.attributes,(function(r){var n;if((!Fs(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Zs(r.value)&&(n=r.name,!ei(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=gs(s).join(" ")),o["attr__"+r.name]=Tp(1024,s)}}));for(var a=1,u=1,l=t;l=Ep(l);)a++,l.tagName===t.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function Mp(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!vs(h,"body");)ps(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(fo(l,(t=>{var e=Ns(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zs(f)&&f),qr(ys(t),"ph-no-capture")&&(p=!0),d.push(Rp(t,o,s,a));var r=function(t){if(!Ns(t))return{};var e={};return fo(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zs(i)&&(e[r]=i)}})),e}(t);po(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$s(t):d[0].$el_text=ws(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=xo(f))?void 0:g.host,b=null==Gn||null==(m=Gn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:po({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Hs(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class Np{constructor(t){this.Ce=!1,this.Ie=null,this.Se=!1,this.instance=t,this.rageclicks=new kp(t.config.rageclick),this.ke=null}get xe(){var t,e,r=Kr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Ae(){if(this.isBrowserSupported()){if(Gn&&Kn){var t=t=>{t=t||(null==Gn?void 0:Gn.event);try{this.Te(t)}catch(t){Ap.error("Failed to capture event",t)}};if(ko(Kn,"submit",t,{capture:!0}),ko(Kn,"change",t,{capture:!0}),ko(Kn,"click",t,{capture:!0}),this.xe.capture_copied_text){var e=t=>{t=t||(null==Gn?void 0:Gn.event),this.Te(t,xp)};ko(Kn,"copy",e,{capture:!0}),ko(Kn,"cut",e,{capture:!0})}}}else Ap.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ce&&(this.Ae(),this.Ce=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Se=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Lo]:!!t.autocapture_opt_out}),this.Ie=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.ke=t}getElementSelectors(t){var e,r=[];return null==(e=this.ke)||e.forEach((e=>{var i=null==Kn?void 0:Kn.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[Lo],i=this.Ie;if(ii(i)&&!ai(r)&&!this.instance.Ee())return!1;var n=null!==(e=this.Ie)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Te(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_s(t);if(fs(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())&&Ts(i,this.instance.config.rageclick)&&this.Te(t,"$rageclick");var n=e===xp;if(i&&Ms(i,t,this.xe,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Mp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xe.element_attribute_ignorelist,elementsChainAsString:this.Se});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===xp){var u,l=bs(null==Gn||null==(u=Gn.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;o.$selected_content=l,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Xr(null==Kn?void 0:Kn.querySelectorAll)}}var Fp={};function Op(t){return function(t,e){var r=Fp[t];if(r)return r;var i=e[t];if(Jr(i)&&!oo())return Fp[t]=i.bind(e);var n=e.document;if(n&&Xr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){lo.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Xr(i)?Fp[t]=i.bind(e):i}("MutationObserver",t)}function Pp(t,e){return oi(t)&&t>=e}class Lp{Re(t){var e,r,i,n,o,s=this.Me((null==t?void 0:t.__onCapture)||this.Ne.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(t,e){this.Fe=[],this.Me=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.Oe=t=>{var e=function(t){var e=_s(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ii(e)||this.Pe(e)||this.Fe.push(e),this.Fe.length&&ti(this.Le)&&(this.Le=no.setTimeout((()=>{this.De()}),1e3))},this.Be=()=>{var t=Date.now();t%50==0&&this.Fe.forEach((e=>{ti(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.je=()=>{this.Ze=Date.now()},this.instance=t,this.xe=this.Re(e),this._onCapture=this.xe.__onCapture}start(t){this.$e(),this.qe(),this.He(),this.Ve(t)}Ve(t){if(!this.ze){var e=Op(no);this.ze=new e((t=>{this.Ge(t)})),this.ze.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.ze)||t.disconnect(),this.ze=void 0,no.removeEventListener("click",this.Oe),no.removeEventListener("scroll",this.Be,{capture:!0}),no.removeEventListener("selectionchange",this.je)}Ge(t){this.Ye=Date.now()}$e(){ko(no,"click",this.Oe)}qe(){ko(no,"scroll",this.Be,{capture:!0})}He(){ko(no,"selectionchange",this.je)}Pe(t){if(!t)return!0;if(!this.xe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(cs(t.node))return!0;var r=this.Fe.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!vs(t.node,"html")&&ds(t.node)&&!Cs.includes(t.node.tagName.toLowerCase()))}De(){if(this.Fe.length){clearTimeout(this.Le),this.Le=void 0;var t=this.Fe;for(var e of(this.Fe=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Ye&&e.timestamp<=this.Ye?this.Ye-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ze&&e.timestamp<=this.Ze?this.Ze-e.timestamp:void 0;var i=Pp(e.scrollDelayMs,this.xe.scroll_threshold_ms),n=Pp(e.selectionChangedDelayMs,this.xe.selection_change_threshold_ms),o=Pp(e.mutationDelayMs,this.xe.mutation_threshold_ms),s=Pp(e.absoluteDelayMs,1.1*this.xe.mutation_threshold_ms),a=oi(e.scrollDelayMs)&&e.scrollDelayMs<this.xe.scroll_threshold_ms,u=oi(e.mutationDelayMs)&&e.mutationDelayMs<this.xe.mutation_threshold_ms,l=oi(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.xe.selection_change_threshold_ms;a||u||l||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Ye,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.xe.mutation_threshold_ms&&this.Fe.push(e))}this.Fe.length&&ti(this.Le)&&(this.Le=no.setTimeout((()=>{this.De()}),1e3))}}Ne(t,e){this.instance.capture("$dead_click",r({},e,Mp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lp(t,e);var Dp=ho("[ExternalScriptsLoader]"),Bp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Dp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Kn?void 0:Kn.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Kn)return r("document not found");var i=Kn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Kn.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Kn.body.appendChild(i)};null!=Kn&&Kn.body?a():null==Kn||Kn.addEventListener("DOMContentLoaded",a)};no.__PosthogExtensions__=no.__PosthogExtensions__||{},no.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);Bp(t,o,r)},no.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Bp(t,i,r)};var jp="";var Zp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function $p(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Kn),jp)return jp;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_"+Qu();!jp&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",jp=o)}return jp}(t);if(!r){var i=(t=>{var e=t.match(Zp);return e?e[0]:""})(t);i!==r&&lo.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var qp={Ue:()=>!!Kn,We:function(t){lo.error("cookieStore error: "+t)},Xe:function(t){if(Kn){try{for(var e=t+"=",r=Kn.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Je:function(t){var e;try{e=JSON.parse(qp.Xe(t))||{}}catch(t){}return e},Ke:function(t,e,r,i,n){if(Kn)try{var o="",s="",a=$p(Kn.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),o="; expires="+u.toUTCString()}n&&(s="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&lo.warn("cookieStore warning: large cookie, len="+l.length),Kn.cookie=l,l}catch(t){return}},Qe:function(t,e){if(null!=Kn&&Kn.cookie)try{qp.Ke(t,"",-1,e)}catch(t){return}}},Hp=null,Vp={Ue:function(){if(!ii(Hp))return Hp;var t=!0;if(ti(Gn))t=!1;else try{var e="__mplssupport__";Vp.Ke(e,"xyz"),'"xyz"'!==Vp.Xe(e)&&(t=!1),Vp.Qe(e)}catch(e){t=!1}return t||lo.error("localStorage unsupported; falling back to cookie store"),Hp=t,t},We:function(t){lo.error("localStorage error: "+t)},Xe:function(t){try{return null==Gn?void 0:Gn.localStorage.getItem(t)}catch(t){Vp.We(t)}return null},Je:function(t){try{return JSON.parse(Vp.Xe(t))||{}}catch(t){}return null},Ke:function(t,e){try{null==Gn||Gn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Vp.We(t)}},Qe:function(t){try{null==Gn||Gn.localStorage.removeItem(t)}catch(t){Vp.We(t)}}},zp=["$device_id","distinct_id",Go,Yo,as,ss],Gp={},Yp={Ue:function(){return!0},We:function(t){lo.error("memoryStorage error: "+t)},Xe:function(t){return Gp[t]||null},Je:function(t){return Gp[t]||null},Ke:function(t,e){Gp[t]=e},Qe:function(t){delete Gp[t]}},Up=null,Wp={Ue:function(){if(!ii(Up))return Up;if(Up=!0,ti(Gn))Up=!1;else try{var t="__support__";Wp.Ke(t,"xyz"),'"xyz"'!==Wp.Xe(t)&&(Up=!1),Wp.Qe(t)}catch(t){Up=!1}return Up},We:function(t){lo.error("sessionStorage error: ",t)},Xe:function(t){try{return null==Gn?void 0:Gn.sessionStorage.getItem(t)}catch(t){Wp.We(t)}return null},Je:function(t){try{return JSON.parse(Wp.Xe(t))||null}catch(t){}return null},Ke:function(t,e){try{null==Gn||Gn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Wp.We(t)}},Qe:function(t){try{null==Gn||Gn.sessionStorage.removeItem(t)}catch(t){Wp.We(t)}}},Xp=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Jp{constructor(t){this._instance=t}get xe(){return this._instance.config}get consent(){return this.tr()?Xp.DENIED:this.er}isOptedOut(){return"always"===this.xe.cookieless_mode||(this.consent===Xp.DENIED||this.consent===Xp.PENDING&&(this.xe.opt_out_capturing_by_default||"on_reject"===this.xe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Xp.DENIED}optInOut(t){this.rr.Ke(this.ir,t?1:0,this.xe.cookie_expiration,this.xe.cross_subdomain_cookie,this.xe.secure_cookie)}reset(){this.rr.Qe(this.ir,this.xe.cross_subdomain_cookie)}get ir(){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 er(){var t=this.rr.Xe(this.ir);return fi(t)?Xp.GRANTED:qr(pi,t)?Xp.DENIED:Xp.PENDING}get rr(){if(!this.nr){var t=this.xe.opt_out_capturing_persistence_type;this.nr="localStorage"===t?Vp:qp;var e="localStorage"===t?qp:Vp;e.Xe(this.ir)&&(this.nr.Xe(this.ir)||this.optInOut(fi(e.Xe(this.ir))),e.Qe(this.ir,this.xe.cross_subdomain_cookie))}return this.nr}tr(){return!!this.xe.respect_dnt&&!!So([null==Jn?void 0:Jn.doNotTrack,null==Jn?void 0:Jn.msDoNotTrack,no.doNotTrack],(t=>fi(t)))}}var Kp=ho("[Dead Clicks]"),Qp=()=>!0,tg=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qo)),i=t.instance.config.capture_dead_clicks;return ai(i)?i:!!Kr(i)||r};class eg{get lazyLoadedDeadClicksAutocapture(){return this.sr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qo]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.ar((()=>{this.ur()}))}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Kp.error("failed to load script",e):t()}))}ur(){var t;if(Kn){if(!this.sr&&null!=(t=no.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Kr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.sr=no.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.sr.start(Kn),Kp.info("starting...")}}else Kp.error("`document` not found. Cannot start.")}stop(){this.sr&&(this.sr.stop(),this.sr=void 0,Kp.info("stopping..."))}}var rg=ho("[ExceptionAutocapture]");class ig{constructor(t){var e,r,i;this.lr=()=>{var t;if(Gn&&this.isEnabled&&null!=(t=no.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=no.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=no.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=no.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hr&&this.xe.capture_unhandled_errors&&(this.hr=e(this.captureException.bind(this))),!this.cr&&this.xe.capture_unhandled_rejections&&(this.cr=r(this.captureException.bind(this))),!this.dr&&this.xe.capture_console_errors&&(this.dr=i(this.captureException.bind(this)))}catch(t){rg.error("failed to start",t),this.vr()}}},this._instance=t,this.pr=!(null==(e=this._instance.persistence)||!e.props[Bo]),this.gr=new mi({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,m:rg}),this.xe=this.mr(),this.startIfEnabledOrStop()}mr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kr(t)?e=r({},e,t):(ti(t)?this.pr:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.xe.capture_console_errors||this.xe.capture_unhandled_errors||this.xe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(rg.info("enabled"),this.vr(),this.ar(this.lr)):this.vr()}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return rg.error("failed to load script",e);t()}))}vr(){var t,e,r;null==(t=this.hr)||t.call(this),this.hr=void 0,null==(e=this.cr)||e.call(this),this.cr=void 0,null==(r=this.dr)||r.call(this),this.dr=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.pr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Bo]:this.pr}),this.xe=this.mr(),this.startIfEnabledOrStop()}onConfigChange(){this.xe=this.mr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.gr.consumeRateLimit(i)?rg.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class ng{constructor(t){var e;this._instance=t,this.yr=(null==Gn||null==(e=Gn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(lo.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.br&&this.br(),this.br=void 0,lo.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Gn&&Gn.history){var r=this;null!=(t=Gn.history.pushState)&&t.__posthog_wrapped__||Mo(Gn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.wr("pushState")})),null!=(e=Gn.history.replaceState)&&e.__posthog_wrapped__||Mo(Gn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.wr("replaceState")})),this._r()}}wr(t){try{var e,r=null==Gn||null==(e=Gn.location)?void 0:e.pathname;if(!r)return;r!==this.yr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.yr=r}catch(e){lo.error("Error capturing "+t+" pageview",e)}}_r(){if(!this.br){var t=()=>{this.wr("popstate")};ko(Gn,"popstate",t),this.br=()=>{Gn&&Gn.removeEventListener("popstate",t)}}}}var og=ho("[SegmentIntegration]");function sg(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()||Qu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(es,"identified")),e()},n=r.user();"then"in n&&Xr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||og.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()||(og.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(og.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var ag="posthog-js";function ug(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class lg{constructor(t,e,r,i,n,o){this.name=ag,this.setupOnce=function(s){s(ug(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var hg=null!=Gn&&Gn.location?Ro(Gn.location.hash,"__posthog")||Ro(location.hash,"state"):null,cg="_postHogToolbarParams",dg=ho("[Toolbar]"),vg=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(vg||{});class fg{constructor(t){this.instance=t}Cr(t){no.ph_toolbar_state=t}Ir(){var t;return null!==(t=no.ph_toolbar_state)&&void 0!==t?t:vg.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Gn||!Kn)return!1;t=null!=t?t:Gn.location,r=null!=r?r:Gn.history;try{if(!e){try{Gn.localStorage.setItem("test","test"),Gn.localStorage.removeItem("test")}catch(t){return!1}e=null==Gn?void 0:Gn.localStorage}var i,n=hg||Ro(t.hash,"__posthog")||Ro(t.hash,"state"),o=n?yo((()=>JSON.parse(atob(decodeURIComponent(n)))))||yo((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(cg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Sr(t){var e=no.ph_load_toolbar||no.ph_load_editor;!ni(e)&&Xr(e)?e(t,this.instance):dg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Kn||!Kn.getElementById(us));if(!Gn||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(Gn.localStorage.setItem(cg,JSON.stringify(r({},n,{source:void 0}))),this.Ir()===vg.LOADED)this.Sr(n);else if(this.Ir()===vg.UNINITIALIZED){var o;this.Cr(vg.LOADING),null==(o=no.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return dg.error("[Toolbar] Failed to load",t),void this.Cr(vg.UNINITIALIZED);this.Cr(vg.LOADED),this.Sr(n)})),ko(Gn,"turbolinks:load",(()=>{this.Cr(vg.UNINITIALIZED),this.loadToolbar(n)}))}return!0}kr(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var pg=ho("[TracingHeaders]");class gg{constructor(t){this.Ar=void 0,this.Tr=void 0,this.lr=()=>{var t,e;ti(this.Ar)&&(null==(t=no.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ti(this.Tr)&&(null==(e=no.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return pg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.ar(this.lr):(null==(t=this.Ar)||t.call(this),null==(e=this.Tr)||e.call(this),this.Ar=void 0,this.Tr=void 0)}}var mg="https?://(.*)",yg=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],bg=go(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],yg),wg="<masked>",_g=["li_fat_id"];function Cg(t,e,r){if(!Kn)return{};var i,n=e?go([],yg,r||[]):[],o=Ig(Eo(Kn.URL,n,wg),t),s=(i={},fo(_g,(function(t){var e=qp.Xe(t);i[t]=e||null})),i);return po(s,o)}function Ig(t,e){var r=bg.concat(e||[]),i={};return fo(r,(function(e){var r=To(t,e);i[e]=r||null})),i}function Sg(t){var e=function(t){return t?0===t.search(mg+"google.([^/?]*)")?"google":0===t.search(mg+"bing.com")?"bing":0===t.search(mg+"yahoo.com")?"yahoo":0===t.search(mg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ii(e)){i.$search_engine=e;var n=Kn?To(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function kg(){return navigator.language||navigator.userLanguage}function xg(){return(null==Kn?void 0:Kn.referrer)||"$direct"}function Ag(t,e){var r=t?go([],yg,e||[]):[],i=null==Qn?void 0:Qn.href.substring(0,1e3);return{r:xg().substring(0,1e3),u:i?Eo(i,r,wg):void 0}}function Tg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=xo(r))?void 0:e.host};if(i){n.$current_url=i;var o=xo(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=Ig(i);po(n,s)}if(r){var a=Sg(r);po(n,a)}return n}function Eg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Rg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Mg(t,e){if(!io)return{};var r,i=t?go([],yg,e||[]):[],[n,o]=function(t){for(var e=0;e<gn.length;e++){var[r,i]=gn[e],n=r.exec(t),o=n&&(Xr(i)?i(n,t):i);if(o)return o}return["",""]}(io);return po(wo({$os:n,$os_version:o,$browser:vn(io,navigator.vendor),$device:mn(io),$device_type:yn(io),$timezone:Eg(),$timezone_offset:Rg()}),{$current_url:Eo(null==Qn?void 0:Qn.href,i,wg),$host:null==Qn?void 0:Qn.host,$pathname:null==Qn?void 0:Qn.pathname,$raw_user_agent:io.length>1e3?io.substring(0,997)+"...":io,$browser_version:pn(io,navigator.vendor),$browser_language:kg(),$browser_language_prefix:(r=kg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Gn?void 0:Gn.screen.height,$screen_width:null==Gn?void 0:Gn.screen.width,$viewport_height:null==Gn?void 0:Gn.innerHeight,$viewport_width:null==Gn?void 0:Gn.innerWidth,$lib:"web",$lib_version:ao.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Ng=ho("[Web Vitals]"),Fg=9e5;class Og{constructor(t){var e;this.Er=!1,this.Ce=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Rr=()=>{clearTimeout(this.Mr),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ae=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ti(i))Ng.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Nr();if(!ti(n))if(ni(null==t?void 0:t.name)||ni(null==t?void 0:t.value))Ng.error("Invalid metric received",t);else if(this.Fr&&t.value>=this.Fr)Ng.error("Ignoring metric with value >= "+this.Fr,t);else this.N.url!==n&&(this.Rr(),this.Mr=setTimeout(this.Rr,this.flushToCaptureTimeoutMs)),ti(this.N.url)&&(this.N.url=n),this.N.firstMetricTimestamp=ti(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.N.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Rr()}},this.lr=()=>{var t,e,r,i,n=no.__PosthogExtensions__;ti(n)||ti(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ae.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ae.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ae.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ae.bind(this)),this.Ce=!0):Ng.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Er=!(null==(e=this._instance.persistence)||!e.props[$o]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Kr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return ti(r)?(null==(e=this._instance.persistence)?void 0:e.props[Vo])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Fr(){var t=Kr(this._instance.config.capture_performance)&&oi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Fg;return 0<t&&t<=6e4?Fg:t}get isEnabled(){var t=null==Qn?void 0:Qn.protocol;if("http:"!==t&&"https:"!==t)return Ng.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Kr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ai(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ai(e)?e:this.Er}startIfEnabled(){this.isEnabled&&!this.Ce&&(Ng.info("enabled, starting..."),this.ar(this.lr))}onRemoteConfig(t){var e=Kr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Kr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$o]:e}),this._instance.persistence.register({[Vo]:r})),this.Er=e,this.startIfEnabled()}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Ng.error("failed to load script",e):t()}))}Nr(){var t=Gn?Gn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?go([],yg,r||[]):[];return Eo(t,i,wg)}Ng.error("Could not determine current URL")}}var Pg=ho("[Heatmaps]");function Lg(t){return Kr(t)&&"clientX"in t&&"clientY"in t&&oi(t.clientX)&&oi(t.clientY)}class Dg{constructor(t){var e;this.Er=!1,this.Ce=!1,this.Or=null,this.instance=t,this.Er=!(null==(e=this.instance.persistence)||!e.props[Do]),this.rageclicks=new kp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Kr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return ti(this.instance.config.capture_heatmaps)?ti(this.instance.config.enable_heatmaps)?this.Er:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ce)return;Pg.info("starting..."),this.Pr(),this.Lr()}else{var t;clearInterval(null!==(t=this.Or)&&void 0!==t?t:void 0),this.Dr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Do]:e}),this.Er=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.N;return this.N=void 0,t}Br(t){this.Oe(t.originalEvent,"deadclick")}Lr(){this.Or&&clearInterval(this.Or),this.Or=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Kn)?setInterval(this.jr.bind(this),this.flushIntervalMilliseconds):null}Pr(){Gn&&Kn&&(this.Zr=this.jr.bind(this),ko(Gn,"beforeunload",this.Zr),this.$r=t=>this.Oe(t||(null==Gn?void 0:Gn.event)),ko(Kn,"click",this.$r,{capture:!0}),this.qr=t=>this.Hr(t||(null==Gn?void 0:Gn.event)),ko(Kn,"mousemove",this.qr,{capture:!0}),this.Vr=new eg(this.instance,Qp,this.Br.bind(this)),this.Vr.startIfEnabled(),this.zr=this.Lr.bind(this),ko(Kn,"visibilitychange",this.zr),this.Ce=!0)}Dr(){var t;Gn&&Kn&&(this.Zr&&Gn.removeEventListener("beforeunload",this.Zr),this.$r&&Kn.removeEventListener("click",this.$r,{capture:!0}),this.qr&&Kn.removeEventListener("mousemove",this.qr,{capture:!0}),this.zr&&Kn.removeEventListener("visibilitychange",this.zr),clearTimeout(this.Gr),null==(t=this.Vr)||t.stop(),this.Ce=!1)}Yr(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&ds(i)&&!vs(i,"body");){if(i===r)return!1;if(qr(e,null==Gn?void 0:Gn.getComputedStyle(i).position))return!0;i=Ss(i)}return!1}(_s(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}Oe(t,e){var i;if(void 0===e&&(e="click"),!cs(t.target)&&Lg(t)){var n=this.Yr(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Ur(r({},n,{type:"rageclick"})),this.Ur(n)}}Hr(t){!cs(t.target)&&Lg(t)&&(clearTimeout(this.Gr),this.Gr=setTimeout((()=>{this.Ur(this.Yr(t,"mousemove"))}),500))}Ur(t){if(Gn){var e=Gn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?go([],yg,i||[]):[],o=Eo(e,n,wg);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(t)}}jr(){this.N&&!Qr(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Bg{constructor(t){this.Wr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(lo.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Xr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Jr()}Jr(){var t;this.Kr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Wr)}destroy(){var t;null==(t=this.Kr)||t.call(this),this.Kr=void 0}doPageView(t,e){var r,i=this.Qr(t,e);return this.Xr={pathname:null!==(r=null==Gn?void 0:Gn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.Qr(t,null==(e=this.Xr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Xr)?void 0:t.pageViewId}}Qr(t,e){var r=this.Xr;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ti(o)||ti(s)||ti(a)||ti(u)||ti(l)||ti(h))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=o<=1?1:gi(s/o,0,1,lo),d=o<=1?1:gi(a/o,0,1,lo),v=u<=1?1:gi(l/u,0,1,lo),f=u<=1?1:gi(h/u,0,1,lo);i=po(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$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 jg=ho("[FeatureFlags]"),Zg=ho("[FeatureFlags]",{debugEnabled:!0}),$g="$active_feature_flags",qg="$override_feature_flags",Hg="$feature_flag_payloads",Vg="$override_feature_flag_payloads",zg="$feature_flag_request_id",Gg="$feature_flag_evaluated_at",Yg=t=>{var e={};for(var[r,i]of mo(t||{}))i&&(e[r]=i);return e},Ug=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]})))):jg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Wg=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Xg{constructor(t){this.ti=!1,this.ei=!1,this.ri=!1,this.ii=!1,this.ni=!1,this.oi=!1,this.si=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}ui(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ai||(jg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ai=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}li(){return this.ui().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ci({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Xo),e=this._instance.get_property(qg),i=this._instance.get_property(Vg);if(!i&&!e)return t||{};var n=po({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,u,l=n[s],h=null==e?void 0:e[s],c=ti(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ti(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[s],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[s]=f}return this.ti||(jg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ti=!0),n}getFlagVariants(){var t=this._instance.get_property(Uo),e=this._instance.get_property(qg);if(!e)return t||{};for(var r=po({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ti||(jg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ti=!0),r}getFlagPayloads(){var t=this._instance.get_property(Hg),e=this._instance.get_property(Vg);if(!e)return t||{};for(var r=po({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ti||(jg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ti=!0),r}reloadFeatureFlags(){this.ii||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.ci()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ii=t}ci(t){var e;if(this.di(),!this._instance.Ee())if(this.ri)this.ni=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Jo)||{}),group_properties:this._instance.get_property(Ko)};ii(n)||ti(n)||(o.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.li()&&(o.evaluation_contexts=this.ui());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);s&&(o.timezone=Eg()),this.ri=!0,this._instance._send_request({method:"POST",url:l,data:o,compression:this._instance.config.disable_compression?void 0:rl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i=!0;(200===t.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),i=!1),this.ri=!1,this.oi)||(this.oi=!0,this._instance.vi(null!==(r=t.json)&&void 0!==r?r:{}));if(!o.disable_flags||this.ni)if(this.si=!i,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(Wg.FeatureFlags))jg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var n;if(!o.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},i);this.ni&&(this.ni=!1,this.ci())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(zg)||void 0,o=this._instance.get_property(Gg)||void 0,s=this._instance.get_property(ts)||{};if((e.send_event||!("send_event"in e))&&(!(t in s)||!s[t].includes(i))){var a,u,l,h,c,d,v,f,p;Wr(s[t])?s[t].push(i):s[t]=[i],null==(a=this._instance.persistence)||a.register({[ts]:s});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:o,$feature_flag_bootstrapped_response:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlags)?void 0:u[t])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[t])||null,$used_bootstrap_value:!this.si};ti(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),ti(null==g?void 0:g.original_variant)&&ti(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=ti(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return r}jg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.li()&&(i.evaluation_contexts=this.ui()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:rl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ti(r)?void 0:!!r}jg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=Ug(t),a=s.flags,u=s.featureFlags,l=s.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Wr(u)){jg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[$g]:u,[Uo]:d})}else{var f=u,p=l,g=a;t.errorsWhileComputingFlags&&(f=r({},i,f),p=r({},n,p),g=r({},o,g)),e&&e.register(r({[$g]:Object.keys(Yg(f)),[Uo]:f||{},[Hg]:p||{},[Xo]:g||{}},h?{[zg]:h}:{},c?{[Gg]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.fi(e)}}override(t,e){void 0===e&&(e=!1),jg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return jg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(qg),this._instance.persistence.unregister(Vg),this.fi(),Zg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ti=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(qg),Zg.info("Flag overrides cleared");else if(r.flags){if(Wr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[qg]:i})}else this._instance.persistence.register({[qg]:r.flags});Zg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Vg),Zg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Vg]:r.payloads}),Zg.info("Payload overrides set",{payloads:r.payloads}))),void this.fi()}this.fi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:e,flagVariants:r}=this.pi();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wo)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[$g]:Object.keys(Yg(u)),[Uo]:u}),this.fi()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wo),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wo),null==(i=this._instance.persistence)||i.register({[Wo]:n}),t(n)}}})}pi(){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)),{})}}fi(t){var{flags:e,flagVariants:r}=this.pi();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Jo)||{};this._instance.register({[Jo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Jo)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Ko)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Ko]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Ko)||{};this._instance.register({[Ko]:r({},e,{[t]:{}})})}else this._instance.unregister(Ko)}reset(){this.ei=!1,this.ri=!1,this.ii=!1,this.ni=!1,this.oi=!1,this.si=!1,this.$anon_distinct_id=void 0,this.di(),this.ti=!1}}var Jg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Kg{constructor(t,e){this.xe=t,this.props={},this.gi=!1,this.mi=(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.rr=this.yi(t),this.load(),t.debug&&lo.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.bi}yi(t){-1===Jg.indexOf(t.persistence.toLowerCase())&&(lo.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...zp,...t];return r({},Vp,{Je:function(t){try{var e={};try{e=qp.Je(t)||{}}catch(t){}var r=po(e,JSON.parse(Vp.Xe(t)||"{}"));return Vp.Ke(t,r),r}catch(t){}return null},Ke:function(t,r,i,n,o,s){try{Vp.Ke(t,r,void 0,void 0,s);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&qp.Ke(t,a,i,n,o,s)}catch(t){Vp.We(t)}},Qe:function(t,e){try{null==Gn||Gn.localStorage.removeItem(t),qp.Qe(t,e)}catch(t){Vp.We(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Vp.Ue()?Vp:"localstorage+cookie"===i&&e.Ue()?e:"sessionstorage"===i&&Wp.Ue()?Wp:"memory"===i?Yp:"cookie"===i?qp:e.Ue()?e:qp}properties(){var t={};return fo(this.props,(function(e,r){if(r===Uo&&Kr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ii(o=hs)?a:Xn&&o.indexOf===Xn?-1!=o.indexOf(s):(fo(o,(function(t){if(a||(a=t===s))return co})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.bi){var t=this.rr.Je(this.mi);t&&(this.props=po({},t))}}save(){this.bi||this.rr.Ke(this.mi,this.props,this.wi,this.Ci,this.Ii,this.xe.debug)}remove(){this.rr.Qe(this.mi,!1),this.rr.Qe(this.mi,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Kr(t)){ti(e)&&(e="None"),this.wi=ti(r)?this.Si:r;var i=!1;if(fo(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Kr(t)){this.wi=ti(e)?this.Si:e;var r=!1;if(fo(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.gi){var t=Cg(this.xe.custom_campaign_params,this.xe.mask_personal_data_properties,this.xe.custom_personal_data_properties);Qr(wo(t))||this.register(t),this.gi=!0}}update_search_keyword(){var t;this.register((t=null==Kn?void 0:Kn.referrer)?Sg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:xg(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(t=xo(Kn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ns]||this.props[os]||this.register_once({[ss]:Ag(this.xe.mask_personal_data_properties,this.xe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};fo([os,ns],(e=>{var r=this.props[e];r&&fo(r,(function(e,r){t["$initial_"+Vr(r)]=e}))}));var e,r,i=this.props[ss];if(i){var n=(e=Tg(i),r={},fo(e,(function(t,e){r["$initial_"+Vr(e)]=t})),r);po(t,n)}return t}safe_merge(t){return fo(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Si=this.wi=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.yi(t),n=this.props;this.clear(),this.rr=i,this.props=n,this.save()}}set_disabled(t){this.bi=t,this.bi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ci&&(this.Ci=t,this.remove(),this.save())}set_secure(t){t!==this.Ii&&(this.Ii=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Po]||{};r[t]=e,this.props[Po]=r,this.save()}remove_event_timer(t){var e=(this.props[Po]||{})[t];return ti(e)||(delete this.props[Po][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Qg=ho("[Product Tours]"),tm="ph_product_tours";class em{constructor(t){this.ki=null,this.xi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Ho]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.ki||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Ho))||this.ar((()=>this.Ai()))}ar(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Qg.error("Could not load product tours script",e):t()}))}Ai(){var t;!this.ki&&null!=(t=no.__PosthogExtensions__)&&t.generateProductTours&&(this.ki=no.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wr(this.xi)||e){var r=this._instance.persistence;if(r){var i=r.props[tm];if(Wr(i)&&!e)return this.xi=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 Qg.error(n),void t([],{isLoaded:!1,error:n})}var o=Wr(e.json.product_tours)?e.json.product_tours:[];this.xi=o,r&&r.register({[tm]:o}),t(o,{isLoaded:!0})}})}else t(this.xi,{isLoaded:!0})}getActiveProductTours(t){ni(this.ki)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ki.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ki)||e.showTourById(t)}previewTour(t){this.ki?this.ki.previewTour(t):this.ar((()=>{var e;this.Ai(),null==(e=this.ki)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ki)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ki)||t.nextStep()}previousStep(){var t;null==(t=this.ki)||t.previousStep()}clearCache(){var t;this.xi=null,null==(t=this._instance.persistence)||t.unregister(tm)}resetTour(t){var e;null==(e=this.ki)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ki)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ki)||e.cancelPendingTour(t)}}class rm{constructor(){this.Ti={},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)}}function im(t,e,r){if(ni(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class nm{constructor(t){this.Ei=new rm,this.Ri=(t,e)=>this.Mi(t,e)&&this.Ni(t,e)&&this.Fi(t,e)&&this.Oi(t,e),this.Mi=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Pi=new Set,this.Li=new Set}init(){var t;if(!ti(null==(t=this._instance)?void 0:t.Di)){var e;null==(e=this._instance)||e.Di(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ti(null==(e=this._instance)?void 0:e.Di)&&(t.forEach((t=>{var e,r;null==(e=this.Li)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Pi)||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.Pi.has(t)||this.Pi.has(null==e?void 0:e.event))&&this.Li&&(null==(r=this.Li)?void 0:r.size)>0&&this.Li.forEach((t=>{this.Bi(e,t)&&this.Ei.emit("actionCaptured",t.name)}))}ji(t){this.onAction("actionCaptured",(e=>t(e)))}Bi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Ri(t,r))return!0;return!1}onAction(t,e){return this.Ei.on(t,e)}Ni(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(!im(i,e.url,e.url_matching||"contains"))return!1}return!0}Fi(t,e){return!!this.Zi(t,e)&&(!!this.$i(t,e)&&!!this.qi(t,e))}Zi(t,e){var r;if(null==e||!e.href)return!0;var i=this.Hi(t);if(i.length>0)return i.some((t=>im(t.href,e.href,e.href_matching||"exact")));var n,o=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!o&&im((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}$i(t,e){var r;if(null==e||!e.text)return!0;var i=this.Hi(t);if(i.length>0)return i.some((t=>im(t.text,e.text,e.text_matching||"exact")||im(t.$el_text,e.text,e.text_matching||"exact")));var n,o,s,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!ni(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),o=e.text,s=e.text_matching||"exact",n.some((t=>im(t,o,s))))}qi(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch(t){return!1}return!1}Hi(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Oi(t,e){return null==e||!e.properties||0===e.properties.length||Ul(e.properties.reduce(((t,e)=>{var r=Wr(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 om{constructor(t){this._instance=t,this.Vi=new Map,this.zi=new Map,this.Gi=new Map}Yi(t,e){return!!t&&Ul(t.propertyFilters,null==e?void 0:e.properties)}Ui(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}Wi(t,e,r){var i=(r===Su.Activation?this.Vi:this.zi).get(t),n=[];return this.Xi((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Yi(o,e)}))}register(t){var e;ti(null==(e=this._instance)?void 0:e.Di)||(this.Ji(t),this.Ki(t))}Ki(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Qi){this.Qi=new nm(this._instance),this.Qi.init();this.Qi.ji((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Qi)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.Gi.get(e.name);r&&r.push(t.id),this.Gi.set(e.name,r||[t.id])}})))}))}}Ji(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e.Di(((t,e)=>{this.onEvent(t,e)})),this.Vi=this.Ui(t,Su.Activation),this.zi=this.Ui(t,Su.Cancellation)}}onEvent(t,e){var r,i=this.et(),n=this.tn(),o=this.en(),s=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(o===t&&e&&s.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:s});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=s.indexOf(l);h>=0&&(s.splice(h,1),this.rn(s))}}else{if(this.zi.has(t)){var c=this.Wi(t,e,Su.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=s.indexOf(t.id);e>=0&&s.splice(e,1),this.nn(t.id)})),this.rn(s))}if(this.Vi.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Vi.get(t)});var d=this.Wi(t,e,Su.Activation);this.rn(s.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.Gi.has(t)&&this.rn(i.concat(this.Gi.get(t)||[]))}rn(t){var e,r=this.et(),i=this.tn(),n=[...new Set(t)].filter((t=>!this.sn(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(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Vi}an(){return this.Qi}}class sm extends om{constructor(t){super(t)}tn(){return"$surveys_activated"}en(){return Nu.SHOWN}Xi(t){var e;null==(e=this._instance)||e.getSurveys(t)}nn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}et(){return Pu}sn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class am{constructor(t){this.un=void 0,this._surveyManager=null,this.ln=!1,this.hn=[],this.cn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ni(e))return Pu.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.un=r?e.length>0:e,Pu.info("flags response received, isSurveysEnabled: "+this.un),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(ju)||null!=r&&r.startsWith(Zu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.ln)Pu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Pu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Pu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==no?void 0:no.__PosthogExtensions__;if(t){if(!ti(this.un)||this._instance.config.advanced_enable_surveys){var e=this.un||this._instance.config.advanced_enable_surveys;this.ln=!0;try{var r=t.generateSurveys;if(r)return void this.dn(r,e);var i=t.loadExternalDependency;if(!i)return void this.vn("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.vn("Could not load surveys script",r):this.dn(t.generateSurveys,e)}))}catch(t){throw this.vn("Error initializing surveys",t),t}finally{this.ln=!1}}}else Pu.error("PostHog Extensions not found.")}}dn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new sm(this._instance),Pu.info("Surveys loaded successfully"),this.fn({isLoaded:!0})}vn(t,e){Pu.error(t,e),this.fn({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.hn.push(t),this._surveyManager&&this.fn({isLoaded:!0}),()=>{this.hn=this.hn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Pu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(Qo);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.cn?this.cn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.cn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.cn=null;var n=e.statusCode;if(200!==n||!e.json){var o="Surveys API could not be loaded, status: "+n;Pu.error(o);var s={isLoaded:!1,error:o};return t([],s),void(null==r||r({surveys:[],context:s}))}var a,u=e.json.surveys||[],l=u.filter((t=>Lu(t)&&(Du(t)||Bu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[Qo]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}fn(t){for(var e of this.hn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Pu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Pu.warn("init was not called")}pn(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}gn(t){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.pn(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ni(this._surveyManager))return Pu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.gn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ni(this._surveyManager)?(Pu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.gn(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(ni(this._surveyManager))Pu.warn("init was not called");else{var n="string"==typeof t?this.pn(t):t;if(null!=n&&n.id)if(zu.includes(n.type)){var o=null==Kn?void 0:Kn.querySelector(e);if(o)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Pu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Pu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,o,r),Pu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o,r);Pu.warn("Survey element not found")}else Pu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Pu.warn("Survey not found")}}displaySurvey(t,e){var i;if(ni(this._surveyManager))Pu.warn("init was not called");else{var n=this.pn(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void Pu.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Ou.Inline?this._surveyManager.handlePopoverSurvey(o,e.properties):this.renderSurvey(o,e.selector,e.properties)}else Pu.warn("Survey not found")}}cancelPendingSurvey(t){ni(this._surveyManager)?Pu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var um=ho("[Conversations]");class lm{constructor(t){this.mn=void 0,this._conversationsManager=null,this.yn=!1,this.bn=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;ni(e)||(ai(e)?this.mn=e:(this.mn=e.enabled,this.bn=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.mn=void 0,this.bn=null}loadIfEnabled(){if(!this._conversationsManager&&!this.yn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==no?void 0:no.__PosthogExtensions__;if(t&&!ti(this.mn)&&this.mn)if(this.bn&&this.bn.token){this.yn=!0;try{var e=t.initConversations;if(e)return this.wn(e),void(this.yn=!1);var r=t.loadExternalDependency;if(!r)return void this._n("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this._n("Could not load conversations script",e):this.wn(t.initConversations),this.yn=!1}))}catch(t){this._n("Error initializing conversations",t),this.yn=!1}}else um.error("Conversations enabled but missing token in remote config.")}}wn(t){if(this.bn)try{this._conversationsManager=t(this.bn,this._instance),um.info("Conversations loaded successfully")}catch(t){this._n("Error completing conversations initialization",t)}else um.error("Cannot complete initialization: remote config is null")}_n(t,e){um.error(t,e),this._conversationsManager=null,this.yn=!1}show(){this._conversationsManager?this._conversationsManager.show():um.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.mn&&!ii(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(um.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(um.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(um.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(um.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class hm{constructor(t){var e;this.Cn=!1,this.In=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Cn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!ni(r)&&r&&(this.Cn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Cn&&!this.In){var t=ho("[logs]"),e=null==no?void 0:no.__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.In=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var cm=ho("[RateLimiter]");class dm{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=>{cm.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void cm.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:o}=this,s=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(is))&&void 0!==e?e:{tokens:n,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>n&&(a.tokens=n);var u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(is,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var vm=ho("[RemoteConfig]");class fm{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=no._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Sn(t){var e,r;null!=(e=no.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(vm.error("PostHog Extensions not found. Cannot load remote config."),t())}kn(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 vm.info("Using preloaded remote config",this.remoteConfig),void this.vi(this.remoteConfig);if(this._instance.Ee())return void vm.warn("Remote config is disabled. Falling back to local config.");this.Sn((t=>{if(!t)return vm.info("No config found after loading remote JS config. Falling back to JSON."),void this.kn((t=>{this.vi(t)}));this.vi(t)}))}catch(t){vm.error("Error loading remote config",t)}}vi(t){t?this._instance.config.__preview_remote_config?(this._instance.vi(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):vm.info("__preview_remote_config is disabled. Logging config instead",t):vm.error("Failed to fetch remote config from PostHog.")}}var pm=3e3;class gm{constructor(t,e){this.xn=!0,this.An=[],this.Tn=gi((null==e?void 0:e.flush_interval_ms)||pm,250,5e3,lo.createLogger("flush interval"),pm),this.En=t}enqueue(t){this.An.push(t),this.Rn||this.Mn()}unload(){this.Nn();var t=this.An.length>0?this.Fn():{},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.En(r({},t,{transport:"sendBeacon"}))}))}enable(){this.xn=!1,this.Mn()}Mn(){var t=this;this.xn||(this.Rn=setTimeout((()=>{if(this.Nn(),this.An.length>0){var e=this.Fn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&fo(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.En(r)};for(var i in e)r()}}),this.Tn))}Nn(){clearTimeout(this.Rn),this.Rn=void 0}Fn(){var t={};return fo(this.An,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;ti(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.An=[],t}}var mm=["retriesPerformedSoFar"];class ym{constructor(t){this.On=!1,this.Pn=3e3,this.An=[],this._instance=t,this.An=[],this.Ln=!0,!ti(Gn)&&"onLine"in Gn.navigator&&(this.Ln=Gn.navigator.onLine,this.Dn=()=>{this.Ln=!0,this.jr()},this.Bn=()=>{this.Ln=!1},ko(Gn,"online",this.Dn),ko(Gn,"offline",this.Bn))}get length(){return this.An.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,mm);si(e)&&(n.url=Zl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.jn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}jn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.An.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),lo.warn(n),this.On||(this.On=!0,this.Zn())}Zn(){if(this.$n&&clearTimeout(this.$n),0===this.An.length)return this.On=!1,void(this.$n=void 0);this.$n=setTimeout((()=>{this.Ln&&this.An.length>0&&this.jr(),this.Zn()}),this.Pn)}jr(){var t=Date.now(),e=[],r=this.An.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.An=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.$n&&(clearTimeout(this.$n),this.$n=void 0),this.On=!1,ti(Gn)||(this.Dn&&(Gn.removeEventListener("online",this.Dn),this.Dn=void 0),this.Bn&&(Gn.removeEventListener("offline",this.Bn),this.Bn=void 0)),this.An))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){lo.error(t)}this.An=[]}}class bm{constructor(t){this.qn=()=>{var t,e,r,i;this.Hn||(this.Hn={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),u=(null==n?void 0:n.scrollHeight)||0;this.Hn.lastScrollY=Math.ceil(o),this.Hn.maxScrollY=Math.max(o,null!==(t=this.Hn.maxScrollY)&&void 0!==t?t:0),this.Hn.maxScrollHeight=Math.max(s,null!==(e=this.Hn.maxScrollHeight)&&void 0!==e?e:0),this.Hn.lastContentY=a,this.Hn.maxContentY=Math.max(a,null!==(r=this.Hn.maxContentY)&&void 0!==r?r:0),this.Hn.maxContentHeight=Math.max(u,null!==(i=this.Hn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Hn}resetContext(){var t=this.Hn;return setTimeout(this.qn,0),t}startMeasuringScrollPosition(){ko(Gn,"scroll",this.qn,{capture:!0}),ko(Gn,"scrollend",this.qn,{capture:!0}),ko(Gn,"resize",this.qn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Gn?void 0:Gn.document.documentElement;var t=Wr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Gn?void 0:Gn.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Gn&&(Gn.scrollY||Gn.pageYOffset||Gn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Gn&&(Gn.scrollX||Gn.pageXOffset||Gn.document.documentElement.scrollLeft)||0}}var wm=t=>Ag(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class _m{constructor(t,e,r,i){this.Vn=t=>{var e=this.zn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Gn(this._instance)};this.Yn.register({[rs]:r})}},this._instance=t,this.Un=e,this.Yn=r,this.Gn=i||wm,this.Un.onSessionId(this.Vn)}zn(){return this.Yn.props[rs]}getSetOnceProps(){var t,e=null==(t=this.zn())?void 0:t.props;return e?"r"in e?Tg(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 fo(wo(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Vr(r)]=e})),t}}var Cm=ho("[SessionId]");class Im{on(t,e){return this.Wn.on(t,e)}constructor(t,e,r){var i;if(this.Xn=[],this.Jn=void 0,this.Wn=new rm,this.Kn=(t,e)=>!(!si(t)||!si(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.xe=t.config,this.Yn=t.persistence,this.Qn=void 0,this.eo=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ro=e||Qu,this.io=r||Qu;var n=this.xe.persistence_name||this.xe.token,o=this.xe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gi(o,60,36e3,Cm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.oo="ph_"+n+"_window_id",this.so="ph_"+n+"_primary_window_exists",this.ao()){var s=Wp.Je(this.oo),a=Wp.Je(this.so);s&&!a?this.Qn=s:Wp.Qe(this.oo),Wp.Ke(this.so,!0)}if(null!=(i=this.xe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.xe.bootstrap.sessionID);this.uo(this.xe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){Cm.error("Invalid sessionID in bootstrap",t)}this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ti(this.Xn)&&(this.Xn=[]),this.Xn.push(t),this.eo&&t(this.eo,this.Qn),()=>{this.Xn=this.Xn.filter((e=>e!==t))}}ao(){return"memory"!==this.xe.persistence&&!this.Yn.bi&&Wp.Ue()}ho(t){t!==this.Qn&&(this.Qn=t,this.ao()&&Wp.Ke(this.oo,t))}co(){return this.Qn?this.Qn:this.ao()?Wp.Je(this.oo):null}uo(t,e,r){t===this.eo&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.eo=t,this.Yn.register({[Go]:[e,t,r]}))}do(){var t=this.Yn.props[Go];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.uo(null,null,null)}destroy(){clearTimeout(this.vo),this.vo=void 0,this.Jn&&Gn&&(Gn.removeEventListener("beforeunload",this.Jn,{capture:!1}),this.Jn=void 0),this.Xn=[]}lo(){this.Jn=()=>{this.ao()&&Wp.Qe(this.so)},ko(Gn,"beforeunload",this.Jn,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.xe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.do(),s=this.co(),a=si(o)&&Math.abs(r-o)>864e5,u=!1,l=!n,h=!l&&!t&&this.Kn(r,i);l||h||a?(n=this.ro(),s=this.io(),Cm.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,u=!0):s||(s=this.io(),u=!0);var c=!!si(i)&&t&&!a?i:r,d=!si(o)?(new Date).getTime():o;return this.ho(s),this.uo(n,c,d),t||this.no(),u&&this.Xn.forEach((t=>t(n,s,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}no(){clearTimeout(this.vo),this.vo=setTimeout((()=>{var[t]=this.do();if(this.Kn((new Date).getTime(),t)){var e=this.eo;this.resetSessionId(),this.Wn.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var Sm=["$set_once","$set"],km=ho("[SiteApps]");class xm{constructor(t){this._instance=t,this.fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}po(t,e){if(e){var r=this.globalsForEvent(e);this.fo.push(r),this.fo.length>1e3&&(this.fo=this.fo.slice(10))}}get siteAppLoaders(){var t;return null==(t=no._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Di(this.po.bind(this));this.mo=()=>{t(),this.fo=[],this.mo=void 0}}}globalsForEvent(t){var e,n,o,s,a,u,l;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,Sm),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.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.fo.length&&(km.info("Processing "+this.fo.length+" events for site app with id "+t.id),this.fo.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.mo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,km.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){km.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){km.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}yo(){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)}bo(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){km.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.yo(),void this._instance.on("eventCaptured",(t=>this.bo(t)))):void km.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.mo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;no["__$$ph_site_app_"+t]=n._instance,null==(e=no.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return km.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else km.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Am=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Zr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Zr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Tm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),Em="i.posthog.com";class Rm{constructor(t){this.wo={},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("."+Em,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.wo[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.wo[this.apiHost]=Tm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.wo[this.apiHost]=Tm.EU:this.wo[this.apiHost]=Tm.CUSTOM),this.wo[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===Tm.CUSTOM)return this.apiHost+e;var r=Em+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Mm={icontains:(t,e)=>!!Gn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Gn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Gn&&Vl(e.href,t),not_regex:(t,e)=>!!Gn&&!Vl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Nm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Nm._o("retrieved web experiments from the server"),e.Co=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Co)Nm._o("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Co)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ei(i)&&t.variants[i]&&e.Io(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];Nm.So(o)&&e.Io(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Nm._o("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this.Co))return this.Co=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Nm._o("applying feature flags",t),t.forEach((t=>{var e;if(this.Co&&null!=(e=this.Co)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Co)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Io(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Nm.getWindowLocation();if(null!=t&&t.search){var e=To(null==t?void 0:t.search,"__experiment_id"),r=To(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Nm._o("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ko(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}ko(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Nm._o("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Io(i[0].name,e,i[0].variants[e].transforms))}static So(t){return!ni(t.conditions)&&(Nm.xo(t)&&Nm.Ao(t))}static xo(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=Nm.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||Mm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Gn?void 0:Gn.location}static Ao(t){var e;if(ni(t.conditions)||ni(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Cg();if(r.utm_source){var i,n,o,s,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.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 _o(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];lo.info("[WebExperiments] "+t,r)}Io(t,e,r){this._is_bot()?Nm._o("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Nm._o("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)}))}})):Nm._o("Control variants leave the page unmodified.")}_is_bot(){return Jn&&this._instance?Am(Jn,this._instance.config.custom_blocked_useragents):void 0}}var Fm=ho("[PostHog ExternalIntegrations]"),Om={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Pm{constructor(t){this._instance=t}ar(t,e){var r;null==(r=no.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Fm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=no.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.ar(Om[e],(()=>{var r;null==(r=no.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=no.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=no.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var Lm="[SessionRecording]",Dm=ho(Lm);class Bm{get started(){var t;return!(null==(t=this.To)||!t.isStarted)}get status(){return this.To?this.To.status:this.Eo&&!this.Ro?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Eo=!1,this.Mo=void 0,this._instance=t,!this._instance.sessionManager)throw Dm.error("started without valid sessionManager"),new Error(Lm+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Lm+' cannot be used with cookieless_mode="always"')}get Ro(){var t,e=!(null==(t=this._instance.get_property(zo))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Gn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Ro||null==(e=this.To)||!e.isStarted){var r=!ti(Object.assign)&&!ti(Array.from);this.Ro&&r?(this.No(t),Dm.info("starting")):this.stopRecording()}}No(t){var e,r,i;this.Ro&&(null!=no&&null!=(e=no.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=no.__PosthogExtensions__)&&r.initSessionRecording?this.Fo(t):null==(i=no.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Oo,(e=>{if(e)return Dm.error("could not load recorder",e);this.Fo(t)})))}stopRecording(){var t,e;null==(t=this.Mo)||t.call(this),this.Mo=void 0,null==(e=this.To)||e.stop()}Po(){var t;null==(t=this._instance.persistence)||t.unregister(Yo)}Lo(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ni(i)?null:parseFloat(i);ni(o)&&this.Po();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[zo]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ti(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.Mo)||e.call(this),this.Mo=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Lo(t),this.Eo=!0,this.startIfEnabledOrStop()):this.Eo=!0:Dm.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.To)&&r.log?this.To.log(t,e):Dm.warn("log called before recorder was ready")}get Oo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(zo);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Fo(t){var e,r;if(null==(e=no.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.To||(this.To=null==(r=no.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.To._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.To.start(t)}onRRwebEmit(t){var e;null==(e=this.To)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.To||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.To)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.To||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.To)||t.overrideSampling()}overrideTrigger(t){var e,r;this.To||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.To)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.To)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.To)||!r.tryAddCustomEvent(t,e))}}var jm={},Zm=()=>{},$m="posthog",qm=!Bl&&-1===(null==io?void 0:io.indexOf("MSIE"))&&-1===(null==io?void 0:io.indexOf("Mozilla")),Hm=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Io(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Zm,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:Qn&&ei(null==Qn?void 0:Qn.search)&&-1!==Qn.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Gn||null==(e=Gn.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;lo.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:pm},error_tracking:{},_onCapture:Zm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Vm=t=>{var e={};ti(t.process_person)||(e.person_profiles=t.process_person),ti(t.xhr_headers)||(e.request_headers=t.xhr_headers),ti(t.cookie_name)||(e.persistence_name=t.cookie_name),ti(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ti(t.store_google)||(e.save_campaign_params=t.store_google),ti(t.verbose)||(e.debug=t.verbose);var r=po({},e,t);return Wr(t.property_blacklist)&&(ti(t.property_denylist)?r.property_denylist=t.property_blacklist:Wr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:lo.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class zm{constructor(){this.__forceAllowLocalhost=!1}get Do(){return this.__forceAllowLocalhost}set Do(t){lo.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Gm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new zm,this.Bo=!1,this.version=ao.LIB_VERSION,this.jo=new rm,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Hm(),this.SentryIntegration=lg,this.sentryIntegration=t=>function(t,e){var r=ug(t,e);return{name:ag,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Zo=!1,this.$o=null,this.qo=null,this.Ho=null,this.featureFlags=new Xg(this),this.toolbar=new fg(this),this.scrollManager=new bm(this),this.pageViewManager=new Bg(this),this.surveys=new am(this),this.conversations=new lm(this),this.logs=new hm(this),this.experiments=new Nm(this),this.exceptions=new wf(this),this.rateLimiter=new dm(this),this.requestRouter=new Rm(this),this.consent=new Jp(this),this.externalIntegrations=new Pm(this),this.people={set:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ei(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>lo.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==$m){var i,n=null!==(i=jm[r])&&void 0!==i?i:new Gm;return n._init(t,e,r),jm[r]=n,jm[$m][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ti(t)||ri(t))return lo.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.Vo(e.debug),this.zo=e,this.Go=[],e.person_profiles&&(this.qo=e.person_profiles),this.set_config(po({},Hm(e.defaults),Vm(e),{name:i,token:t})),this.config.on_xhr_error&&lo.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:rl.GZipJS;var o=this.Yo();this.persistence=new Kg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Kg(r({},this.config,{persistence:"sessionStorage"}),o);var s=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Uo=new gm((t=>this.Wo(t)),this.config.request_queue_config),this.Xo=new ym(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new Im(this),this.sessionPropsManager=new _m(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(lo.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Jo(u)}),0)):(lo.info("Initializing extensions synchronously"),this.Jo(u)),ao.DEBUG=ao.DEBUG||this.config.debug,ao.DEBUG&&lo.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(Qu()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(es,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.Ko()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:ls,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Qu());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(es,"anonymous")}return ko(Gn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?sg(this,(()=>this.Qo())):this.Qo(),Xr(this.config._onCapture)&&this.config._onCapture!==Zm&&(lo.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&lo.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Jo(t){var e=performance.now();this.historyAutocapture=new ng(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new gg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new xm(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Bm(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Np(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new em(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Dg(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Og(this)})),r.push((()=>{this.exceptionObserver=new ig(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new eg(this,tg),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.ts){var t=this.ts;this.ts=void 0,this.vi(t)}})),this.es(r,e)}es(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.es(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){lo.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&lo.info("PostHog extensions initialized ("+i+"ms)")}vi(t){var e,r,i,n,o,s,a,u,l;if(!Kn||!Kn.body)return lo.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.vi(t)}),500);this.config.__preview_deferred_init_extensions&&(this.ts=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=qr(t.supportedCompression,rl.GZipJS)?rl.GZipJS:qr(t.supportedCompression,rl.Base64)?rl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.qo?this.qo:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(s=this.productTours)||s.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}Qo(){try{this.config.loaded(this)}catch(t){lo.critical("`loaded` function failed",t)}this.rs(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.ns()}),1),new fm(this).load(),this.featureFlags.flags()}rs(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Uo)||t.enable()))}_dom_loaded(){this.is_capturing()&&vo(this.__request_queue,(t=>this.Wo(t))),this.__request_queue=[],this.rs()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.os()&&this.capture("$pageleave"),null==(t=this.Uo)||t.unload(),null==(e=this.Xo)||e.unload()):this.os()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(qm?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Zl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=Zl(o.url,{_:(new Date).getTime().toString(),ver:ao.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Hl.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),u=null!==(i=null==(n=So(a,(t=>t.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(o)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}Wo(t){this.Xo?this.Xo.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];vo(t,(t=>{t&&(e=t[0],Wr(e)?n.push(t):Xr(t)?t.call(this):Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&Xr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){vo(t,(function(t){if(Wr(t[0])){var r=e;fo(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}Ko(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Uo){if(this.is_capturing())if(!ti(t)&&ei(t)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=e&&e.$current_url&&!ei(null==e?void 0:e.$current_url)&&(lo.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(null==i?void 0:i.timestamp)||a,l=Qu(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.ss(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=_o(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ti(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Nu.DISMISSED||t===Nu.SENT){var v=null==e?void 0:e[Fu.SURVEY_ID],f=null==e?void 0:e[Fu.SURVEY_ITERATION];Vu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[$u({id:v,current_iteration:f},t===Nu.SENT?"responded":"dismissed")]:!0})}else t===Nu.SHOWN&&(h.$set=r({},h.$set,{[Fu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(Qr(p)||this.setPersonPropertiesForFlags(p),!ni(this.config.before_send)){var g=this.us(h);if(!g)return;h=g}this.jo.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Wo(m):this.Uo.enqueue(m),h}lo.critical("This capture call is ignored due to client rate limiting.")}}else lo.error("No event name provided to posthog.capture")}else lo.uninitializedWarning("posthog.capture")}Di(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ei(a.distinct_id)&&!oi(a.distinct_id)||ri(a.distinct_id))&&lo.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=Mg(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&po(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&po(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Xo)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Tm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=po(a,l),"$pageview"===t&&Kn&&(a.title=Kn.title),!ti(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}io&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=po({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?fo(this.config.property_denylist,(function(t){delete a[t]})):lo.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.ls();return a.$process_person_profile=g,g&&!o&&this.hs("_calculate_event_properties"),a}ss(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.ls())return t;if(this.Bo)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=po({},i,n||{},t||{}),s=this.config.sanitize_properties;return s&&(lo.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),e&&(this.Bo=!0),Qr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}cs(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},o=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=r({},n,t),a=r({},o,e),u={};for(var[l,h]of Object.entries(s)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ti(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.jo.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Gu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return lo.uninitializedWarning("posthog.identify");if(oi(t)&&(t=t.toString(),lo.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))lo.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ls){if(this.hs("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Oo)&&(this.unregister(Oo),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(es)||"anonymous");t!==n&&s?(this.persistence.set_property(es,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Ho=zl(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(ts))}}else lo.critical('The string "'+ls+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else lo.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.hs("posthog.setPersonProperties")){var i=zl(this.get_distinct_id(),t,e);this.Ho!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ho=i):lo.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else lo.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.hs("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(lo.info("reset"),!this.__loaded)return lo.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(es,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Ho=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ls,$device_id:null},"");else{var s=this.config.get_device_id(Qu());this.register_once({distinct_id:s,$device_id:t?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(t,e){return t===this.get_property(Fo)?(lo.critical("Attempting to create alias for existing People user - aborting."),-2):this.hs("posthog.alias")?(ti(e)&&(e=this.get_distinct_id()),t!==e?(this.cs(Oo,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(lo.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Kr(t)){var i,n,o,s,a,u,l;po(this.config,Vm(t));var h=this.Yo();null==(i=this.persistence)||i.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Kg(r({},this.config,{persistence:"sessionStorage"}),h);var c=this.Vo(this.config.debug);ai(c)&&(this.config.debug=c),ai(this.config.debug)&&(this.config.debug?(ao.DEBUG=!0,Vp.Ue()&&Vp.Ke("ph_debug","true"),lo.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ao.DEBUG=!1,Vp.Ue()&&Vp.Qe("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.ds(),null==(l=this.externalIntegrations)||l.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:$m;return e!==$m&&(e=$m+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(es))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(es))}ls(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Oo])&&(null==(e=this.persistence)||null==(e=e.props)||!e[as]))}os(){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.ls()||this.hs("posthog.createPersonProfile")&&this.setPersonProperties({},{})}hs(t){return"never"===this.config.person_profiles?(lo.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.cs(as,!0),!0)}Yo(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}ds(){var t,e,r,i,n=this.Yo();(null==(t=this.persistence)?void 0:t.bi)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.bi)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Im(this),this.pageViewManager=new Bg(this),this.persistence&&(this.sessionPropsManager=new _m(this,this.sessionManager,this.persistence)),this.sessionRecording=new Bm(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.ds(),this.rs(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.ns()}else lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ds(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ls,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.ns())):lo.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Xp.GRANTED?"granted":t===Xp.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ds()}_is_bot(){return Jn?Am(Jn,this.config.custom_blocked_useragents):void 0}ns(){Kn&&("visible"===Kn.visibilityState?this.Zo||(this.Zo=!0,this.capture("$pageview",{title:Kn.title},{send_instantly:!0}),this.$o&&(Kn.removeEventListener("visibilitychange",this.$o),this.$o=null)):this.$o||(this.$o=this.ns.bind(this),ko(Kn,"visibilitychange",this.$o)))}debug(t){!1===t?(null==Gn||Gn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Gn||Gn.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}))}Ee(){var t,e,r,i,n,o,s,a=this.zo||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(lo.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=lo,o=(e="advanced_disable_flags")in(t=a)&&!ti(t[e]),s=r in t&&!ti(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}us(t){if(ni(this.config.before_send))return t;var e=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ni(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return li(t.event)?lo.warn(n+". This can cause unexpected behavior."):lo.info(n),null}r.properties&&!Qr(r.properties)||lo.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Xr)?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)})}Vo(t){var e=ai(t)&&!t,r=Vp.Ue()&&"true"===Vp.Xe("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=bo(t.prototype[e[r]])}(Gm,["identify"]);var Ym,Um={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Wm=(Ym=jm[$m]=new Gm,function(){function t(){t.done||(t.done=!0,qm=!1,fo(jm,(function(t){t._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?t():ko(Kn,"DOMContentLoaded",t,{capture:!1}):Gn&&lo.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Ym);export{rl as Compression,Um as DEFAULT_PRODUCT_TOUR_APPEARANCE,Ou as DisplaySurveyType,Gm as PostHog,Nu as SurveyEventName,Fu as SurveyEventProperties,Su as SurveyEventType,xu as SurveyPosition,Ru as SurveyQuestionBranchingType,Eu as SurveyQuestionType,Mu as SurveySchedule,Au as SurveyTabPosition,Tu as SurveyType,ku as SurveyWidgetType,Wm as default,Wm as posthog,el as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map