posthog-js 1.410.2 → 1.410.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.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/conversations.js +1 -1
- package/dist/conversations.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/lib/src/extensions/conversations/external/components/RichContent.js +13 -3
- package/lib/src/extensions/conversations/external/components/RichContent.js.map +1 -1
- package/package.json +4 -4
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(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))(l||{}),u=(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))(u||{}),h=(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))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(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))(v||{}),f=(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))(f||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in g?g[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return y[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):r}catch(t){return r}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var _={};function w(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=b(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var x={};function k(t,e,r){var i=t+"."+String(r);if(x[i])return x[i].bind(e);var n=b(t)[r];return"function"!=typeof n?e[r]:(x[i]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function C(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:C};function I(t){return t.nodeType===t.ELEMENT_NODE}function T(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>P(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function P(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return B(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?B(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),I(t)){var r=M.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function F(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&A(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function A(t){return t.toLowerCase()}var L="__rrweb_original__";function D(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?A(e):null}catch(t){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,q=/^(?:[a-z+]+:)?\/\//i,j=/^www\..*/i,H=/^(data:)([^,]*),(.*)/i;function B(t,e){return(t||"").replace(N,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(q.test(l)||j.test(l))return"url("+u+l+u+")";if(H.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var U,z,V="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,Z=1,G=new RegExp("[^a-z0-9-_:]"),Q=-2;function J(){return Z++}var K=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,X=new WeakMap;function tt(t,e){return e&&""!==e.trim()?et(t,e):e}function et(t,e){var r=X.get(t);if(r||(r=t.createElement("a"),X.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function rt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?V:t}(t,e.maxBase64ImageLength):t}function it(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=tt(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,l,s.type,s.quality)),rt(u,s)}if("image"===e)return rt(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=tt(t,i);return"image"===e&&h.startsWith("data:")?rt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Y),e.length>r;){var s=i(K);if(","===s.slice(-1))s=tt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=tt(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?B(i,et(t)):"object"===e&&"data"===r?tt(t,i):i:tt(t,i)}function nt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function st(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&st(M.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&st(M.parentNode(t),e,r)}function ot(t,e,r,i){var n;if(I(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.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(st(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 at(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var lt=new Map;function ut(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function ht(t){return null==t?"":t.toLowerCase()}var dt=50,ct=!1,vt=!1;function ft(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,C=e.onSerialize,P=e.onIframeLoad,O=e.iframeLoadTimeout,N=void 0===O?5e3:O,q=e.onIframeListenerRegistered,j=e.onStylesheetLoad,H=e.stylesheetLoadTimeout,V=void 0===H?5e3:H,W=e.keepIframeSrcFn,Z=void 0===W?()=>!1:W,K=e.newlyAddedElement,Y=void 0!==K&&K,X=e.depth,tt=void 0===X?0:X,rt=e.maxDepth,st=void 0===rt?dt:rt,pt=e.needsMask,gt=e.preserveWhiteSpace,mt=void 0===gt||gt;if(tt>=st)return vt=!0,ct||(ct=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+st+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;pt||(pt=ot(t,o,a,void 0===pt));var yt,bt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=A(t.tagName);return G.test(e)?"div":e}(t),k={},S=t.attributes.length,C=0;S>C;C++){var I=t.attributes[C];nt(x,I.name)||(k[I.name]=it(o,x,A(I.name),I.value,t,c))}if("link"===x&&a){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=ut(o,E))&&E.includes(".css")&&(T=ut(o,window.location.origin+"/"+E.replace(window.location.href,"")))}var P=null;T&&(P=R(T)),P&&(delete k.rel,delete k.href,k._cssText=P)}if("style"===x&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var O=R(t.sheet);O&&(k._cssText=O)}if("input"===x||"textarea"===x||"select"===x){var N=t.value,q=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&N?k.value=F({element:t,type:D(t),tagName:x,value:N,maskInputOptions:u,maskInputFn:h}):q&&(k.checked=q)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((L in n?n[L]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var j=t.toDataURL(c.type,c.quality),H=o.createElement("canvas");H.width=t.width,H.height=t.height,j!==H.toDataURL(c.type,c.quality)&&(k.rr_dataURL=j)}if("img"===x&&v){U||(U=o.createElement("canvas"),z=U.getContext("2d"));var B=t,V=B.currentSrc||B.getAttribute("src")||"<unknown-src>",W=B.crossOrigin,Z=()=>{at(B,"load",Z);try{U.width=B.naturalWidth,U.height=B.naturalHeight,z.drawImage(B,0,0),k.rr_dataURL=U.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?Z():B.addEventListener("load",Z));console.warn("Cannot inline img src="+V+"! Error: "+t)}"anonymous"===B.crossOrigin&&(W?k.crossOrigin=W:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?Z():B.addEventListener("load",Z)}if("audio"===x||"video"===x){var Q=k;Q.rr_mediaState=t.paused?"paused":"played",Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var J=t.getBoundingClientRect(),K=J.width,Y=J.height,X=J.left,tt=J.top,et=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);k={class:k.class,rr_width:K+"px",rr_height:Y+"px",rr_left:Math.floor(X+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(tt+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},et&&(k.rr_position=et.position||"static",et.transform&&"none"!==et.transform&&(k.rr_transform=et.transform),et.display&&et.display.startsWith("inline")&&(k.rr_display=et.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(rt=t,Boolean("svg"===rt.tagName||rt.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s};var rt}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=M.parentNode(t),a=o&&o.tagName,l=M.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=R(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=B(l,et(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,M.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:M.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:Z,newlyAddedElement:Y});if(!bt)return console.warn(t,"not serialized"),null;yt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,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}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ht(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ht(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ht(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ht(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ht(t.attributes.property).match(/^(og|twitter|fb):/)||ht(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ht(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ht(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ht(t.attributes.name))||ht(t.attributes.property).match(/^article:/)||ht(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ht(t.attributes.name)))return!0}}return!1}(bt,m)||!mt&&bt.type===f.Text&&!bt.isStyle&&!bt.textContent.replace(/^\s+|\s+$/gm,"").length?Q:J();var _t=Object.assign(bt,{id:yt});if(i.add(t,_t),yt===Q)return null;C&&C(t);var wt=!u;if(_t.type===f.Element){wt=wt&&!_t.needBlock,delete _t.needBlock;var xt=M.shadowRoot(t);xt&&E(xt)&&(_t.isShadowHost=!0)}if((_t.type===f.Document||_t.type===f.Element)&&wt){m.headWhitespace&&_t.type===f.Element&&"head"===_t.tagName&&(mt=!1);var kt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onIframeListenerRegistered:q,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt+1,maxDepth:st};if(_t.type===f.Element&&"textarea"===_t.tagName&&void 0!==_t.attributes.value);else for(var St of Array.from(M.childNodes(t))){var Ct=ft(St,kt);Ct&&_t.childNodes.push(Ct)}var Mt=null;if(I(t)&&(Mt=M.shadowRoot(t)))for(var It of Array.from(M.childNodes(Mt))){var Tt=ft(It,kt);Tt&&(E(Mt)&&(Tt.isShadow=!0),_t.childNodes.push(Tt))}}var Et=M.parentNode(t);if(Et&&T(Et)&&E(Et)&&(_t.isShadow=!0),_t.type===f.Element&&"iframe"===_t.tagName){var Rt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),at(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?at(t,"load",o):(a=!0,at(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),at(t,"load",o)}}return t.addEventListener("load",o),()=>{at(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&P){var r=ft(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onIframeListenerRegistered:q,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt+1,maxDepth:st});r&&P(t,r)}}),N);null==q||q(t,Rt)}return _t.type===f.Element&&"link"===_t.tagName&&"stylesheet"===_t.attributes.rel&&function(e,l,u){if(!lt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(j){var e=ft(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt,maxDepth:st});e&&j(t,e)}})()}finally{lt.delete(e),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),lt.set(e,c)}}}(t,0,V),_t}function pt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class gt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof gt))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"}}function mt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>yt(r,t,e,i)}function yt(t,e,r,i){bt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function bt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var _t="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.",wt={map:{},getId(){return console.error(_t),-1},getNode(){return console.error(_t),null},removeNodeFromMap(){console.error(_t)},has(){return console.error(_t),!1},reset(){console.error(_t)}};function xt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function kt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>kt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get(t,e,r){return"map"===e&&console.error(_t),Reflect.get(t,e,r)}}));var St=Date.now;function Ct(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=M.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Mt(){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 Tt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Et(t,e,r,i){if(!t)return!1;var n=Tt(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(st(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 Rt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Q}function Pt(t,e){if(T(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=M.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Pt(i,e))}function Ot(t){return Boolean(t.changedTouches)}function Ft(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function At(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function $t(t){return!!t&&(t instanceof gt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(St=()=>(new Date).getTime());class Lt{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 Dt(t){var e,r=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(r=M.host(M.getRootNode(t))),r}function Nt(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Dt(r);)r=e;return r}(t);return M.contains(e,r)}(t))}function qt(t){return"__ln"in t}class jt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&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 Ht,Bt=(t,e)=>t+"@"+e;class Ut{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,"removesSubTreeCache",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,"canvasMaskingConfigured"),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,"canvasManagerReleased",!1),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 jt,i=t=>{for(var e=t,r=Q;r===Q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=M.parentNode(n);if(s&&Nt(n)&&"TEXTAREA"!==s.tagName){var o=T(s)?this.mirror.getId(Dt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ft(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,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Ft(t,this.mirror)&&this.iframeManager.addIframe(t),At(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),$t(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Vt(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||Vt(this.removesSubTreeCache,o)?Wt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(M.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(M.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=M.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=M.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 e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=F({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:D(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Rt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Et(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ot(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Tt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=D(r);n=F({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Et(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!nt(r.tagName,i))if(o.attributes[i]=it(this.doc,A(r.tagName),A(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Et(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(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Et(t.target,this.blockClass,this.blockSelector,!1)||Rt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Pt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Bt(r,i)]?zt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!T(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),M.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Rt(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[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Et(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),$t(t)&&M.childNodes(M.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","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function zt(t,e){t.delete(e),M.childNodes(e).forEach((e=>zt(t,e)))}function Vt(t,e,r){return 0!==t.size&&function(t,e,r){var i=M.parentNode(e);return!!i&&t.has(i)}(t,e)}function Wt(t,e){return 0!==t.size&&Zt(t,e)}function Zt(t,e){var r=M.parentNode(e);return!!r&&(!!t.has(r)||Zt(t,r))}var Gt=t=>Ht?function(){try{return t(...arguments)}catch(t){if(Ht&&!0===Ht(t))return;throw t}}:t,Qt=[];function Jt(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 Kt(t,e){var r=new Ut;Qt.push(r),r.init(t);var i=new(S())(Gt(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function Yt(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Jt(t);if(o&&!Et(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Ct(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),e({id:h,x:l,y:u}))}},u=[mt("scroll",Gt(xt(Gt((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(mt("scrollend",Gt(l),r)),()=>u.forEach((t=>t()))}function Xt(t,e){for(var r=Qt.length-1;r>=0;r--){var i=Qt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Qt.splice(r,1))}}}var te=["INPUT","TEXTAREA","SELECT"],ee=new WeakMap;function re(t){return function t(e,r){if(oe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||oe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||oe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||oe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ie(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ne(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var a="#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==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&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;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),Gt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function se(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...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){var o=Kt(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=xt(Gt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=Gt(xt(Gt((t=>{var e=Jt(t),r=Ot(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=St()),l.push({x:i,y:o,id:n.getId(e),timeOffset:St()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[mt("mousemove",d,i),mt("touchmove",d,i),mt("drag",d,i)];return Gt((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=A(t),l=(t=>i=>{var a=Jt(i);if(!Et(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Ot(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Ot(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Gt(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(mt(a,l,i))})),Gt((()=>{u.forEach((t=>t()))}))}(t),x=Yt(t),k=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return mt("resize",Gt(xt(Gt((()=>{var t=Mt(),e=It();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),S=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Jt(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=M.parentElement(e)),e&&c&&te.indexOf(c)>=0&&!Et(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=D(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=F({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ee.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ee.set(t,i);var o=n.getId(t);Gt(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>mt(t,Gt(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>kt(t[0],t[1],{set(){Gt(c)({target:this,isTrusted:!1})}},!1,p)))),Gt((()=>{f.forEach((t=>t()))}))}(t),I=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Gt((t=>xt(Gt((e=>{var r=Jt(e);if(r&&!Et(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[mt("play",y(v.Play),m),mt("pause",y(v.Pause),m),mt("seeked",y(v.Seeked),m),mt("volumechange",y(v.VolumeChange),m),mt("ratechange",y(v.RateChange),m)],Gt((()=>{b.forEach((t=>t()))}))),T=()=>{},E=()=>{},R=()=>{},P=()=>{};t.recordDOM&&(T=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Gt(((t,e,s)=>{var o=s[0],a=s[1],l=ie(e,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};ae("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ae("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ae("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ae("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Gt(((t,e,s)=>{var o=s[0],a=s[1],l=ie(e.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...re(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...re(e),o]}]}),t.apply(e,s)}))})})),Gt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),E=ne(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Gt(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=ie(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:re(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Gt(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=ie(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:re(e.parentRule)}),t.apply(e,o)}))}),Gt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(P=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=C(r.fonts,"add",(function(t){return function(r){return setTimeout(Gt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Gt((()=>{n.forEach((t=>t()))}))}(t)));var O=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Gt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Et(d,i,n,!0)||Et(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),mt("selectionchange",a)}(t),L=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?C(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),N=[];for(var q of t.plugins)N.push(q.observer(q.callback,s,q.options));return Gt((()=>{if(n){n.destroy(),n.reset();var e=Qt.indexOf(n);-1!==e&&Qt.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),_(),w(),x(),k(),S(),I(),T(),E(),R(),P(),O(),L(),N.forEach((t=>t()))}))}function oe(t){return void 0!==window[t]}function ae(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class le{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class ue{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new le(J)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new le(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>bt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{yt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);bt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}bt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var 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 l.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),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.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 u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(yt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(yt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{bt((()=>this.mirror.removeNodeFromMap(t)))})),bt((()=>Xt(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&yt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{yt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class he{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){var i,n;if(E(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=Kt(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Qt.indexOf(l);-1!==t&&Qt.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Yt(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(M.host(t))),this.restoreHandlers.push({doc:s,handler:ne({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({doc:e,handler:C(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=M.shadowRoot(this);return s&&Nt(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var de="skip-frame";function ce(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pe=0;64>pe;pe++)fe[ve.charCodeAt(pe)]=pe;var ge=new Map,me=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=ge.get(t);return r||ge.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ye(t,e,r,i){if(t instanceof Array)return t.map((t=>ye(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=ve[r[e]>>2],n+=ve[(3&r[e])<<4|r[e+1]>>4],n+=ve[(15&r[e+1])<<2|r[e+2]>>6],n+=ve[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);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[ye(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ye(t.data,e,r,i),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:me(t,e,r)}:t}var be=(t,e,r,i)=>t.map((t=>ye(t,e,r,i))),_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])))},we=["webgl","webgl2"];function xe(t){return"nodeType"in t}function ke(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return C(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||xe(o)&&Et(o,e,i,!0))return n.call(this,s);xe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=C(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Et(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&we.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Se(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=C(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(me(d,s,this),"tagName"in this.canvas&&!Et(this.canvas,i,n,!0)){var c=be(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=kt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ce,Me,Ie,Te='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Ee="undefined"!=typeof self&&self.Blob&&new Blob([Te],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(self.URL||self.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Te),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Pe{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,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),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 e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=ke(r,i,n,!0),h=new Map;try{a=new Re}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Et(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return de}if(void 0!==o){if(!Array.isArray(o)||!o.every(ce))return de;var a=r/n,l=i/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),r=Math.floor(t.y*l);return{x:e,y:r,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-r}}))}}}(s.canvasMasking,t,c,v,u,d);if(f===de)return void h.set(i,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ke(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=C(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Et(this.canvas,r,i,!0)||setTimeout((()=>{var r=be(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=kt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Se(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Se(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Oe{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Lt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:P(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,lt.forEach((t=>t.abort())),lt.clear()}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 Ae=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var $e=document.createElement("iframe");document.body.appendChild($e),Array.from=(null==(n=$e.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild($e)}}catch(t){console.debug("Unable to override Array.from",t)}var Le=new O,De=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ne(t){void 0===t&&(t={});var e=t,i=e.emit,n=e.checkoutEveryNms,s=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,h=e.blockSelector,d=void 0===h?null:h,c=e.ignoreClass,v=void 0===c?"rr-ignore":c,f=e.ignoreSelector,p=void 0===f?null:f,g=e.maskTextClass,m=void 0===g?"rr-mask":g,y=e.maskTextSelector,b=void 0===y?null:y,_=e.inlineStylesheet,w=void 0===_||_,x=e.maskAllInputs,k=e.maskInputOptions,S=e.slimDOMOptions,C=e.maskInputFn,I=e.maskTextFn,T=e.hooks,E=e.packFn,R=e.sampling,P=void 0===R?{}:R,F=e.dataURLOptions,A=void 0===F?{}:F,L=e.canvasResolutionScale,D=e.canvasMasking,N=e.mousemoveWait,q=e.recordDOM,j=void 0===q||q,H=e.recordCanvas,B=void 0!==H&&H,U=e.recordCrossOriginIframes,z=void 0!==U&&U,V=e.recordAfter,W=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=e.userTriggeredOnInput,G=void 0!==Z&&Z,Q=e.collectFonts,J=void 0!==Q&&Q,K=e.inlineImages,Y=void 0!==K&&K,X=e.plugins,tt=e.keepIframeSrcFn,et=void 0===tt?()=>!1:tt,rt=e.ignoreCSSAttributes,it=void 0===rt?new Set([]):rt,nt=e.attributeFilter;Ht=e.errorHandler;var st=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),ot=!z||window.parent===window,at=!1;if(!ot)try{window.parent.document&&(at=!1)}catch(t){at=!0}if(ot&&!i)throw new Error("emit function is required");if(!ot&&!at)return()=>{};void 0!==N&&void 0===P.mousemove&&(P.mousemove=N),Le.reset();var lt,ut=!0===x?{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!==k?k:{password:!0},ht=pt(void 0!==S&&S);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var dt,ct,vt=0,gt=new Map,yt=t=>{for(var e of X||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!at&&(t=E(t)),t};Ce=(t,e)=>{var r,o=t;if(o.timestamp=St(),!(null==(r=Qt[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&De.has(o.data.source)||Qt.forEach((t=>t.unfreeze())),ot)null==i||i(yt(o),e);else if(at){var a={type:"rrweb",event:yt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)lt=o,vt=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;vt++,(s&&vt>=s||n&&o.timestamp-lt.timestamp>n)&&Me(!0)}};var _t=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Le.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Tt.getIframeElementById(r);n&&i.has(n)?Tt.forgetIframeId(r):(null==dt||dt(r),Tt.removeIframeById(r))}})),null==ct||ct(),Tt.cleanupDetachedIframes()}Ce({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},wt=t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),xt=t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),kt=new Oe({mutationCb:_t,adoptedStyleSheetCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Tt=new ue({mirror:Le,mutationCb:_t,stylesheetManager:kt,recordCrossOriginIframes:z,wrappedEmit:Ce});for(var Et of X||[])Et.getMirror&&Et.getMirror({nodeMirror:Le,crossOriginIframeMirror:Tt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Tt.crossOriginIframeStyleMirror});var Rt=new Fe,Pt=null==D?void 0:D.configured;Ie=new Pe({recordCanvas:B,mutationCb:xt,win:window,blockClass:a,blockSelector:d,mirror:Le,sampling:P.canvas,dataURLOptions:st,resolutionScale:L,canvasMasking:D});var Ot=new he({mutationCb:_t,scrollCb:wt,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskInputOptions:ut,dataURLOptions:st,maskTextFn:I,maskInputFn:C,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,sampling:P,slimDOMOptions:ht,iframeManager:Tt,stylesheetManager:kt,canvasManager:Ie,keepIframeSrcFn:et,processedNodeManager:Rt,attributeFilter:nt},mirror:Le});Me=function(t){if(void 0===t&&(t=!1),j){Ce({type:l.Meta,data:{href:window.location.href,width:It(),height:Mt()}},t),kt.reset(),Ot.init(),Qt.forEach((t=>t.lock()));var e=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new O:i,s=r.blockClass,o=r.blockSelector,a=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,h=r.inlineImages,d=void 0!==h&&h,c=r.recordCanvas,v=void 0!==c&&c,f=r.canvasMaskingConfigured,p=r.maskAllInputs,g=void 0!==p&&p,m=r.slimDOM,y=r.dataURLOptions,b=r.preserveWhiteSpace,_=r.onSerialize,w=r.onIframeLoad,x=r.iframeLoadTimeout,k=r.onIframeListenerRegistered,S=r.onStylesheetLoad,C=r.stylesheetLoadTimeout,M=r.keepIframeSrcFn,I=void 0===M?()=>!1:M,T=r.maxDepth;return ft(t,{doc:t,mirror:n,blockClass:void 0===s?"rr-block":s,blockSelector:void 0===o?null:o,maskTextClass:void 0===a?"rr-mask":a,maskTextSelector:void 0===l?null:l,skipChild:!1,inlineStylesheet:void 0===u||u,maskInputOptions:!0===g?{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===g?{password:!0}:g,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:pt(void 0!==m&&m),dataURLOptions:y,inlineImages:d,recordCanvas:v,canvasMaskingConfigured:f,preserveWhiteSpace:b,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:x,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:T})}(document,{mirror:Le,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskAllInputs:ut,maskTextFn:I,maskInputFn:C,slimDOM:ht,dataURLOptions:st,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,onSerialize(t){Ft(t,Le)&&Tt.addIframe(t),At(t,Le)&&kt.trackLinkElement(t),$t(t)&&Ot.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){Tt.attachIframe(t,e),Ot.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Tt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){kt.attachLinkElement(t,e)},keepIframeSrcFn:et});if(!e)return console.warn("Failed to snapshot the document");Ce({type:l.FullSnapshot,data:{node:e,initialOffset:Ct(window)}},t),Qt.forEach((t=>t.unlock())),Ie.onFullSnapshot(),z&&Tt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&kt.adoptStyleSheets(document.adoptedStyleSheets,Le.getId(document))}};try{var Lt=[];dt=t=>{var e=gt.get(t);e&&(e.forEach((t=>{bt(t);var e=Lt.indexOf(t);-1!==e&&Lt.splice(e,1)})),gt.delete(t))},ct=()=>{for(var t of gt){var e=t[0],r=Le.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var Dt=t=>{var e;return Gt(se)({mutationCb:_t,mousemoveCb:(t,e)=>Ce({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:wt,viewportResizeCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:xt,fontCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){Ce({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){Ce({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:b,maskInputOptions:ut,inlineStylesheet:w,sampling:P,recordDOM:j,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,userTriggeredOnInput:G,collectFonts:J,doc:t,maskInputFn:C,maskTextFn:I,keepIframeSrcFn:et,blockSelector:d,slimDOMOptions:ht,dataURLOptions:st,mirror:Le,iframeManager:Tt,stylesheetManager:kt,shadowDomManager:Ot,processedNodeManager:Rt,canvasManager:Ie,ignoreCSSAttributes:it,attributeFilter:nt,plugins:(null==(e=null==X?void 0:X.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ce({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},T)};Tt.addLoadListener((t=>{try{var e=Le.getId(t),r=Dt(t.contentDocument);if(Lt.push(r),-1!==e){var i=gt.get(e);i||gt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Tt.addPageHideListener((t=>{var e=Le.getId(t);null==dt||dt(e),Xt(t)}));var Nt=-1,qt=t=>Ce({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),jt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Le.getId(s):-1;o!==Nt&&(-1!==Nt&&qt({id:Nt,enter:!1}),Nt=o,-1!==o&&qt({id:o,enter:!0}))},Bt=()=>{Me(),Lt.push(Dt(document)),Lt.push(mt("fullscreenchange",jt)),Lt.push(mt("webkitfullscreenchange",jt)),Lt.push(mt("mozfullscreenchange",jt)),Lt.push(mt("MSFullscreenChange",jt)),Ae=!0};return["interactive","complete"].includes(document.readyState)?Bt():(Lt.push(mt("DOMContentLoaded",(()=>{Ce({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===W&&Bt()}))),Lt.push(mt("load",(()=>{Ce({type:l.Load,data:{}}),"load"===W&&Bt()}),window))),()=>{Lt.forEach((t=>bt(t))),Rt.destroy(),Tt.removeLoadListener(),Tt.destroy(),gt.clear(),Ot.reset(),Le.reset(),Ae=!1,Ht=void 0}}catch(t){console.warn(t)}}Ne.addCustomEvent=(t,e)=>{if(!Ae)throw new Error("please add custom event after start recording");Ce({type:l.Custom,data:{tag:t,payload:e}})},Ne.freezePage=()=>{Qt.forEach((t=>t.freeze()))},Ne.takeFullSnapshot=t=>{if(!Ae)throw new Error("please take full snapshot after start recording");Me(t)},Ne.mirror=Le;var qe=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class He{constructor(t){je(this,"fileName"),je(this,"functionName"),je(this,"lineNumber"),je(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 Be=/(^|@)\S+:\d+/,Ue=/^\s*at .*(\S+:\d+|\(native\))/m,ze=/^(eval@)?(\[native code])?$/,Ve={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ue)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ue)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new He({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(ze)}),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 He({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new He({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new He({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new He({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Be)&&!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 He({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function We(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Ze(t){return Array.isArray(t)}function Ge(t){return"object"==typeof t&&null!==t&&!Ze(t)}function Qe(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ge(t[i])&&Qe(t[i],e-1))return!0;return!1}function Je(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Ge(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ge(o)&&Qe(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Ze(u)?We(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ke={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 Ye(t,e,r){var i,n=r?Object.assign({},Ke,r):Ke,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=Ve.parse(e.error).map((t=>t.toString())),s=[Je(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Je("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Je("Uncaught (in promise)",n.stringifyOptions),Je(e.reason,n.stringifyOptions)]);var s=Ve.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Ve.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>Je(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Je("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Xe=t=>({name:"rrweb/console@1",observer:Ye,options:t}),tr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function er(t){return"string"==typeof t||t}function rr(t){return"string"==typeof t?t:void 0}var ir,nr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],sr=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),or=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ar="min_length",lr="max_length",ur=["$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"],hr=["token"],dr="NativeGzipValidationError",cr=t=>t.length>=2&&31===t[0]&&139===t[1],vr=(t,e)=>t===or.GZipJS||e===or.GZipJS||"gzip"===e,fr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),pr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=dr,e},gr=function(){var t=e((function*(t,e){18>t.size&&pr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());cr(r)&&8===r[2]||pr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(ir)return ir;ir=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;ir[t]=e>>>0}return ir})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&pr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&pr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function mr(){return mr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield gr(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),mr.apply(this,arguments)}var yr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],br=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return yr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function _r(t,e){return-1!==t.indexOf(e)}var wr=function(t){return t.trim()},xr=function(t){return t.replace(/^\$/,"")};function kr(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var Sr=Object.prototype,Cr=Sr.hasOwnProperty,Mr=Sr.toString,Ir=Array.isArray||function(t){return"[object Array]"===Mr.call(t)},Tr=t=>"function"==typeof t,Er=t=>t===Object(t)&&!Ir(t),Rr=t=>{if(Er(t)){for(var e in t)if(Cr.call(t,e))return!1;return!0}return!1},Pr=t=>void 0===t,Or=t=>"[object String]"==Mr.call(t),Fr=t=>Or(t)&&0===t.trim().length,Ar=t=>null===t,$r=t=>Pr(t)||Ar(t),Lr=t=>"[object Number]"==Mr.call(t)&&t==t,Dr=t=>Lr(t)&&t>0,Nr=t=>"[object Boolean]"===Mr.call(t),qr=t=>t instanceof FormData,jr=t=>_r(ur,t),Hr=t=>_r(hr,t);function Br(t){return null===t||"object"!=typeof t}function Ur(t,e){return{}.toString.call(t)==="[object "+e+"]"}function zr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Vr=[!0,"true",1,"1","yes"],Wr=t=>_r(Vr,t),Zr=[!1,"false",0,"0","no"];function Gr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),Lr(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Gr(n||r,e,r,i))}class Qr{constructor(t){this.tt={},this.et=t.et,this.rt=Gr(t.bucketSize,0,100,t.it),this.nt=Gr(t.refillRate,0,this.rt,t.it),this.st=Gr(t.refillInterval,0,864e5,t.it)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.rt),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.rt,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var Jr="Mobile",Kr="iOS",Yr="Android",Xr="Tablet",ti=Yr+" "+Xr,ei="iPad",ri="Apple",ii=ri+" Watch",ni="Safari",si="BlackBerry",oi="Samsung",ai=oi+"Browser",li=oi+" Internet",ui="Chrome",hi=ui+" OS",di=ui+" "+Kr,ci="Internet Explorer",vi=ci+" "+Jr,fi="Opera",pi=fi+" Mini",gi="Edge",mi="Microsoft "+gi,yi="Firefox",bi=yi+" "+Kr,_i="Nintendo",wi="PlayStation",xi="Xbox",ki=Yr+" "+Jr,Si=Jr+" "+ni,Ci="Windows",Mi=Ci+" Phone",Ii="Nokia",Ti="Ouya",Ei="Generic",Ri=Ei+" "+Jr.toLowerCase(),Pi=Ei+" "+Xr.toLowerCase(),Oi="Konqueror",Fi="Oculus Browser",Ai="Vivaldi",$i="Yandex",Li="Whale",Di="DuckDuckGo",Ni="Pale Moon",qi="Waterfox",ji="Brave",Hi="Google Search App",Bi="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+Bi),zi=new RegExp(xi,"i"),Vi=new RegExp(wi+" \\w+","i"),Wi=new RegExp(_i+" \\w+","i"),Zi=new RegExp(si+"|PlayBook|BB10","i"),Gi={"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"},Qi=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?ji:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&_r(t,"GSA/")?Hi:_r(t," OPR/")&&_r(t,"Mini")?pi:_r(t," OPR/")?fi:Zi.test(t)?si:_r(t,"IE"+Jr)||_r(t,"WPDesktop")?vi:_r(t,"OculusBrowser")?Fi:_r(t,ai)?li:_r(t,gi)||_r(t,"Edg/")?mi:_r(t,Ai+"/")?Ai:_r(t,"YaBrowser/")?$i:_r(t,Li+"/")?Li:_r(t,Di+"/")||_r(t,"Ddg/")?Di:_r(t,"FBIOS")?"Facebook "+Jr:_r(t,"UCWEB")||_r(t,"UCBrowser")?"UC Browser":_r(t,"CriOS")?di:_r(t,"CrMo")||_r(t,ui)?ui:_r(t,Yr)&&_r(t,ni)?ki:_r(t,"FxiOS")?bi:_r(t.toLowerCase(),Oi.toLowerCase())?Oi:_r(t,ji+"/")?ji:((t,e)=>e&&_r(e,ri)||function(t){return _r(t,ni)&&!_r(t,ui)&&!_r(t,Yr)}(t))(t,e)?_r(t,Jr)?Si:ni:_r(t,"PaleMoon/")?Ni:_r(t,qi+"/")?qi:_r(t,yi)?yi:_r(t,"MSIE")||_r(t,"Trident/")?ci:_r(t,"Gecko")?yi:"")},Ji={[vi]:[new RegExp("rv:"+Bi)],[mi]:[new RegExp(gi+"?\\/"+Bi)],[ui]:[new RegExp("("+ui+"|CrMo)\\/"+Bi)],[di]:[new RegExp("CriOS\\/"+Bi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Bi)],[ni]:[Ui],[Si]:[Ui],[fi]:[new RegExp("(Opera|OPR)\\/"+Bi)],[yi]:[new RegExp(yi+"\\/"+Bi)],[bi]:[new RegExp("FxiOS\\/"+Bi)],[Oi]:[new RegExp("Konqueror[:/]?"+Bi,"i")],[si]:[new RegExp(si+" "+Bi),Ui],[ki]:[new RegExp("android\\s"+Bi,"i")],[li]:[new RegExp(ai+"\\/"+Bi)],[Fi]:[new RegExp("OculusBrowser\\/"+Bi)],[Ai]:[new RegExp(Ai+"\\/"+Bi)],[$i]:[new RegExp("YaBrowser\\/"+Bi)],[Li]:[new RegExp(Li+"\\/"+Bi)],[ji]:[new RegExp(ji+"\\/"+Bi)],[Di]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Bi)],[Ni]:[new RegExp("PaleMoon\\/"+Bi)],[qi]:[new RegExp(qi+"\\/"+Bi)],[Hi]:[new RegExp("GSA\\/"+Bi)],[ci]:[new RegExp("(rv:|MSIE )"+Bi)],Mozilla:[new RegExp("rv:"+Bi)]},Ki=function(t,e,r,i){var n=Qi(t,e,r,i),s=Ji[n];if(Pr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Yi=[[new RegExp(xi+"; "+xi+" (.*?)[);]","i"),t=>[xi,t&&t[1]||""]],[new RegExp(_i,"i"),[_i,""]],[new RegExp(wi,"i"),[wi,""]],[Zi,[si,""]],[new RegExp(Ci,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Mi,""];if(new RegExp(Jr).test(e)&&!/IEMobile\b/.test(e))return[Ci+" "+Jr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Gi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[Ci,i]}return[Ci,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Kr,[t[3],t[4],t[5]||"0"].join(".")]:[Kr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Pr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Yr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Yr+")","i"),t=>t&&t[2]?[Yr,[t[2],t[3],t[4]||"0"].join(".")]:[Yr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[hi,""]],[/Linux|debian/i,["Linux",""]]],Xi=function(t){return Wi.test(t)?_i:Vi.test(t)?wi:zi.test(t)?xi:new RegExp(Ti,"i").test(t)?Ti:new RegExp("("+Mi+"|WPDesktop)","i").test(t)?Mi:/iPad/.test(t)?ei:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ii:Zi.test(t)?si:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ii,"i").test(t)?Ii:/(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(Jr).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)?Yr:ti:new RegExp("(pda|"+Jr+")","i").test(t)?Ri:new RegExp(Xr,"i").test(t)&&!new RegExp(Xr+" pc","i").test(t)?Pi:""},tn=function(t,e){var r,i,n,s,o=Xi(t);return o===ei||o===ti||"Kobo"===o||"Kindle Fire"===o||o===Pi?Xr:o===_i||o===xi||o===wi||o===Ti?"Console":o===ii?"Wearable":o?Jr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Jr:Xr:"Desktop"},en=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rn(t,e){return"string"==typeof(r=t)&&en.test(r)?t:e();var r}function nn(t){return t?t.split("#")[0]:t}function sn(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function on(t,e,r){return an.apply(this,arguments)}function an(){return(an=e((function*(t,e,r){var i;try{return yield Promise.race([t,new Promise(((t,n)=>{i=sn((()=>{try{null==r||r(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(i)}}))).apply(this,arguments)}var ln=t=>t instanceof Error,un={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},hn=un.info;function dn(t){if(Nr(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Ir(t))return{arrayValue:{values:t.map((t=>dn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function cn(t){var e=[];for(var r in t){var i=t[r];Ar(i)||Pr(i)||e.push({key:r,value:dn(i)})}return e}function vn(t,e){var i=un[t.level||"info"]||hn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),$r(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),$r(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:cn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Pr(t.trace_flags)||(u.flags=t.trace_flags),u}function fn(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function pn(t,e,r,i){return{resourceLogs:[{resource:{attributes:cn(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let gn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=r,this.ut=i,this.ht=n,this.dt=s,this.ct=o,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.It=e.maxLogsPerInterval}reset(){this.Tt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Rt(t);if(null!==e)if(e.body){if(this.Pt()){var r={record:vn(e,this.ut())};this.ht((()=>this.Ot(r)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Ir(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.it.info("Log was rejected in beforeSend function"),null;i=s}catch(t){return this.it.error("Error in beforeSend function for log:",t),null}return i}Pt(){if(void 0===this.It)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.It>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.It+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return e((function*(){var e;t.Tt();var r=null!==(e=t._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.ft=0;var a=Math.min(r.length,t.Ct),l=r.slice(0,a),u=l.map((t=>t.record)),h=pn(u,t.At(),null!==(s=t.ct)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.$t(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.Lt(l.length),r=null!==(o=t._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Lt(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.ft),n=null!==(e=r._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(sr.LogsQueue,n.slice(i)),yield r.dt()}))()}At(){return fn(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];this.kt>r.length||(r.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(sr.LogsQueue,r),this.xt>r.length?this.Dt():this.Et()}}Dt(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=sn((()=>{this.Nt=void 0,this.Et()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(sr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.Tt();var e=r.flush().catch((()=>{}));void 0!==t?yield on(e,t):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=r.flush();yield on(e,t,(()=>{e.catch((()=>{}))}))}))()}Et(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.Dt(this.qt())}))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var mn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(t){return String(t)+"000000"}function bn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let _n=class{constructor(t,e,r){this._instance=t,this.Te=e,this.it=r,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,r){void 0===e&&(e=1),this.Wt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Wt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Wt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.vt,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.Zt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.vt===n&&(this.vt=null)}));return this.vt=n,n}drainWindow(){if(0===this.Ht.size)return null;var t=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Tt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=bn(e.type,e.name,e.unit,i)}catch(t){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ht.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ht.set(n,s)}var o=this.Ut.get(e.name);void 0===o?this.Ut.set(e.name,e.type):o===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.Dt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(mn.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,mn)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Ir(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.it.info("Metric was rejected in beforeSend function"),null;i=s}catch(t){return this.it.error("Error in beforeSend function for metric:",t),null}return i}Dt(){this.Nt||(this.Nt=sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.it.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Ht.size){var e=t.Ht;t.Ht=new Map,t.Bt=!1,t.Ut=new Map,t.zt=new Set;var r=t.Vt,i=yield t._instance.Kt(t.Gt(e));if(r===t.Vt)switch(i.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Dt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",i.error)}}}))()}Gt(t){return e=this.Xt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:cn(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,i,n,s}Xt(t){var e=yn(Date.now()),i=new Map;for(var n of t.values()){var s,o=bn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=cn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=yn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:e,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:mn})}return Array.from(i.values())}Yt(t){var e,r;for(var i of t){var n=i[0],s=i[1],o=this.Ht.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Qt()&&this.Ht.set(n,s)}}};function wn(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var xn,kn,Sn;function Cn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Sn&&r.length===kn||(kn=r.length,Sn=r.reduce(((r,i)=>{xn||(xn={});var n=xn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,xn[i]=[l,u];break}}return r}),{})),Sn}}class Mn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ir(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:Cn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var In="?";function Tn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?In:r,in_app:!0};return Pr(i)||(s.lineno=i),Pr(n)||(s.colno=n),s}var En=(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]:In,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Rn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,On=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fn=(t,e)=>{var r=Rn.exec(t);if(r)return Tn(e,r[1],In,+r[2],+r[3]);var i=Pn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=On.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=En(i[1]||In,i[2]);return Tn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},An=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ln=(t,e)=>{var r=An.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=$n.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||In,o=En(s,n);return Tn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Dn=/\(error: (.*)\)/,Nn=50;class qn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Or(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 Ur(t,"DOMException")}isDOMError(t){return Ur(t,"DOMError")}}class jn{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 String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Hn{constructor(){}match(t){return Ur(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s: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 Vn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Wn{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 zr(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: "+Vn(t)}isSeverityLevel(t){return Or(t)&&!Fr(t)&&zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(ln(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Zn{match(t){return zr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Vn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return Br(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 Qn{match(t){return Ur(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!zr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return Br(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Jn="$message",Kn="$timestamp",Yn=new Set([Jn,Kn]),Xn={enabled:!0,max_bytes:32768};function ts(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Xn.enabled,max_bytes:rs(t.max_bytes,Xn.max_bytes)}:r({},Xn)}class es{constructor(t){this.$e=[],this.ze=0,this.Te=ts(t)}setConfig(t){this.Te=ts(t),this.Ze()}add(t){var e=function(t){var e;try{e=kr(t)}catch(t){return}try{var r=JSON.parse(e);if(!Er(r))return;var i=r,n=i[Jn],s=i[Kn];if(!Or(n)||0===n.trim().length)return;if(!Or(s)&&!Lr(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Te.max_bytes||(this.$e.push({step:e.step,bytes:r}),this.ze+=r,this.Ze())}}getAttachable(){return this.$e.map((t=>t.step))}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var t=this.$e.shift();t&&(this.ze-=t.bytes)}}}function rs(t,e){if(!Lr(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var is="undefined"!=typeof window?window:void 0,ns="undefined"!=typeof globalThis?globalThis:is,ss=null==ns?void 0:ns.navigator,os=null==ns?void 0:ns.document,as=null==ns?void 0:ns.location,ls=null==ns?void 0:ns.fetch,us=null!=ns&&ns.XMLHttpRequest&&"withCredentials"in new ns.XMLHttpRequest?ns.XMLHttpRequest:void 0,hs=null==ns?void 0:ns.AbortController,ds=null==ns?void 0:ns.CompressionStream,cs=null==ss?void 0:ss.userAgent;function vs(){return!(!is||!1===is.navigator.onLine)}var fs=t=>"undefined"!=typeof Document&&t instanceof Document,ps={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},gs=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(is&&(ps.DEBUG||is.POSTHOG_DEBUG||r)&&!Pr(is.console)&&is.console){for(var i=("__rrweb_original__"in is.console[e]?is.console[e].__rrweb_original__:is.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>gs(t+" "+e,r)};return i},ms=gs("[PostHog.js]"),ys=ms.createLogger;function bs(t,e){Ir(t)&&t.forEach(e)}function _s(t,e){if(!$r(t))if(Ir(t))t.forEach(e);else if(qr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Cr.call(t,r)&&e(t[r],r)}var ws=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function xs(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 ks=function(t){try{return t()}catch(t){return}},Ss=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){ms.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ms.critical(t)}}},Cs=function(t){var e={};return _s(t,(function(t,r){(Or(t)&&t.length>0||Lr(t))&&(e[r]=t)})),e};var Ms=["herokuapp.com","vercel.app","netlify.app"];function Is(t){var e=null==t?void 0:t.hostname;if(!Or(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Ms)if(r===i)return!1;return!0}function Ts(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Es(t){return"ph_toolbar_internal"===t.name}var Rs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return kr(t)}},Ps=t=>{var e=null==os?void 0:os.createElement("a");return Pr(e)?null:(e.href=t,e)},Os=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return _s(t,(function(t,e){Pr(t)||Pr(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)},Fs=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Ir(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){ms.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},As=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Ir(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},$s=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Ls=(t,e)=>t>=e&&vs(),Ds=(t,e,r,i)=>{if(0===t){if(vs()){var n=e+1;return n===r&&i(),n}return e}return 0},Ns=()=>{};function qs(t,e,r){try{if(!(e in t))return Ns;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Tr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Tr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return Ns}}function js(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Hs(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Tr(i))return e;try{var n=i(e);return Or(n)&&n?n:e}catch(t){return ms.error("Error in get_current_url, falling back to window.location.href",t),e}}function Bs(t){var e,r=null==is||null==(e=is.location)?void 0:e.href;return Pr(r)?void 0:Hs(t,r)}var Us="__POSTHOG_TOOLBAR__",zs=1,Vs=3,Ws=11;function Zs(t){return t instanceof Element&&(t.id===Us||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Gs(t){return!!t&&t.nodeType===zs}function Qs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Js(t){return!!t&&t.nodeType===Vs}function Ks(t){return!!t&&t.nodeType===Ws&&Gs(t.host)}var Ys=1e3;function Xs(t){return t?wr(t).split(/\s+/):[]}function to(t,e){var r=Bs(e);return!!(r&&t&&t.some((t=>r.match(t))))}function eo(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 Xs(e)}function ro(t){return $r(t)?null:wr(t).split(/(\s+)/).filter((t=>To(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function io(t){var e="";return bo(t)&&!_o(t)&&t.childNodes&&t.childNodes.length&&_s(t.childNodes,(function(t){var r;Js(t)&&t.textContent&&(e+=null!==(r=ro(t.textContent))&&void 0!==r?r:"")})),wr(e)}function no(t){var e;return Pr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var so=["a","button","form","input","select","textarea","label"];function oo(t,e){if(Pr(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function ao(t){var e=t.parentNode;return!(!e||!Gs(e))&&e}var lo=[".ph-no-autocapture","[data-ph-no-autocapture]"],uo=["next","previous","prev",">","<"],ho=[...uo,"+","-","−","–"],co=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,vo=[".ph-no-deadclick",".ph-no-capture"],fo=[".ph-no-rageclick",".ph-no-capture"],po=["","text","search","email","password","url","tel","number"];function go(t,e){if(!is||mo(t))return!1;var r,i,n,s,o;if(Nr(e)?(r=!!e&&fo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:fo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!Gs(t))&&(!!Qs(t,"textarea")||(Qs(t,"input")?_r(po,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=yo(t,!1).targetElementList;return!function(t,e){if(!1===t||Pr(t))return!1;var r;if(!0===t)r=uo;else{if(!Ir(t))return!1;if(t.length>10)return ms.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>co(e,t)||co(i,t)))}))}(i,a.map((t=>{var e;return{safeText:io(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!oo(a,r)}var mo=t=>!t||Qs(t,"html")||!Gs(t),yo=(t,e)=>{if(!is||mo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!Qs(n,"body");)if(Ks(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ao(n);if(!s)break;if(e||so.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=is.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function bo(t){for(var e=new Set,r=0,i=t;i.parentNode&&!Qs(i,"body");i=i.parentNode){if(r++>=Ys||e.has(i))return!1;e.add(i);var n=eo(i);if(_r(n,"ph-sensitive")||_r(n,"ph-no-capture"))return!1}if(_r(eo(t),"ph-include"))return!0;var s=t.type||"";if(Or(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Or(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function _o(t){return!!(Qs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qs(t,"select")||Qs(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var wo=new RegExp("^(?:(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}))$"),xo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ko=[16,15,14,13],So=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Co=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Mo=/[0-9A-Za-z_]/;function Io(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function To(t,e){if(void 0===e&&(e=!0),$r(t))return!1;if(Or(t)){t=wr(t);var r=e?wo.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(xo.lastIndex=0;e=xo.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of ko){var o=n+s;if(i.length>=o){var a=i.slice(n,o);if(wo.test(a)&&Io(a))return!0}}}return!1}(t);if(r)return!1;var i=e?So.test(t):function(t){var e;for(Co.lastIndex=0;e=Co.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Mo.test(r)&&Mo.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function Eo(t){var e=io(t);return To(e=(e+" "+Ro(t)).trim())?e:""}function Ro(t){var e="";return t&&t.childNodes&&t.childNodes.length&&_s(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=io(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ro(t)).trim())}catch(t){ms.error("[AutoCapture]",t)}})),e}function Po(t){return t.replace(/"|\\"/g,'\\"')}function Oo(t){var e=t.attr__class;if(e)return Ir(e)?e:Xs(e)}var Fo=1e6,Ao={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:Fo,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},$o=ys("[Recorder]"),Lo=t=>"navigation"===t.entryType,Do=t=>"resource"===t.entryType;function No(t,e){return!!e&&(Nr(e)||e[t])}function qo(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var jo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ho(t){var e=t.type,r=t.recordBody,i=t.headers;function n(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.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!qo(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(jo))return!1;if(Nr(r))return!0;if(Ir(r))return n(r);var s=r[e];return Nr(s)?s:n(s)}function Bo(t,e,r,i,n,s){return Uo.apply(this,arguments)}function Uo(){return Uo=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return $o.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Do(o=t[s])&&o.initiatorType===e&&(Pr(i)||o.startTime>=i)&&(Pr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Bo(t,e,r,i,n,s+1))})),Uo.apply(this,arguments)}function zo(t){var e=t.body,r=t.options,i=t.url;if($r(e))return null;var n=js(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Or(e))return e;if(fs(e))return e.textContent;if(qr(e))return Os(e);if(Er(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 Vo=t=>!Ar(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Wo(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Pr(a)?void 0:Math.round(a),endTime:Pr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Vo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Zo=["video/","audio/"];function Go(t){return Er(t)&&Tr(t.getReader)&&Tr(t.tee)}var Qo=500,Jo="[SessionReplay] Timeout while trying to read body",Ko="[SessionReplay] Failed to read body";function Yo(t){return Ko+": "+t}function Xo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function ta(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Jo)),Qo);try{t.clone().text().then((t=>e(t)),(t=>e(Yo(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Ko)}}))}(t);var r=function(t){var e;return Math.min(Fo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Fo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Xo(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(Jo)),Qo);try{a=t.clone()}catch(t){return void o(Ko)}var u=a.body;if(Go(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(Ko)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Xo(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Yo(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Yo(t))))}catch(t){o(Ko)}}))}(t,r)}function ea(){return ea=e((function*(t){var e=t.r,r=t.options,i=js(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):ta(e,r)})),ea.apply(this,arguments)}function ra(){return ra=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Zo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=js(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Ar(i)?ta(e,r):Promise.resolve(i)})),ra.apply(this,arguments)}var ia=null;function na(t,i,n){if(!("performance"in i))return()=>{};if(ia)return $o.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ao,n):Ao,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Lo(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Wo({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=>Lo(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Wo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=No("request",r.recordHeaders),n=No("response",r.recordHeaders),s=qs(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Ho({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=zo({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.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),Ho({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=zo({body:d.response,options:r,url:a})),Bo(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Wo({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){$o.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=No("request",i.recordHeaders),s=No("response",i.recordHeaders),o=qs(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return $o.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Go(null==a?void 0:a.body)&&Ho({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return ea.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){$o.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=qo(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),Ho({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ra.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Bo(r,"fetch",l.url,h,d).then((e=>{var r,i=Wo({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),ia=()=>{a(),l(),u(),ia=null}}var sa=t=>({name:"rrweb/network@1",observer:na,options:t}),oa="undefined"!=typeof globalThis?globalThis:is;oa&&"undefined"==typeof self&&(oa.self=oa),oa&&"undefined"==typeof File&&(oa.File=function(){});var aa=null!=is?is:{};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Xe,getRecordNetworkPlugin:sa},aa.__PosthogExtensions__.rrweb={record:Ne,version:"v2",wasMaxDepthReached:()=>vt,resetMaxDepthState(){vt=!1,ct=!1}},aa.rrweb={record:Ne,version:"v2"},aa.rrwebConsoleRecord={getRecordConsolePlugin:Xe},aa.getRecordNetworkPlugin=sa;var la,ua,ha,da,ca,va,fa,pa,ga,ma,ya,ba,_a,wa,xa,ka={},Sa=[],Ca=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ma=Array.isArray;function Ia(t,e){for(var r in e)t[r]=e[r];return t}function Ta(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ea(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?la.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Ra(t,o,i,n,null)}function Ra(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ha:n,__i:-1,__u:0};return null==n&&null!=ua.vnode&&ua.vnode(s),s}function Pa(t){return t.children}function Oa(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?$(t):null}function Fa(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=Ia({},e);s.__v=e.__v+1,ua.vnode&&ua.vnode(s),Ua(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?$(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Va(i,s,n),e.__e=e.__=null,s.__e!=r&&Aa(s)}}function Aa(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Aa(t)}function $a(t){(!t.__d&&(t.__d=!0)&&da.push(t)&&!La.__r++||ca!=ua.debounceRendering)&&((ca=ua.debounceRendering)||va)(La)}function La(){try{for(var t,e=1;da.length;)da.length>e&&da.sort(fa),t=da.shift(),e=da.length,Fa(t)}finally{da.length=La.__r=0}}function Da(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||Sa,b=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Ra(null,o,null,null,null):Ma(o)?o=t.__k[s]=Ra(Pa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Ra(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=qa(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Qa(a,a));return i}(r,e,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ka,v.__i=d,g=Ua(t,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ga(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=Na(v,l,t,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function Na(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Na(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=$(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function qa(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ja(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ca.test(e)?r:r+"px"}function Ha(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||ja(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||ja(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ya,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[ma]=i[ma]:(r[ma]=ba,t.addEventListener(e,s?wa:_a,s)):t.removeEventListener(e,s?wa:_a,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function Ba(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[ga])e[ga]=ba++;else if(r[ma]>e[ga])return;return r(ua.event?ua.event(e):e)}}}function Ua(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ua.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(b?e.__c=c=new C(y,_):(e.__c=c=new Oa(y,_),c.constructor=C,c.render=Ja),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=C.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ia({},c.__s)),Ia(c.__s,C.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=e,v)b&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),Sa.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=t,c.__e=!1,w=ua.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),Sa.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=Ia(Ia({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Pa&&null==h.key?Wa(h.props.children):h,a=Da(t,Ma(k)?k:[k],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(S=s.length;S--;)Ta(s[S]);za(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||za(e);ua.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=Za(r.__e,e,r,i,n,s,o,l,u);return(h=ua.diffed)&&h(e),128&e.__u?void 0:a}function za(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(za))}function Va(t,e,r){for(var i=0;r.length>i;i++)Ga(r[i],r[++i],r[++i]);ua.__c&&ua.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ua.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b>0?t:Ma(t)?t.map(Wa):void 0!==t.constructor?null:Ia({},t)}function Za(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ka,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ua.__m&&ua.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&la.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Ha(t,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||Ha(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Da("template"==e.type?t.content:t,Ma(c)?c:[c],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)Ta(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Ha(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Ha(t,u,p,g[u],n))}return t}function Ga(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ua.__e(t,r)}}function Qa(t,e,r){var i,n;if(ua.unmount&&ua.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ga(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ua.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Qa(i[n],e,r||"function"!=typeof t.type);r||Ta(t.__e),t.__c=t.__=t.__e=void 0}function Ja(t,e,r){return this.constructor(t,r)}function Ka(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ua.__&&ua.__(t,e),i=e.__k,n=[],s=[],Ua(e,t=e.__k=Ea(Pa,null,[t]),i||ka,ka,e.namespaceURI,i?null:e.firstChild?la.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Va(n,t,s),t.props.children=null}la=Sa.slice,ua={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ha=0,Oa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ia({},this.state),"function"==typeof t&&(t=t(Ia({},r),this.props)),t&&Ia(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),$a(this))},Oa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$a(this))},Oa.prototype.render=Pa,da=[],va="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(t,e){return t.__v.__b-e.__v.__b},La.__r=0,pa=Math.random().toString(8),ga="__d"+pa,ma="__a"+pa,ya=/(PointerCapture)$|Capture$/i,ba=0,_a=Ba(!1),wa=Ba(!0),xa=0;var Ya,Xa,tl,el,rl=0,il=[],nl=ua,sl=nl.__b,ol=nl.__r,al=nl.diffed,ll=nl.__c,ul=nl.unmount,hl=nl.__;function dl(t,e){nl.__h&&nl.__h(Xa,t,rl||e),rl=0;var r=Xa.__H||(Xa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function cl(t){return rl=1,function(t,e,r){var i=dl(Ya++,2);if(i.t=t,!i.__c&&(i.__=[kl(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=Xa,!Xa.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};Xa.__f=!0;var s=Xa.shouldComponentUpdate,o=Xa.componentWillUpdate;Xa.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Xa.shouldComponentUpdate=n}return i.__N||i.__}(kl,t)}function vl(t,e){var r=dl(Ya++,3);!nl.__s&&xl(r.__H,e)&&(r.__=t,r.u=e,Xa.__H.__h.push(r))}function fl(t){return rl=5,pl((function(){return{current:t}}),[])}function pl(t,e){var r=dl(Ya++,7);return xl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function gl(t){var e=Xa.context[t.__c],r=dl(Ya++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Xa)),e.props.value):t.__}function ml(){for(var t;t=il.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(_l),e.__h.some(wl),e.__h=[]}catch(r){e.__h=[],nl.__e(r,t.__v)}}}nl.__b=function(t){Xa=null,sl&&sl(t)},nl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),hl&&hl(t,e)},nl.__r=function(t){ol&&ol(t),Ya=0;var e=(Xa=t.__c).__H;e&&(tl===Xa?(e.__h=[],Xa.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&ml(),Ya=0)),tl=Xa},nl.diffed=function(t){al&&al(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==il.push(e)&&el===nl.requestAnimationFrame||((el=nl.requestAnimationFrame)||bl)(ml)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),tl=Xa=null},nl.__c=function(t,e){e.some((function(t){try{t.__h.some(_l),t.__h=t.__h.filter((function(t){return!t.__||wl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],nl.__e(r,t.__v)}})),ll&&ll(t,e)},nl.unmount=function(t){ul&&ul(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{_l(t)}catch(t){e=t}})),r.__H=void 0,e&&nl.__e(e,r.__v))};var yl="function"==typeof requestAnimationFrame;function bl(t){var e,r=function(){clearTimeout(i),yl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);yl&&(e=requestAnimationFrame(r))}function _l(t){var e=Xa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Xa=e}function wl(t){var e=Xa;t.__c=t.__(),Xa=e}function xl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function kl(t,e){return"function"==typeof e?e(t):e}function Sl(t){var e=!0;return{dispose(){if(e){e=!1;var r=t();r&&Tr(r.then)&&r.then(void 0,(()=>{}))}}}}var Cl="gzip-js",Ml="base64",Il="events",Tl="cancelEvents",El={Tab:"tab",Selector:"selector"},Rl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Pl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Ol={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Fl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Al={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},$l="always",Ll={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Dl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Nl="popover";function ql(t){return"$survey_response_"+t}function jl(t,e){if(!e)return null;var r=t[ql(e)];return Ir(r)?[...r]:r}function Hl(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Pr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=jl(t,e.id);Pr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:jl(t,e.id)})))},t,i)}function Bl(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}function Ul(t){return"string"==typeof t&&t.trim()?t.trim():null}function zl(t){return t.toLowerCase()}function Vl(t,e,r){if(!t||!e)return null;var i=zl(e),n=Object.keys(t).find((t=>zl(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>zl(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Wl(t,e,i){var n,s=Vl(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Pr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Pr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Pr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Pr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Pr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Pr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Pr(t.thankYouMessageHeader)&&Pr(t.thankYouMessageDescription)&&Pr(t.thankYouMessageCloseButtonText)&&Pr(t.submitButtonText)&&Pr(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Vl(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Pr(o.question)||(a.question=o.question,l=!0),Pr(o.description)||(a.description=o.description,l=!0),Pr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Pr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Pr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Pr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Ir(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function Zl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Gl(t){var e;return Zl(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ql=ys("[Surveys]");function Jl(t){return!(!t.start_date||t.end_date)}function Kl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Yl="seenSurvey_",Xl="inProgressSurvey_",tu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),eu=t=>tu(Yl,t),ru=t=>{try{var e=eu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ql.error("Failed to persist survey seen state",t)}},iu=[Ol.Popover,Ol.Widget,Ol.API],nu={ignoreConditions:!1,ignoreDelay:!1,displayType:Nl},su="$people_distinct_id",ou="$device_id",au="$device_model",lu="__alias",uu="__timers",hu="$autocapture_disabled_server_side",du="$heatmaps_enabled_server_side",cu="$exception_capture_enabled_server_side",vu="$error_tracking_suppression_rules",fu="$error_tracking_capture_extension_exceptions",pu="$web_vitals_enabled_server_side",gu="$dead_clicks_enabled_server_side",mu="$product_tours_enabled_server_side",yu="$web_vitals_allowed_metrics",bu="$session_recording_remote_config",_u="$replay_sample_rate",wu="$replay_override_sampling",xu="$replay_override_linked_flag",ku="$replay_override_url_trigger",Su="$replay_override_event_trigger",Cu="$sesid",Mu="$session_is_sampled",Iu="$enabled_feature_flags",Tu="$active_feature_flags",Eu="$early_access_features",Ru="$feature_flag_details",Pu="$feature_flag_payloads",Ou="$feature_flag_request_id",Fu="$minimal_flag_called_events",Au="$override_feature_flags",$u="$override_feature_flag_payloads",Lu="$stored_person_properties",Du="$stored_group_properties",Nu="$surveys",qu="$surveys_loaded_at",ju="$surveys_activated",Hu="$surveys_activated_session",Bu="ph_product_tours",Uu="$flag_call_reported",zu="$flag_call_reported_session_id",Vu="$feature_flag_errors",Wu="$feature_flag_evaluated_at",Zu="$user_state",Gu="$client_session_props",Qu="$capture_rate_limit",Ju="$initial_campaign_params",Ku="$initial_referrer_info",Yu="$initial_person_info",Xu="$epp",th="$posthog_cookieless",eh="$cookieless_mode",rh="$sdk_debug_extensions_init_method",ih="$sdk_debug_extensions_init_time_ms",nh="$sdk_debug_recording_script_not_loaded",sh="PostHog loadExternalDependency extension not found.",oh="on_reject",ah="always",lh="anonymous",uh="identified",hh="identified_only",dh="visibilitychange",ch="beforeunload",vh="$pageview",fh="$pageleave",ph="$identify",gh="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Lr(t)&&isFinite(t)&&Math.floor(t)===t});class mh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,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 mh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new mh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class yh{generate(){var t=this.generateOrAbort();if(!Pr(t))return t;this.S=0;var e=this.generateOrAbort();if(Pr(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.M++,this.M>4398046511103&&(this.S++,this.C())}return mh.fromFieldsV7(this.S,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.M=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}constructor(){this.S=0,this.M=0,this.I=new wh}}var bh,_h=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};is&&!Pr(is.crypto)&&crypto.getRandomValues&&(_h=t=>crypto.getRandomValues(t));class wh{nextUint32(){return this.R.length>this.O||(_h(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var xh=()=>kh().toString(),kh=()=>(bh||(bh=new yh)).generate(),Sh=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 Ch(t,e,r){return Rs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Mh={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=>Sh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Sh(e,t))))),icontains:(t,e)=>e.map(Ih).some((e=>t.map(Ih).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Ih).every((e=>t.map(Ih).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)))}))},Ih=t=>t.toLowerCase();function Th(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Pr(i)||Ar(i))return!1;var n=[String(i)],s=Mh[r.operator];return!!s&&s(r.values,n)}))}var Eh=t=>{if(os){try{for(var e=t+"=",r=os.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Rh="",Ph=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Oh={N:()=>!!os,P(t){ms.error("cookieStore error: "+t)},q:Eh,F(t){var e;try{e=JSON.parse(Oh.q(t))||{}}catch(t){}return e},A(t,e,r,i,n){if(!os)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=os),Rh)return Rh;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_"+xh();!Rh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Rh=s)}return Rh}(t);if(!r){var i=(t=>{var e=t.match(Ph);return e?e[0]:""})(t);i!==r&&ms.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(os.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ms.warn("cookieStore warning: large cookie, len="+u.length),os.cookie=u,!0}catch(t){return!1}},D(t,e){if(null!=os&&os.cookie)try{Oh.A(t,"",-1,e)}catch(t){return}}},Fh=null,Ah={N(){if(!Ar(Fh))return Fh;var t=!0;if(Pr(is))t=!1;else try{var e="__mplssupport__";Ah.A(e,"xyz"),'"xyz"'!==Ah.q(e)&&(t=!1),Ah.D(e)}catch(e){t=!1}return t||ms.error("localStorage unsupported; falling back to cookie store"),Fh=t,t},P(t){ms.error("localStorage error: "+t)},q(t){try{return null==is?void 0:is.localStorage.getItem(t)}catch(t){Ah.P(t)}return null},F(t){try{return JSON.parse(Ah.q(t))||{}}catch(t){}return null},A(t,e){try{return null==is||is.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ah.P(t)}return!1},D(t){try{null==is||is.localStorage.removeItem(t)}catch(t){Ah.P(t)}}},$h=[ou,"distinct_id",Cu,Mu,Xu,Yu,Zu],Lh={},Dh={N:()=>!0,P(t){ms.error("memoryStorage error: "+t)},q:t=>Lh[t]||null,F:t=>Lh[t]||null,A:(t,e)=>(Lh[t]=e,!0),D(t){delete Lh[t]}},Nh=null,qh={N(){if(!Ar(Nh))return Nh;if(Nh=!0,Pr(is))Nh=!1;else try{var t="__support__";qh.A(t,"xyz"),'"xyz"'!==qh.q(t)&&(Nh=!1),qh.D(t)}catch(t){Nh=!1}return Nh},P(t){ms.error("sessionStorage error: ",t)},q(t){try{return null==is?void 0:is.sessionStorage.getItem(t)}catch(t){qh.P(t)}return null},F(t){try{return JSON.parse(qh.q(t))||null}catch(t){}return null},A(t,e){try{return null==is||is.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){qh.P(t)}return!1},D(t){try{null==is||is.sessionStorage.removeItem(t)}catch(t){qh.P(t)}}},jh=ys("[Stylesheet Loader]"),Hh=is,Bh=os,Uh="#020617",zh={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:Rl.Right,widgetType:El.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Uh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Vh=[Rl.Center,Rl.Left,Rl.Right];function Wh(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 Zh(t){var e;void 0===t&&(t=zh.backgroundColor),"#"===t[0]&&(e=Wh(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=Wh(r)),!e)return Uh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Uh:"white"}return Uh}var Gh=(t,e,i)=>{var n=cd(t),s=Bh.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Bh.createElement("div");((t,e,i)=>{var n=r({},zh,i),s=t.style,o=!Vh.includes(n.position)||e===Ol.Widget&&(null==i?void 0:i.widgetType)===El.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Zh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Zh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Zh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Zh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Zh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Tr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(jh.error("prepare_external_dependency_stylesheet returned null"),null)})(Bh,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.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-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Bh.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Qh=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(ru(i),s.capture(Ll.SENT,r({[Dl.SURVEY_NAME]:i.name,[Dl.SURVEY_ID]:i.id,[Dl.SURVEY_ITERATION]:i.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Dl.SURVEY_SUBMISSION_ID]:n,[Dl.SURVEY_COMPLETED]:o},l&&{[Dl.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Hl(e,i),a,{$set:{[Bl(i,"responded")]:!0}})),o&&(Hh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),dd(i),s.reloadFeatureFlags())):Ql.error("[survey sent] event not captured, PostHog instance not found.")},Jh=(t,e,i)=>{return r({[Dl.SURVEY_NAME]:t.name,[Dl.SURVEY_ID]:t.id,[Dl.SURVEY_ITERATION]:t.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Dl.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!$r(t))))},(null==e?void 0:e.surveyLanguage)&&{[Dl.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Dl.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Hl(null==e?void 0:e.responses,t));var n},Kh=(t,e,i,n)=>{if(e){if(!i){var s=ud(t);e.capture(Ll.DISMISSED,r({},Jh(t,s,e),n&&{[Dl.SURVEY_LANGUAGE]:n},{$set:{[Bl(t,"dismissed")]:!0}})),dd(t),ru(t),Hh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ql.error("[survey dismissed] event not captured, PostHog instance not found.")},Yh=(t,e)=>{if(e){var r=(t=>tu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=ud(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Ll.ABANDONED,Jh(t,i,e),{transport:"sendBeacon"})}}else Ql.error("[survey abandoned] event not captured, PostHog instance not found.")},Xh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),td=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ed=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?td(t.questions,Xh(t.questions)):t.questions,rd=t=>Gl(t)||hd(t),id=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,$a(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"+xa++,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(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),nd=()=>gl(id),sd=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=Ia({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?la.call(arguments,2):r),Ra(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function od(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Bs(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return Mh[o](s,[n])}var ad=t=>tu(Xl,t),ld=(t,e)=>{try{localStorage.setItem(ad(t),JSON.stringify(e))}catch(t){Ql.error("Error setting in-progress survey state in localStorage",t)}},ud=t=>{try{var e=localStorage.getItem(ad(t));if(e)return JSON.parse(e)}catch(t){Ql.error("Error getting in-progress survey state from localStorage",t)}return null},hd=t=>{var e=ud(t);return!$r(null==e?void 0:e.surveySubmissionId)},dd=t=>{try{localStorage.removeItem(ad(t))}catch(t){Ql.error("Error clearing in-progress survey state from localStorage",t)}};function cd(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function vd(t,e,r){if(void 0===e&&(e=Rl.Right),t===Ol.ExternalSurvey)return{};switch(e){case Rl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Rl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Rl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Rl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Rl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Rl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Rl.Left:return{left:"30px"};case Rl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ol.Widget&&r===El.Tab?"60px":"30px"}}}var fd=0;function pd(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--fd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ua.vnode&&ua.vnode(u),u}var gd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),md=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),yd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),bd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),_d=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),wd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:pd("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"})}),xd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:pd("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"})}),kd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return pd("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[pd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),pd("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:r})]})},Sd=pd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[pd("g",{"clip-path":"url(#clip0_2415_6911)",children:[pd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:pd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),pd("g",{mask:"url(#mask0_2415_6911)",children:[pd("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"}),pd("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"}),pd("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"}),pd("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"}),pd("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"}),pd("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"})]})]}),pd("defs",{children:pd("clipPath",{id:"clip0_2415_6911",children:pd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Cd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return pd("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Sd]})}function Md(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=gl(id).isPreviewMode,d=!!l&&!!u,c=!a&&pd("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==is||is.open(s)),h?null==o||o():n()},children:e});return pd("div",{className:"bottom-section",children:[d?pd("div",{className:"form-buttons form-buttons-with-back",children:[pd("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&pd(Cd,{urlParams:{utm_source:"survey-footer"}})]})}function Id(t){var e=t.question,r=t.forceDisableHtml;return pd("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[pd(e.type===Fl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&sd({component:Ea("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Td(t){return pd("button",{className:"form-cancel",onClick:t.onClick,disabled:gl(id).isPreviewMode,"aria-label":"Close survey",type:"button",children:kd({fill:"black"})})}pd("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:pd("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 Ed=is;function Rd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=gl(id).isPopup;return vl((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ts(Ed,"keydown",t),()=>{Ed.removeEventListener("keydown",t)}}),[o]),pd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&pd(Td,{onClick:()=>o()}),pd("h3",{className:"thank-you-message-header",children:e}),r&&sd({component:Ea("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&pd(Md,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Pd=t=>Ir(t)&&t.every((t=>Or(t)));function Od(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=nd().isPreviewMode,d=fl(null),c=cl((()=>Or(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;vl((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=pl((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case ar:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case lr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),y=wn(e.validation,ar),b=wn(e.validation,lr),_=pl((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:e,forceDisableHtml:r,htmlFor:g}),pd("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),_&&pd("div",{className:"validation-hint",children:_})]}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Fd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return pd(Pa,{children:[pd("div",{className:"question-container",children:pd(Id,{question:e,forceDisableHtml:t.forceDisableHtml})}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Ad(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=cl((()=>Lr(l)?l:Ir(l)&&l.length>0&&Lr(parseInt(l[0]))?parseInt(l[0]):Or(l)&&Lr(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=nd().isPreviewMode,y=t=>m?a(t):o(t);return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:r,forceDisableHtml:i}),pd("div",{className:"rating-section",children:[pd("div",{className:"rating-options",children:["emoji"===r.display&&pd("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=jd[r.scale])?void 0:e.map(((t,e)=>pd("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&pd("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Hd(r.scale).map(((t,e)=>pd($d,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&pd("div",{className:"rating-text",children:[pd("div",{children:r.lowerBoundLabel}),pd("div",{children:r.upperBoundLabel})]})]})]}),pd(Md,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ar(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function $d(t){var e=t.num,r=t.setActiveNumber;return pd("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function Ld(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=fl(null),c=pl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=td(e,Xh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=cl((()=>((t,e)=>Or(t)||Pd(t)?t:e===Fl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=cl((()=>((t,e)=>{if(Or(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Pd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=nd().isPreviewMode,_=e.type===Fl.SingleChoice,w=e.type===Fl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),b&&a(t)));w&&Ir(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},M=()=>!(e.optional||!Ar(f)&&(!Ir(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),I=()=>{m.isSelected&&w?Ir(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:e,forceDisableHtml:i}),pd("fieldset",{className:"multiple-choice-options limit-height",children:[pd("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===t:Ir(f)&&f.includes(t);return pd("label",{className:i?"choice-option-open":"",children:[pd("div",{className:"response-choice",children:[pd("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(t,i),id:s,"aria-controls":o}),pd("span",{children:i?t+":":t})]}),i&&pd("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:s,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Dd=[1,2,3,4,5],Nd=[1,2,3,4,5,6,7],qd=[0,1,2,3,4,5,6,7,8,9,10],jd={2:[wd,xd],3:[yd,md,gd],5:[bd,yd,md,gd,_d]};function Hd(t){switch(t){case 5:default:return Dd;case 7:return Nd;case 10:return qd}}var Bd=ys("[Surveys]");function Ud(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Al.End:s;if(n.branching.type===Al.End)return Al.End;if(n.branching.type===Al.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Al.ResponseBased){if(n.type===Fl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Al.End?Al.End:s}}else if(n.type===Fl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Al.End?Al.End:s}}return s}return Bd.warn("Falling back to next question index due to unexpected branching type"),s}var zd="https?://(.*)",Vd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Wd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Vd],Zd="<masked>",Gd=["li_fat_id"];function Qd(t,e,r){if(!os)return{};var i,n=e?[...Vd,...r||[]]:[],s=Jd(As(os.URL,n,Zd),t),o=(i={},_s(Gd,(function(t){var e=Eh(t);i[t]=e||null})),i);return ws(o,s)}function Jd(t,e){var r=Wd.concat(e||[]),i={};return _s(r,(function(e){var r=Fs(t,e);i[e]=r||null})),i}function Kd(t){var e=function(t){return t?0===t.search(zd+"google.([^/?]*)")?"google":0===t.search(zd+"bing.com")?"bing":0===t.search(zd+"yahoo.com")?"yahoo":0===t.search(zd+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Ar(e)){i.$search_engine=e;var n=os?Fs(os.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Yd(){return navigator.language||navigator.userLanguage}var Xd="$direct";function tc(){return(null==os?void 0:os.referrer)||Xd}function ec(t,e,r){void 0===r&&(r=!1);var i=t?[...Vd,...e||[]]:[],n=r?nn(null==as?void 0:as.href):null==as?void 0:as.href,s=null==n?void 0:n.substring(0,1e3);return{r:tc().substring(0,1e3),u:s?As(s,i,Zd):void 0}}function rc(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?nn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==Xd?Xd:null==(r=Ps(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ps(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=Jd(s);ws(o,l)}if(i){var u=Kd(i);ws(o,u)}return o}function ic(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function nc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var sc=ys("[SurveyTranslations]");function oc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=Ul(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Ul(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Ul(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Tr(t.get_property)?t.get_property(Lu):void 0,locale:Yd()},sc)}(e);if(!r)return sc.info("No user language detected"),{survey:t,language:null};var i=Wl(t,r,sc);return{survey:i.survey,language:i.matchedKey}}var ac=is,lc=os,uc="ph:show_survey_widget",hc="PHWidgetSurveyClickListener";function dc(t,e){try{var r=t.getBoundingClientRect(),i=ac.innerHeight,n=ac.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:zh.zIndex}}catch(t){return Ql.warn("Failed to calculate trigger position:",t),null}}class cc{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Nu);if(t)for(var e of t)hd(e)&&Yh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=this.U(t),l=a.survey,u=a.language,h=null!=e&&e.position||null!=e&&e.selector?r({},l,{appearance:r({},l.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):l;this.W(h.id);var d=null!=e?e:{},c=d.properties,v=d.initialResponses,f=!(!v||0>=Object.keys(v).length)&&this.V(h,v,c,u);if(!f||null!=(i=h.appearance)&&i.displayThankYouMessage){this.Z(h);var p={};if((null==(n=h.appearance)?void 0:n.position)===Rl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=lc.querySelector(h.appearance.widgetSelector);m&&(p=dc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||zh.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,b=Gh(h,this._posthog).shadow,_={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=y)return Ka(pd(gc,r({},_)),b);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Ql.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Ka(pd(gc,r({},_,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),b)}),1e3*y);this.j.set(h.id,w)}},this.Y=t=>{var e=this.U(t),r=e.survey,i=e.language,n=Gh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Ka(pd(yc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.K=t=>{this.J(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(hc),this.H.delete(t.id),Ql.info("Removed click listener for survey "+t.id))},this.X=(t,e)=>{var r=lc.querySelector(e),i=this.H.get(t.id);if(r){if(this.Y(t),i){if(r===i.element)return;Ql.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.K(t)}if(!r.hasAttribute(hc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Rl.NextToTrigger?dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||zh.maxWidth)):{};ac.dispatchEvent(new CustomEvent(uc,{detail:{surveyId:t.id,position:n}}))};Ts(r,"click",n),r.setAttribute(hc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ql.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.K(t)},this.renderPopover=t=>{var e=this.U(t),r=e.survey,i=e.language,n=Gh(r,this._posthog).shadow;Ka(pd(gc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.U(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o,r)),Ka(pd(gc,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.G(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Ol.Popover||t.type===Ol.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.j.keys()))i.has(n)||e.cancelSurvey(n);var s=e.te(r),o=new Set;s.forEach((t=>{if(t.type===Ol.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===El.Tab)return void e.Y(t);(null==(i=t.appearance)?void 0:i.widgetType)===El.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.X(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ar(e.re)&&t.type===Ol.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var r=t.survey;o.has(r.id)||e.K(r)}))}),t)},this.Z=t=>{Ar(this.re)||Ql.error("Survey "+this.re+" already in focus. Cannot add survey "+t.id+"."),this.re=t.id},this.$=t=>{this.re!==t.id&&Ql.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.W(t.id),this.re=null,this.J(t)},this._posthog=t,this.re=null}W(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Ql.info("Cancelled pending survey "+t),this.W(t),this.re===t&&(this.re=null))}te(t){return t.sort(((t,e)=>{var r,i,n=hd(t),s=hd(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===$l,a=e.schedule===$l;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(t){return oc(t,this._posthog)}ee(t,e,r){if(this.B.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Pr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(ac.location.search),n=i.params;if(0===Object.keys(n).length)return!1;Ql.info("[Survey Prefill] Detected URL prefill parameters");var s=this.ne(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&Qh({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:e}),this.B.add(t.id),l}V(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Ir(o)?o.map(String):[String(o)]}Ql.info("[Survey] Processing initial responses");var a=this.ne(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Qh({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=ql(t.id);try{switch(t.type){case Fl.SingleChoice:if(!t.choices||0===t.choices.length)return void ms.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void ms.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Fl.MultipleChoice:if(!t.choices||0===t.choices.length)return void ms.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void ms.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&ms.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Fl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void ms.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:ms.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ms.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ql.warn("[Survey Prefill] No valid responses after conversion"),null;var n=xh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>i&&o>a&&(a++,e.includes(i));){var l=t.questions[i];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ql(l.id);Pr(r[u])||(n[u]=r[u])}s.push(i);var h=Ud(t,i,l.id?r[ql(l.id)]:null);if(h===Al.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:s}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return ld(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:r}),Ql.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return Ql.error("[Survey Prefill] Error handling prefill:",t),null}}ie(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ae(t){return!t.conditions||od(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!cs)return!1;var s=tn(cs,{userAgentDataPlatform:null==ss||null==(r=ss.userAgentData)?void 0:r.platform,maxTouchPoints:null==ss?void 0:ss.maxTouchPoints,screenWidth:null==is||null==(i=is.screen)?void 0:i.width,screenHeight:null==is||null==(n=is.screen)?void 0:n.height,devicePixelRatio:null==is?void 0:is.devicePixelRatio});return Mh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Bh||!Bh.querySelector(t.conditions.selector))}(t)}oe(t){var e;return rd(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ie(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Jl(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!iu.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;if(!this.ie(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ie(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ah.q("lastSeenSurveyDate"))?(t=>!!Ah.q(eu(t))&&!rd(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=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.se(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}se(t){var e;if(!Zl(t)&&!Kl(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}ue(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ie(e)}))}G(t){return this.checkSurveyEligibility(t).eligible&&this.ae(t)&&this.se(t)&&this.ue(t)}J(t){try{var e=lc.querySelector(cd(t,!0));null!=e&&e.shadowRoot&&Ka(null,e.shadowRoot),null==e||e.remove()}catch(e){Ql.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.j,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function vc(t,e){if(lc&&ac){var r,i=new cc(t);if(t.config.disable_surveys_automatic_display)return Ql.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ql.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Pr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Ts(lc,"visibilitychange",(()=>{lc.hidden?Pr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function fc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;vl((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Ol.Widget,s=od(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===El.Tab&&r;if(!s)return Ql.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(Ql.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ts(ac,"popstate",r),Ts(ac,"hashchange",r);var s=ac.history.pushState,l=ac.history.replaceState;return ac.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},ac.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{ac.removeEventListener("popstate",r),ac.removeEventListener("hashchange",r),ac.history.pushState=s,ac.history.replaceState=l}}}),[o,e,i,n,a])}function pc(t){switch(void 0===t&&(t=Pl.Right),t){case Pl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Pl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Pl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function gc(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,M=t.properties,I=t.isSurveyCompleted,T=t.skipShownEvent,E=t.surveyLanguage,R=fl(null),P=Number.isInteger(v),O=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,F=function(t,e,i,n,s,o,a,l,u){var h=cl(n||0===i||t.type===Ol.ExternalSurvey),d=h[0],c=h[1],v=cl(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};lc.startViewTransition?lc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return vl((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(od(t,e)){c(!0),ac.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Ll.SHOWN,r({[Dl.SURVEY_NAME]:t.name,[Dl.SURVEY_ID]:t.id,[Dl.SURVEY_ITERATION]:t.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[Dl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Ts(ac,"PHSurveyClosed",m),Ts(ac,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),ac.removeEventListener("PHSurveyClosed",m),ac.removeEventListener("PHSurveySent",s)}}return o(),()=>{ac.removeEventListener("PHSurveyClosed",m),ac.removeEventListener("PHSurveySent",s)}}}else Ql.error("usePopupVisibility hook called without a PostHog instance.")}),[]),fc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,T,E),A=F.isPopupVisible,L=F.hidePopupWithViewTransition,D=F.isSurveySent||v===l.questions.length||!0===I,N=pl((()=>{var t=ud(l),e=(null==t?void 0:t.surveySubmissionId)||xh();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){E?Kh(l,h,P,E):Kh(l,h,P),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:M,surveyLanguage:E}}),[P,v,m,h,l,k,b,w,M,E]);return A?pd(id.Provider,{value:N,children:pd("div",{className:"ph-survey",style:r({},vd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:D?pd(Rd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||zh,onClose(){L(),C()}}):pd(mc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function mc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=cl((()=>{var t=ud(n);return null!=t&&t.responses&&Ql.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),l=a[0],u=a[1],h=gl(id),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,b=h.surveyLanguage,_=cl((()=>{var t=ud(n);return d||(null==t?void 0:t.lastQuestionIndex)||0})),w=_[0],x=_[1],k=cl((()=>{var t,e=ud(n);return null!==(t=null==e?void 0:e.visitedIndices)&&void 0!==t?t:[]})),S=k[0],C=k[1],M=pl((()=>ed(n)),[n]);vl((()=>{m&&!Pr(d)&&x(d)}),[d,m]);var I=!(null==(e=n.appearance)||!e.allowGoBack)&&(m?(null!=d?d:0)>0:S.length>0),T=M.at(w);return T?pd("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&pd(Td,{onClick(){c()}}),pd("div",{className:"survey-box","data-question-index":w,children:bc({question:T,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||zh,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=ql(s),h=r({},l,{[a]:e});u(h);var d=Ud(n,i,e),c=d===Al.End,v=[...S,i];if(c||(C(v),x(d),ld(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:b})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=M[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ql(t)))),p=Object.fromEntries(Object.entries(h).filter((t=>f.has(t[0]))));Qh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:b})}}else Ql.error("onNextButtonClick called without a questionId.");else Ql.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:w,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?l[ql(T.id)]:void 0,canGoBack:I,onBack(){if(m)p();else if(0!==S.length){var t=S[S.length-1],e=S.slice(0,-1);C(e),x(t),ld(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:b})}}})})]}):null}function yc(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=cl(!0),f=v[0],p=v[1],g=cl(!1),m=g[0],y=g[1],b=cl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(vl((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(Ql.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Ts(ac,uc,e),()=>{ac.removeEventListener(uc,e)}}}else Ql.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),fc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==$l&&p(!1),setTimeout((()=>{y(!1)}),200)};return pd(Pa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&pd("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Pl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:pc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&pd(gc,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var bc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Fl.Open:return Ea(Od,r({},s,{question:e,key:e.id}));case Fl.Link:return Ea(Fd,r({},s,{question:e,key:e.id}));case Fl.Rating:return Ea(Ad,r({},s,{question:e,key:e.id}));case Fl.SingleChoice:case Fl.MultipleChoice:return Ea(Ld,r({},s,{question:e,key:e.id}));default:return Ql.error("Unsupported question type: "+e.type),null}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.generateSurveys=vc,aa.extendPostHogWithSurveys=vc;var _c=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),wc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return _c(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return _c(e,JSON.stringify(t.slice(0,n)),r)},xc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,kc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Sc=(t,e,r)=>{if(!r.truncated)if(Er(t)){if(r.seen.has(t))return void kc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Sc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else kc(e,t,r)},Cc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!xc(t))return!n||_c(e,"null",r);if(Ar(t)||(t=>{try{return Lr(t)||Nr(t)}catch(t){return!1}})(t))return _c(e,JSON.stringify(t),r);if("string"==typeof t)return wc(t,e,r);if(!Er(t)&&!Ir(t))return _c(e,JSON.stringify(t),r);if(i.has(t))return wc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Tr(o))return Cc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return wc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return _c(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Cc(l,e,r,i,n,s)}if(Ir(t)){if(!_c(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!_c(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Cc(d,e,r,i,!0))return!1}return _c(e,"]",r)}if(!_c(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{Sc(f,v,s)}catch(t){}if(xc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!_c(e,p,r))return!1;var b=e.length,_=Cc(f,e,r,i,!1),w=r.truncated;if(e.length!==b){if(c=!1,!_)return!1}else if(e.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(t){}return _c(e,"}",r)},Mc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.logs={initializeLogs(t){var e={host:aa.location.host},i=!1,n=function(n){var s=aa.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Er(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||_c(r," ",i))&&Cc(t[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.le({level:Mc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(aa.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),aa.console[n]=o};for(var s of Object.keys(Mc))n(s)}};var Ic=ys("[Error tracking]");function Tc(){return new Mn([new qn,new Qn,new Hn,new jn,new Zn,new Wn,new Un,new Gn],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Dn.test(l)?l.replace(Dn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=Nn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Nn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||In});var i}))}(s)}}("web:javascript",Fn,Ln))}var Ec=ys("[ExceptionAutocapture]"),Rc=Tc(),Pc={wrapOnError(t){var e=is;e||Ec.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){var e,i=Rc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return t(i),!!Tr(r)&&null!==(e=r(...arguments))&&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=is;e||Ec.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Rc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Tr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||Ec.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Rc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Tr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.errorWrappingFunctions=Pc,aa.posthogErrorWrappingFunctions=Pc;var Oc="X-POSTHOG-SESSION-ID",Fc="X-POSTHOG-WINDOW-ID",Ac="X-POSTHOG-DISTINCT-ID",$c=[Oc,Fc,Ac],Lc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Dc=(t,e)=>({}.hasOwnProperty.call(t,e)),Nc=t=>"object"==typeof t&&!Ar(t)||Tr(t),qc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),jc=t=>{try{var e;return qc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==is||null==(e=is.location)?void 0:e.href).toString()}catch(t){return}},Hc=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(Ir(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Oc,a.sessionId),n.set(Fc,l),o=!0}var u=(t=>Tr(t)?t():t)(e);return u&&u!==th&&(n.set(Ac,u),o=!0),o};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{};var Bc={_patchFetch:(t,e,i)=>qs(is,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=jc(s);if(u)if(qc(s)){var h=new Request(s,o);Hc(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Nc(o)?o.headers:void 0);if(Hc(t,e,i,u,d)){var c=((t,e)=>{if(Pr(t)||Ar(t))return{headers:e};if(Nc(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Dc(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Dc(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Lc.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Lc.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,r)=>qs(is.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=jc(s);d&&Hc(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return $c.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};aa.__PosthogExtensions__.tracingHeadersPatchFns=Bc,aa.postHogTracingHeadersPatchFns=Bc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Uc=-1,zc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Uc=e.timeStamp,t(e))}),!0)},Vc=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Wc=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Zc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Gc=()=>{var t,e;return null!==(t=null==(e=Zc())?void 0:e.activationStart)&&void 0!==t?t:0},Qc=function(t,e){void 0===e&&(e=-1);var r=Zc(),i="navigate";return 0>Uc?r&&(document.prerendering||Gc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Jc=new WeakMap;function Kc(t,e){var r=Jc.get(e);return r||(r=new WeakMap,Jc.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Yc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Xc,tv=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},ev=t=>{var e=!1;return()=>{e||(t(),e=!0)}},rv=-1,iv=new Set,nv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,sv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of iv)e();isFinite(rv)||(rv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",sv,!0))}},ov=()=>{if(0>rv){var t,e=Gc(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;rv=null!=r?r:nv(),addEventListener("visibilitychange",sv,!0),addEventListener("prerenderingchange",sv,!0),zc((()=>{setTimeout((()=>{rv=nv()}))}))}return{get firstHiddenTime(){return rv},onHidden(t){iv.add(t)}}},av=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},lv=[1800,3e3],uv=function(t,e){void 0===e&&(e={}),av((()=>{var r,i=ov(),n=Qc("FCP"),s=tv("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Gc(),0),n.entries.push(e),r(!0)))}));s&&(r=Vc(t,n,lv,e.reportAllChanges),zc((i=>{n=Qc("FCP"),r=Vc(t,n,lv,e.reportAllChanges),Wc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},hv=[.1,.25],dv=0,cv=1/0,vv=0,fv=t=>{for(var e of t)e.interactionId&&(cv=Math.min(cv,e.interactionId),vv=Math.max(vv,e.interactionId),dv=vv?(vv-cv)/7+1:0)},pv=()=>{var t;return Xc?dv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},gv=0;class mv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){gv=pv(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((pv()-gv)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var yv=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=ev(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},bv=[200,500];class _v{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var wv=[2500,4e3],xv={onLCP(t,e){void 0===e&&(e={}),av((()=>{var r,i=ov(),n=Qc("LCP"),s=Kc(e,_v),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Gc(),0),n.entries=[o],r())},a=tv("largest-contentful-paint",o);if(a){r=Vc(t,n,wv,e.reportAllChanges);var l=ev((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(yv(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});zc((i=>{n=Qc("LCP"),r=Vc(t,n,wv,e.reportAllChanges),Wc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=ov();uv(ev((()=>{var i,n=Qc("CLS",0),s=Kc(e,Yc),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=tv("layout-shift",o);a&&(i=Vc(t,n,hv,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),zc((()=>{s.i=0,n=Qc("CLS",0),i=Vc(t,n,hv,e.reportAllChanges),Wc(i)})),setTimeout(i))})))},onFCP:uv,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=ov();av((()=>{var i;"interactionCount"in performance||Xc||(Xc=tv("event",fv,{durationThreshold:0}));var n,s=Qc("INP"),o=Kc(e,mv),a=t=>{yv((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=tv("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Vc(t,s,bv,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),zc((()=>{o.v(),s=Qc("INP"),n=Vc(t,s,bv,e.reportAllChanges)})))}))}}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.postHogWebVitalsCallbacks=xv,aa.postHogWebVitalsCallbacks=xv,aa.__PosthogExtensions__.loadWebVitalsCallbacks=()=>xv;class kv{constructor(t){this.disabled=!1===t;var e=Er(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var Sv="$copy_autocapture",Cv=ys("[AutoCapture]");function Mv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Iv(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Gs(e));return e}function Tv(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!Gs(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!Qs(v,"body")&&Ys>d.length;)if(Ks(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Gs(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(_s(d,(t=>{var e=bo(t);if(Qs(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&To(r))&&(h?nn(r):r)}_r(eo(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};so.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Mv(1024,Eo(t)):Mv(1024,io(t)));var a=eo(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),_s(t.attributes,(function(r){var s;if((!_o(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&To(r.value)&&(!Or(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Xs(a).join(" ")),o["attr__"+r.name]=Mv(1024,"href"===r.name&&n?nn(a):a)}}));for(var l=1,u=1,h=t;h=Iv(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!bo(t))return{};var e={};return _s(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&&To(i)&&(e[r]=i)}})),e}(t);ws(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=Qs(t,"a")||Qs(t,"button")?Eo(t):io(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ps(b))?void 0:w.host,S=null==is||null==(x=is.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:ws({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return xs(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Po(t[0].toString())]=Po(e.toString())})),(n+=":")+xs(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).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:Oo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return xs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var Ev={};function Rv(t,e){var r=Ev[t];if(r)return r;var i=e[t];if((t=>Tr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==is||!is.Zone))return Ev[t]=i.bind(e);var n=e.document;if(n&&Tr(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,l,u=s.contentWindow;u&&u[t]&&(i=u[t],"MutationObserver"===t&&function(t){return _r(t,"AppleWebKit")&&!_r(t,"Chrome")}(null!==(a=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){ms.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!o&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return i&&Tr(i)?Ev[t]=i.bind(e):i}function Pv(t,e){var i=no(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Ov(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Fv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Av="canvas,video,audio,embed,object";function $v(t,e){return Lr(t)&&t>=e}class Lv{ce(t){var e,r,i,n,s,o,a,l,u=this.de((null==t?void 0:t.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.ve=[],this.fe=0,this.de=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.pe=t=>{var e=Pv(t,{type:"click"});Ar(e)||this.me(e)||this.ve.push(e),this.ye()},this.ge=()=>{var t=Date.now();this.be=t,t%50==0&&this.ve.forEach((e=>{Pr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.we=()=>{this.ke=Date.now()},this.xe=()=>{"visible"===(null==os?void 0:os.visibilityState)&&(this.Se=Date.now())},this.Ce=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this._e=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Me=()=>{this._e=void 0},this.Ie=t=>{var e,r=this._e;if(this._e=void 0,!Pr(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Te.swipe_threshold_px;if(a>=l*l&&![this.be,this.Re,this.ke].some((t=>Lr(t)&&t>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==os||null==os.elementsFromPoint?void 0:os.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(Av))))return;var h=Pv(i,{type:"swipe",swipeDirection:Ov(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ar(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=t,this.Te=this.ce(e),this._onCapture=this.Te.__onCapture}start(t){this.Le(),this.Oe(),this.Ne(),this.Ae(),this.qe(t),this.Te.capture_dead_swipes&&this.De()}qe(t){if(!this.Pe){var e=function(t){return Rv("MutationObserver",t)}(aa);this.Pe=new e((t=>{this.Fe(t)})),this.Pe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Pe)||t.disconnect(),this.Pe=void 0,aa.removeEventListener("click",this.pe),aa.removeEventListener("scroll",this.ge,{capture:!0}),aa.removeEventListener("selectionchange",this.we),aa.removeEventListener("touchstart",this.Ce,{capture:!0}),aa.removeEventListener("touchend",this.Ie,{capture:!0}),aa.removeEventListener("touchcancel",this.Me,{capture:!0}),null==os||os.removeEventListener("visibilitychange",this.xe),this._e=void 0}Fe(t){this.Re=Date.now()}Le(){Ts(aa,"click",this.pe)}ye(){this.ve.length&&Pr(this.je)&&(this.je=aa.setTimeout((()=>{this.He()}),1e3))}Oe(){Ts(aa,"scroll",this.ge,{capture:!0})}Ne(){Ts(aa,"selectionchange",this.we)}Ae(){Ts(os,"visibilitychange",this.xe)}De(){Ts(aa,"touchstart",this.Ce,{capture:!0,passive:!0}),Ts(aa,"touchend",this.Ie,{capture:!0,passive:!0}),Ts(aa,"touchcancel",this.Me,{capture:!0,passive:!0})}Ee(){var t=Pr(this.Be)||Lr(this.Re)&&this.Re>this.Be;return(Pr(this.Ue)||t)&&(this.Be=Date.now(),this.Ue=!(null==os||!os.querySelector(Av))),!!this.Ue}me(t){return!t||("swipe"===t.type?this.We(t):this.Ve(t))}We(t){if(Zs(t.node))return!0;var e=this.ve.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!Qs(t.node,"html")&&Gs(t.node)&&function(t,e){var r;if(!is||mo(t))return!1;var i=Nr(e)?vo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:vo;return!oo(yo(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(t){return!(this.Te.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.We(t)||(r=t.node,!(!is||mo(r))&&yo(r,!1).targetElementList.some((t=>Qs(t,"a"))));var e,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var t=this.ve;for(var e of(this.ve=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=e.timestamp?this.Re-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.ke&&this.ke>=e.timestamp?this.ke-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Se?Math.abs(e.timestamp-this.Se):void 0;var i=$v(e.scrollDelayMs,this.Te.scroll_threshold_ms),n=$v(e.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=$v(e.mutationDelayMs,this.Te.mutation_threshold_ms),o=$v(e.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=Lr(e.scrollDelayMs)&&this.Te.scroll_threshold_ms>e.scrollDelayMs,l=Lr(e.mutationDelayMs)&&this.Te.mutation_threshold_ms>e.mutationDelayMs,u=Lr(e.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Lr(e.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=$v(e.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=Fv(e);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:e.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Te.mutation_threshold_ms>e.absoluteDelayMs&&this.ve.push(e)}}this.ye()}}he(t,e){var i=Fv(t);this.instance.capture(i,r({},e,Tv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lv(t,e);var Dv=ys("[ExternalScriptsLoader]"),Nv=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Dv.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==os?void 0:os.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!os)return r("document not found");var i=os.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)os.head.appendChild(i);else{var n,s=os.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):os.body.appendChild(i)}};null!=os&&os.body?a():null==os||os.addEventListener("DOMContentLoaded",a)};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}Nv(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Nv(t,o,r)}},aa.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Nv(t,i,r)};ps.DEBUG=!1,ps.LIB_VERSION="1.410.2",ps.LIB_NAME="web";class qv{constructor(t){this._instance=t}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===ah||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===oh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(t){this.Je.A(this.Ke,t?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.D(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get Qe(){var t=this.Je.q(this.Ke);return Wr(t)?1:_r(Zr,t)?0:-1}get Je(){var t=this.Te.opt_out_capturing_persistence_type,e="localStorage"===t?Ah:Oh;if(!this.Ye||this.Ye!==e){this.Ye=e;var r="localStorage"===t?Oh:Ah;r.q(this.Ke)&&(this.Ye.q(this.Ke)||this.optInOut(Wr(r.q(this.Ke))),r.D(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[null==ss?void 0:ss.doNotTrack,null==ss?void 0:ss.msDoNotTrack,aa.doNotTrack].some((t=>Wr(t)))}}var jv=ys("[Dead Clicks]"),Hv=()=>!0,Bv=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(gu)),i=t.instance.config.capture_dead_clicks;return Nr(i)?i:!!Er(i)||r};class Uv{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[gu]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr((()=>{this.er()})):this.stop()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?jv.error("failed to load script",e):t()}))}er(){var t;if(os){if(!this.Xe&&null!=(t=aa.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Er(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Xe=aa.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xe.start(os),jv.info("starting...")}}else jv.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,jv.info("stopping..."))}}var zv=ys("[SegmentIntegration]");var Vv="posthog-js";function Wv(t,e){var i=void 0===e?{}:e,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Zv{constructor(t,e,r,i,n,s){this.name=Vv,this.setupOnce=function(o){o(Wv(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Gv{constructor(t){this.rr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ms.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.nr()}nr(){var t;this.sr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.rr)}destroy(){var t;null==(t=this.sr)||t.call(this),this.sr=void 0}doPageView(t,e){var r,i=this.ar(t,e);return this.ir={pathname:null!==(r=null==is?void 0:is.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ar(t,null==(e=this.ir)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ir)?void 0:t.pageViewId}}ar(t,e){var r=this.ir;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 s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Pr(s)||Pr(o)||Pr(a)||Pr(l)||Pr(u)||Pr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Gr(o/s,0,1,ms):1,c=s>1?Gr(a/s,0,1,ms):1,v=l>1?Gr(u/l,0,1,ms):1,f=l>1?Gr(h/l,0,1,ms):1;i=ws(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Qv=["flags","surveys"],Jv={[su]:{exposure:"hidden"},[lu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[uu]:{exposure:"hidden"},[hu]:{exposure:"event"},[du]:{exposure:"hidden"},[cu]:{exposure:"event"},[vu]:{exposure:"hidden"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[gu]:{exposure:"event"},[mu]:{exposure:"hidden"},[yu]:{exposure:"event"},[bu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Cu]:{exposure:"hidden"},[Mu]:{exposure:"event"},[_u]:{exposure:"event",shouldSkipFromEventProperties:t=>Ar(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Iu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Er(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Tu]:{exposure:"event",storageGroup:"flags"},[Eu]:{exposure:"hidden"},[Ru]:{exposure:"hidden",storageGroup:"flags"},[Pu]:{exposure:"event",storageGroup:"flags"},[Ou]:{exposure:"event",storageGroup:"flags",volatile:!0},[Fu]:{exposure:"hidden",storageGroup:"flags"},[Au]:{exposure:"event"},[$u]:{exposure:"hidden"},[Lu]:{exposure:"hidden"},[Du]:{exposure:"hidden"},[Nu]:{exposure:"hidden",storageGroup:"surveys"},[qu]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ju]:{exposure:"event"},[Hu]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Uu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Vu]:{exposure:"hidden"},[Wu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Zu]:{exposure:"hidden"},[Gu]:{exposure:"hidden"},[Qu]:{exposure:"hidden"},[Ju]:{exposure:"hidden"},[Ku]:{exposure:"hidden"},[Yu]:{exposure:"hidden"},[Xu]:{exposure:"hidden"},[wu]:{exposure:"event"},[xu]:{exposure:"event"},[ku]:{exposure:"event"},[Su]:{exposure:"event"},[rh]:{exposure:"event"},[ih]:{exposure:"event"},[nh]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Kv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Yv=t=>{var e=Jv[t];if(e)return e;for(var r of Kv){var i=r[1];if(0===t.indexOf(r[0]))return i}},Xv={flags:Wu,surveys:qu},tf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ef="main";class rf{constructor(t,e,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=t,this.dr=i,this.props={},this.cr=void 0,this.vr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Je=this.pr(t),this.hr=this.gr(t),this.load(),t.debug&&ms.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),is){var n=()=>this.flush();Ts(is,"beforeunload",n,{capture:!1}),Ts(is,"pagehide",n,{capture:!1})}}mr(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Lr(e)&&e>0?e:0}isDisabled(){return!!this.yr}pr(t){-1===tf.indexOf(t.persistence.toLowerCase())&&(ms.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...$h,...t];return r({},Ah,{F(t){try{var r={};try{r=Oh.F(t)||{}}catch(t){}var i,n=JSON.parse(Ah.q(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Ar(a)||""===a||(s[o]=a)}i=ws(n,s)}else i=ws(r,n);return Ah.A(t,i),i}catch(t){}return null},A(t,e,r,n,s,o){var a=Ah.A(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Oh.A(t,l,r,n,s,o)}catch(t){Ah.P(t)}return a},D(t,e){try{null==is||is.localStorage.removeItem(t),Oh.D(t,e)}catch(t){Ah.P(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Ah.N()?(e=Ah,n=!0):"localstorage+cookie"===s&&i.N()?(e=i,n=!0):"sessionstorage"===s&&qh.N()?e=qh:"memory"===s?e=Dh:"cookie"===s?e=Oh:i.N()?(e=i,n=!0):e=Oh,this.ur=n,e}br(t){return this.vr+"__"+t}gr(t){return this.ur&&!!t.split_storage}_r(t){var e=null!=t?t:this.Te.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Wu];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return _s(this.props,((e,r)=>{var i=Yv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===Iu?()=>this._r():()=>!1))return;i.transformToEventProperties&&ws(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.yr){var t=this.Je.F(this.vr);t&&(this.props=ws({},t)),this.hr&&this.wr()}}wr(){for(var t of Qv){var e=Ah.F(this.br(t));if(e&&!Rr(e)){var r=this.kr(t);r.persisted=!0,this.Sr(t)||(r.fingerprint=this.Cr(e,t)),this.Mr(t,e)||ws(this.props,e)}}}Sr(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Yv(e))?void 0:r.storageGroup)===t}))}Mr(t,e){var r=Xv[t];if(!r)return!1;var i=e[r],n=this.props[r];return Lr(i)&&Lr(n)&&n>i}refreshKey(t){var e;if(!this.yr){var r=this.hr?null==(e=Yv(t))?void 0:e.storageGroup:void 0,i=r?Ah.F(this.br(r)):this.Je.F(this.vr);if(i&&t in i)this.Ir(t,i[t]);else{if(r){var n=this.Je.F(this.vr);if(n&&t in n)return void this.Ir(t,n[t])}this.Tr(t)}}}save(){if(!this.yr){var t=this.mr();t>0?Pr(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),t)):this.Rr()}}flush(){Pr(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,ef))}Pr(){var t=this.Fr(),e=t.main,r=t.groups;for(var i of(this.Or(this.Je,this.vr,e,ef),Qv)){var n,s=r[i];(!Rr(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ah,this.br(i),s,i)}}Fr(){var t={},e={flags:{},surveys:{}};return _s(this.props,((r,i)=>{var n,s=null==(n=Yv(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Cr(t,e){if(e===ef)return JSON.stringify(t)+"|"+this.Ar+"|"+this.$r+"|"+this.Lr;var r={};return _s(t,((t,e)=>{var i;r[e]=null!=(i=Yv(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Or(t,e,r,i){var n=this.kr(i);if(i===ef||n.dirty||Pr(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,r,this.Ar,this.$r,this.Lr,this.Te.debug)?(n.dirty=!1,i!==ef&&(n.persisted=!0),Pr(s)||(n.fingerprint=s)):this.Te.debug&&ms.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Pr(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.D(this.vr,!1),this.Je.D(this.vr,!0),!r&&this.dr)for(var i of Qv)Ah.D(this.br(i));r?delete this.lr[ef]:this.lr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Er(t)){Pr(e)&&(e="None"),this.Ar=Pr(r)?this.Dr:r;var i=!1;if(_s(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ir(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Er(t)){this.Ar=Pr(e)?this.Dr:e;var r=!1;if(_s(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ir(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Tr(t),this.save())}update_campaign_params(){var t=null==os?void 0:os.URL;if(t!==this.cr){var e=Qd(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Rr(Cs(e))||this.register(e),this.cr=t}}update_search_keyword(){var t;this.register((t=null==os?void 0:os.referrer)?Kd(t):{})}update_referrer_info(){var t;this.register_once({$referrer:tc(),$referring_domain:null!=os&&os.referrer&&(null==(t=Ps(os.referrer))?void 0:t.host)||Xd},void 0)}set_initial_person_info(){this.props[Ju]||this.props[Ku]||this.register_once({[Yu]:ec(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};_s([Ku,Ju],(e=>{var r=this.props[e];r&&_s(r,(function(e,r){t["$initial_"+xr(r)]=e}))}));var e=this.props[Yu];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=rc(t,e),i={};return _s(r,(function(t,e){i["$initial_"+xr(e)]=t})),i}(e,this.Te.disable_capture_url_hashes);ws(t,r)}return t}safe_merge(t){return _s(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Dr=this.Ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=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||[]),n=i?this.pr(t):this.Je,s=this.gr(t);if(i||s!==this.hr){var o=this.props;this.clear(),this.Je=n,this.hr=s,this.props=o,this.save()}}set_disabled(t){this.yr=t,this.yr?this.remove():this.save()}set_cross_subdomain(t){t!==this.$r&&(this.$r=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Lr&&(this.Lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[uu]||{};r[t]=e,this.Ir(uu,r),this.save()}remove_event_timer(t){var e=this.props[uu]||{},r=e[t];return Pr(r)||(delete e[t],this.Ir(uu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ir(t,e),this.save()}Ir(t,e){var r;this.props[t]=e,null!=(r=Yv(t))&&r.volatile||this.Nr(t)}Tr(t){delete this.props[t],this.Nr(t)}Nr(t){var e,r=null==(e=Yv(t))?void 0:e.storageGroup;r&&(this.kr(r).dirty=!0)}kr(t){return this.lr[t]||(this.lr[t]={})}}var nf=ys("[RateLimiter]");class sf{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=>{nf.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void nf.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.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 n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Qu))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Qu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var of=ys("[RemoteConfig]");class af{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=aa._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}qr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}jr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return of.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void of.warn("Remote config is disabled. Falling back to local config.");this.qr((t=>{if(!t)return of.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((t=>{this.Hr(t),this.Br()}));this.Hr(t),this.Br()}))}catch(t){of.error("Error loading remote config",t),this.Hr()}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&os&&"hidden"!==os.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var t;if(!this.zr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.zr=setInterval((()=>{this.refresh()}),e))}}Hr(t){t||of.error("Failed to fetch remote config from PostHog.");try{this._instance.Hr(t?{ok:!0,config:t}:{ok:!1})}catch(t){of.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var e;null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded()}catch(t){of.error("Error loading feature flags",t)}}}var lf=Uint8Array,uf=Uint16Array,hf=Uint32Array,df=new lf([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]),cf=new lf([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]),vf=new lf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ff=function(t,e){for(var r=new uf(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new hf(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},pf=ff(df,2),gf=pf[1];pf[0][28]=258,gf[258]=28;for(var mf=ff(cf,0)[1],yf=new uf(32768),bf=0;32768>bf;++bf){var _f=(43690&bf)>>>1|(21845&bf)<<1;yf[bf]=((65280&(_f=(61680&(_f=(52428&_f)>>>2|(13107&_f)<<2))>>>4|(3855&_f)<<4))>>>8|(255&_f)<<8)>>>1}var wf=function(t,e,r){for(var i=t.length,n=0,s=new uf(e);i>n;++n)++s[t[n]-1];var o,a=new uf(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new uf(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[yf[d]>>>l]=u}else for(o=new uf(i),n=0;i>n;++n)o[n]=yf[a[t[n]-1]++]>>>15-t[n];return o},xf=new lf(288);for(bf=0;144>bf;++bf)xf[bf]=8;for(bf=144;256>bf;++bf)xf[bf]=9;for(bf=256;280>bf;++bf)xf[bf]=7;for(bf=280;288>bf;++bf)xf[bf]=8;var kf=new lf(32);for(bf=0;32>bf;++bf)kf[bf]=5;var Sf=wf(xf,9,0),Cf=wf(kf,5,0),Mf=function(t){return(t/8>>0)+(7&t&&1)},If=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof uf?uf:t instanceof hf?hf:lf)(r-e);return i.set(t.subarray(e,r)),i},Tf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ef=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Rf=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new lf(0),0];if(1==n){var o=new lf(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new uf(c+1),f=Pf(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new lf(v),f]},Pf=function(t,e,r){return-1==t.s?Math.max(Pf(t.l,e,r+1),Pf(t.r,e,r+1)):e[t.s]=r},Of=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new uf(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},Ff=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Af=function(t,e,r){var i=r.length,n=Mf(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},$f=function(t,e,r,i,n,s,o,a,l,u,h){Tf(e,h++,r),++n[256];for(var d=Rf(n,15),c=d[0],v=d[1],f=Rf(s,15),p=f[0],g=f[1],m=Of(c),y=m[0],b=m[1],_=Of(p),w=_[0],x=_[1],k=new uf(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=Rf(k,7),M=C[0],I=C[1],T=19;T>4&&!M[vf[T-1]];--T);var E,R,P,O,F=u+5<<3,A=Ff(n,xf)+Ff(s,kf)+o,L=Ff(n,c)+Ff(s,p)+o+14+3*T+Ff(k,M)+(2*k[16]+3*k[17]+7*k[18]);if(A>=F&&L>=F)return Af(e,h,t.subarray(l,l+u));if(Tf(e,h,1+(A>L)),h+=2,A>L){E=wf(c,v,0),R=c,P=wf(p,g,0),O=p;var D=wf(M,I,0);for(Tf(e,h,b-257),Tf(e,h+5,x-1),Tf(e,h+10,T-4),h+=14,S=0;T>S;++S)Tf(e,h+3*S,M[vf[S]]);h+=3*T;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)Tf(e,h,D[H=31&j[S]]),h+=M[H],H>15&&(Tf(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=Sf,R=xf,P=Cf,O=kf;for(S=0;a>S;++S)if(i[S]>255){var H;Ef(e,h,E[257+(H=i[S]>>>18&31)]),h+=R[H+257],H>7&&(Tf(e,h,i[S]>>>23&31),h+=df[H]);var B=31&i[S];Ef(e,h,P[B]),h+=O[B],B>3&&(Ef(e,h,i[S]>>>5&8191),h+=cf[B])}else Ef(e,h,E[i[S]]),h+=R[i[S]];return Ef(e,h,E[256]),h+R[256]},Lf=new hf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Df=function(){for(var t=new hf(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Nf=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function qf(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Df[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new lf(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Af(l,u,t.subarray(h,d)):(l[h]=!0,u=Af(l,u,t.subarray(h,o)))}else{for(var c=Lf[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new uf(32768),m=new uf(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new hf(25e3),x=new uf(288),k=new uf(32),S=0,C=0,M=(h=0,0),I=0,T=0;o>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=I){var O=o-h;if((S>7e3||M>24576)&&O>423){u=$f(t,l,0,w,x,k,C,M,T,h-T,u),M=S=C=0,T=h;for(var F=0;286>F;++F)x[F]=0;for(F=0;30>F;++F)k[F]=0}var A=2,L=0,D=f,N=R-P&32767;if(O>2&&E==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),H=Math.min(258,O);j>=N&&--D&&R!=P;){if(t[h+A]==t[h+A-N]){for(var B=0;H>B&&t[h+B]==t[h+B-N];++B);if(B>A){if(A=B,L=N,B>q)break;var U=Math.min(N,B-2),z=0;for(F=0;U>F;++F){var V=h-N+F+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,P=V)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[M++]=268435456|gf[A]<<18|mf[L];var Z=31&gf[A],G=31&mf[L];C+=df[Z]+cf[G],++x[257+Z],++k[G],I=h+A,++S}else w[M++]=t[h],++x[t[h]]}}u=$f(t,l,!0,w,x,k,C,M,T,h-T,u)}return If(a,0,i+Mf(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Nf(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),Nf(l,u-8,r.d()),Nf(l,u-4,i),l}var jf=!!us||!!ls,Hf="text/plain",Bf=!1,Uf=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},zf=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Os(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Vf=t=>{if(t.Vr)return t.Vr;var e=t.data,r=t.compression;if(e){if(r===Cl){var i=qf(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new lf(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new lf(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return If(i,0,n)}(Rs(e)),{mtime:0});return{contentType:Hf,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Ml){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Rs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Rs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Rs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Wf=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:zf(t.url,{compression:Ml}),encodedBody:Vf(r({},t,{compression:Ml,Vr:void 0}))}:{url:Uf(t.url,"compression"),encodedBody:Vf(r({},t,{compression:void 0,Vr:void 0}))};try{e=Vf(t)}catch(e){if(vr(t.compression,Fs(t.url,"compression")))return ms.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&vr(t.compression,Fs(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?cr(new Uint8Array(i)):ArrayBuffer.isView(i)&&cr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Bf=!0,n()):{url:t.url,encodedBody:e}},Zf=t=>{try{return Wf(t)}catch(e){return ms.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Gf=function(){var t=e((function*(t){var e=Rs(t.data),i=yield function(t,e,r){return mr.apply(this,arguments)}(e,ps.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Vr:{contentType:Hf,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Qf=/Failed to fetch|NetworkError|Load failed/i,Jf=t=>{var e=Zf(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;_s(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(hs){var c=new hs;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Qf.test((null==t?void 0:t.message)||""))(e)?ms.warn(e):ms.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;ls(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.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){ms.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Kf=t=>{try{var e,i=Wf(t),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(ss.sendBeacon(n,u))return;var h=Ir(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ir(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>Ir(t.data)?e:r({},t.data,{batch:e});return Kf(r({},t,{data:c(h.slice(0,d))})),void Kf(r({},t,{data:c(h.slice(d))}))}ms.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Jf(r({},t,{Wr:!0}))}catch(t){ms.warn("Beacon send failed",t)}},Yf=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return zf(i===Cl?Uf(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===Cl?{}:{compression:i}))},Xf=[];ls&&Xf.push({transport:"fetch",method:Jf}),us&&Xf.push({transport:"XHR",method(t){var e=Zf(t);if(e){var r=new us,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;_s(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),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(o)}}}),null!=ss&&ss.sendBeacon&&Xf.push({transport:"sendBeacon",method:Kf});var tp=3e3;class ep{constructor(t,e){this.Zr=!0,this.Gr=[],this.Qr=Gr((null==e?void 0:e.flush_interval_ms)||tp,250,5e3,ms.createLogger("flush interval"),tp),this.Jr=t}enqueue(t){this.Gr.push(t),this.Kr||this.Yr()}unload(){this.Xr();var t=this.Gr.length>0?this.ti():{},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.ei(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var t=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var e=this.ti(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Ir(r.data)&&_s(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ei(r)};for(var i in e)r()}}),this.Qr))}ei(t){try{this.Jr(t)}catch(t){ms.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var t={};return _s(this.Gr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Pr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Gr=[],t}}var rp=["retriesPerformedSoFar"];class ip{constructor(t){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=t,this.Gr=[],this.ni=!0,!Pr(is)&&"onLine"in is.navigator&&(this.ni=is.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ts(is,"online",this.si),Ts(is,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,rp);Dr(e)&&(n.url=zf(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Ot(r({retriesPerformedSoFar:e},n));0===t.statusCode&&ms.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Ot(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ms.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var t=Date.now(),e=[],r=this.Gr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Gr=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Pr(is)||(this.si&&(is.removeEventListener("online",this.si),this.si=void 0),this.ai&&(is.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){ms.error(t)}}this.Gr=[]}}class np{constructor(t){this.hi=()=>{var t,e,r,i;this.di||(this.di={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.di.lastScrollY=Math.ceil(s),this.di.maxScrollY=Math.max(s,null!==(t=this.di.maxScrollY)&&void 0!==t?t:0),this.di.maxScrollHeight=Math.max(o,null!==(e=this.di.maxScrollHeight)&&void 0!==e?e:0),this.di.lastContentY=a,this.di.maxContentY=Math.max(a,null!==(r=this.di.maxContentY)&&void 0!==r?r:0),this.di.maxContentHeight=Math.max(l,null!==(i=this.di.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var t=this.di;return setTimeout(this.hi,0),t}startMeasuringScrollPosition(){Ts(is,"scroll",this.hi,{capture:!0}),Ts(is,"scrollend",this.hi,{capture:!0}),Ts(is,"resize",this.hi)}scrollElement(){if(!this.ci)return null==is?void 0:is.document.documentElement;var t=Ir(this.ci)?this.ci:[this.ci];for(var e of t){var r=null==is?void 0:is.document.querySelector(e);if(r)return r}}vi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[e]||0}return is?"y"===t?is.scrollY||is.pageYOffset||is.document.documentElement.scrollTop||0:is.scrollX||is.pageXOffset||is.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var sp=t=>ec(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class op{constructor(t,e,r,i){this.fi=t=>{var e=this.pi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.gi(this._instance)};this.mi.register({[Gu]:r})}},this._instance=t,this.yi=e,this.mi=r,this.gi=i||sp,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Gu]}getSetOnceProps(){var t,e=null==(t=this.pi())?void 0:t.props;return e?"r"in e?rc(e,this._instance.config.disable_capture_url_hashes):{$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 _s(Cs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+xr(r)]=e})),t}}class ap{on(t,e){return this.bi[t]||(this.bi[t]=[]),this.bi[t].push(e),()=>{this.bi[t]=this.bi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.bi[t]||[])r(e);for(var i of this.bi["*"]||[])i(t,e)}constructor(){this.bi={}}}var lp=ys("[SessionId]");class up{on(t,e){return this.wi.on(t,e)}constructor(t,e,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new ap,this.Mi=(t,e)=>!(!Dr(t)||!Dr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===ah)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=t.config,this.mi=t.persistence,this.Ii=void 0,this.Ti=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=e||xh,this.Ri=r||xh;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Gr(this.Te.session_idle_timeout_seconds||1800,60,36e3,lp.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Ai()){var s=qh.F(this.Oi),o=qh.F(this.Fi);s&&!o?this.Ii=s:qh.D(this.Oi),qh.A(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){lp.error("Invalid sessionID in bootstrap",t)}this.Li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Pr(this.ki)&&(this.ki=[]),this.ki.push(t),this.Ti&&t(this.Ti,this.Ii),()=>{this.ki=this.ki.filter((e=>e!==t))}}Ai(){return"memory"!==this.Te.persistence&&!this.mi.yr&&qh.N()}Di(t){t!==this.Ii&&(this.Ii=t,this.Ai()&&qh.A(this.Oi,t))}Ni(){return this.Ii?this.Ii:this.Ai()?qh.F(this.Oi):null}qi(t){var e=this.xi;return!Ar(e)&&!Ar(t)&&5e3>Math.abs(t-e)}$i(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Ti||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Ti=t,n&&!i||n&&this.qi(e)||(this.xi=e,this.mi.register({[Cu]:[e,t,r]}))}ji(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Dr(e)&&e>0}Hi(){this.ji()?this.mi.refreshKey(Cu):(this.mi.flush(),this.mi.load())}Bi(){var t;if(!Ar(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var e=this.Ui();e[1]===this.Ti&&e[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[Cu]:[this._sessionActivityTimestamp,null!==(t=this.Ti)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var t=this.Ui()[0],e=Dr(t)?t:0,r=Dr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Vi(t){return this.Hi(),this.Mi(t,this.zi())}Ui(){var t=this.mi.props[Cu];return Ir(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&is&&(is.removeEventListener(ch,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Li(){this.Si=()=>{this.Bi(),this.Ai()&&qh.D(this.Fi)},Ts(is,ch,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Te.cookieless_mode===ah)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),i=this.Ui(),n=i[1],s=i[2],o=this.zi(),a=this.Ni(),l=Dr(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!t&&this.Mi(r,o);if(v){(v=this.Vi(r))||lp.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],s=f[2]}d||v||l?(n=this.Ei(),a=this.Ri(),lp.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.Ri(),u=!0),(h=n!==c)&&(lp.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Dr(o)&&t&&!l?o:r,g=Dr(s)?s:(new Date).getTime();this.Di(a),this.$i(n,p,g),t||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((t=>t(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var t=this.Ti;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:t})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var hp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&br(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>br(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function dp(){return dp=e((function*(){var t=null==ss?void 0:ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Or(r)&&r.length>0?r:void 0}catch(t){return void ms.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),dp.apply(this,arguments)}var cp="custom",vp="i.posthog.com",fp=/^\/static\//;class pp{constructor(t){this.Zi={},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("."+vp,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":cp),this.Zi[this.apiHost]}Gi(t){if(fp.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}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("assets"===t){var r=this.Gi(e);if(r)return""+r+e}if(this.region===cp)return this.apiHost+e;var i=vp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var gp=ys("[PostHog ExternalIntegrations]"),mp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class yp{constructor(t){this._instance=t}tr(t,e){var r;null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return gp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=aa.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.tr(mp[s],(()=>{var e;null==(e=aa.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=aa.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=aa.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;e()}}}class bp{constructor(t,e){this.it=t,this.Qi=e,this.Ji=new Map,this.Ki=!1}add(t){var r=this;return e((function*(){if(r.Ki)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(r.Ji.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');r.Ji.set(t.name,t);try{var e=t.setup(r.Qi);e&&(yield e)}catch(e){var i=r.Ji.get(t.name)===t;i&&r.Ji.delete(t.name),r.it.error('Failed to set up browser extension "'+t.name+'"',e),i&&r.Yi(t)}}))()}dispose(){if(!this.Ki){this.Ki=!0;var t=Array.from(this.Ji.values()).reverse();for(var e of(this.Ji.clear(),t))this.Yi(e)}}Yi(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Tr(e.then)&&e.then(void 0,(e=>{this.it.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.it.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class _p{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var r;null==(r=this._instance.persistence)||r.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var wp="extensionsRemoteConfig";class xp{constructor(t){this.Ki=!1,this.instance=t,this.it=ms.createLogger("[BrowserExtensions]"),this.Xi=t.tn,this.kv=new _p(t),this.onEvent=t=>Sl(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.it.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.Ki)return Sl((()=>{}));var e=e=>{try{t(e)}catch(t){this.it.error("Browser extension remote config listener failed",t)}},r=this.instance.en.on(wp,e);return this.Xi&&e(this.Xi),Sl(r)},this.rn=new bp(this.it,this)}get logger(){return this.it}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(ou))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,r,i,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(r=null==n?void 0:n.windowId)&&void 0!==r?r:"",sessionStartTimestamp:null!==(i=null==n?void 0:n.sessionStartTimestamp)&&void 0!==i?i:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.rn.add(t)}capture(t,r,i){var n=this;return e((function*(){i?n.instance.capture(t,r,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):n.instance.capture(t,r)}))()}registerDynamicEventProperties(t){return Sl(this.instance.nn(t))}handleRemoteConfig(t){this.Ki||(this.Xi=t,this.instance.en.emit(wp,t))}sendRequest(t,r){var i=this;return e((function*(){var e;void 0===r&&(r={});var n=i.instance.requestRouter.endpointFor(null!==(e=r.target)&&void 0!==e?e:"api",t),s={method:r.method,url:r.query?zf(n,r.query):n,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport};return"sendBeacon"===r.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.Ki||(this.Ki=!0,this.rn.dispose())}}var kp={},Sp=0,Cp=()=>{},Mp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ip="Surveys module not available",Tp="sanitize_properties is deprecated. Use before_send instead",Ep="Invalid value for property_denylist config: ",Rp=["token","distinct_id",eh],Pp="posthog",Op=!jf&&-1===(null==cs?void 0:cs.indexOf("MSIE"))&&-1===(null==cs?void 0:cs.indexOf("Mozilla")),Fp=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Is(null==os?void 0:os.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Cp,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:as&&Or(null==as?void 0:as.search)&&-1!==as.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==is||null==(e=is.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){ms.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:hh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:tp},error_tracking:{},_onCapture:Cp},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:ho,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},Ap=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],$p=t=>{var e={};for(var r of Ap){var i=r[0],n=r[1];Pr(t[i])||(e[n]=t[i])}var s=ws({},e,t),o=t.__preview_external_dependency_versioned_paths;return Pr(o)||(Pr(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Or(o)&&Pr(t.asset_host)&&(s.asset_host=o)),Ir(t.property_blacklist)&&(Pr(t.property_denylist)?s.property_denylist=t.property_blacklist:Ir(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ms.error(Ep+t.property_denylist)),s};class Lp{constructor(){this.__forceAllowLocalhost=!1}get sn(){return this.__forceAllowLocalhost}set sn(t){ms.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Dp{an(t,e){if(t){var r=this.Ji.indexOf(t);-1!==r&&this.Ji.splice(r,1)}return this.Ji.push(e),null==e.initialize||e.initialize(),e}ln(){return this.config.cookieless_mode===ah||this.config.cookieless_mode===oh&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Lp,this.un=!1,this.version=ps.LIB_VERSION,this.en=new ap,this.Ji=[],this.hn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Fp(),this.SentryIntegration=Zv,this.sentryIntegration=t=>function(t,e){var r=Wv(t,e);return{name:Vv,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.dn=!1,this.cn=null,this.vn=null,this.fn=null,this.scrollManager=new np(this),this.pageViewManager=new Gv(this),this.rateLimiter=new sf(this),this.requestRouter=new pp(this),this.consent=new qv(this),this.externalIntegrations=new yp(this);var e=null!==(t=Dp.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Or(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Or(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>ms.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Pp){var i,n=null!==(i=kp[r])&&void 0!==i?i:new Dp;return n._init(t,e,r),kp[r]=n,kp[Pp][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o,a=Or(t)?t.trim():"";if(!a)return ms.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 a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Fp(e.defaults),e.debug=this.pn(e.debug),this.gn=e,this.mn=[],e.person_profiles?this.vn=e.person_profiles:e.process_person&&(this.vn=e.process_person);var l=Fp(e.defaults),u=$p(e),h=ws({},l,u,{name:i,token:a});Er(l.rageclick)&&Er(u.rageclick)&&(h.rageclick=ws({},l.rageclick,u.rageclick)),Er(l.session_recording)&&Er(u.session_recording)&&(h.session_recording=ws({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&ms.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Cl;var d=this.yn();this.persistence=new rf(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rf(r({},this.config,{persistence:"sessionStorage"}),d,!1);var c=r({},this.persistence.props),v=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.bn=new ep((t=>this._n(t)),this.config.request_queue_config),this.wn=new ip(this),this.__request_queue=[];var f=this.ln();if(f||(this.sessionManager=new up(this),this.sessionPropsManager=new op(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ms.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.xn(f)}),0)):(ms.info("Initializing extensions synchronously"),this.xn(f)),ps.DEBUG=ps.DEBUG||this.config.debug,ps.DEBUG&&ms.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:v}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Zu);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===lh)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===uh)ms.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var y=this.config.get_device_id(xh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(Zu,e.bootstrap.isIdentifiedID?uh:lh),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:th,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(xh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Zu,lh)}return Ts(is,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||xh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Zu,uh)),e()},n=r.user();"then"in n&&Tr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||zv.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()||(zv.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(zv.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,vh),identify:t=>e(t,ph),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.kn())):this.kn(),Tr(this.config._onCapture)&&this.config._onCapture!==Cp&&(ms.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ms.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.config.disableDeviceModel||function(){return dp.apply(this,arguments)}().then((t=>{t&&this.register({[au]:t})})).catch(Cp),this}xn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},Dp.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ji.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.Ji.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ji.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ji.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ji.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.Ji.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.Ji.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ji.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.Ji.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.Ji.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ji.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ji.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ji.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ji.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ji.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ji.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Bv)),d.toolbar&&this.Ji.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ji.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ji.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.Sn){var t=this.Sn;this.Sn=void 0,this.Ji.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Cn(c,h)}Cn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Cn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){ms.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[rh]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ih]:i}),this.config.__preview_deferred_init_extensions&&ms.info("PostHog extensions initialized ("+i+"ms)")}Hr(t){var e;if(!os||!os.body)return ms.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Sn=t),this.tn=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=_r(i.supportedCompression,Cl)?Cl:_r(i.supportedCompression,Ml)?Ml:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.vn?this.vn:hh}),null==(e=this.Mn)||e.handleRemoteConfig(t),this.Ji.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}kn(){try{this.config.loaded(this)}catch(t){ms.critical("`loaded` function failed",t)}if(this.In(),this.config.internal_or_test_user_hostname&&null!=as&&as.hostname){var t=as.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.ln())&&this.Tn()}),1),this.En=new af(this),this.En.load()}In(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.bn)||t.enable())}_dom_loaded(){this.is_capturing()&&bs(this.__request_queue,(t=>this._n(t))),this.__request_queue=[],this.In()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Rn()&&this.capture(fh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.bn)||i.unload(),null==(n=this.wn)||n.unload()):this.Rn()&&this.capture(fh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Op?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Pr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Pr(s.compression)&&s.data&&(s.compression=Ml),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Ir(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Ir(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Yf(s.url,s.method,s.compression,s.timestampMode);var c=Xf.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===Cl&&ds&&"undefined"!=typeof Promise&&!Bf?Gf(s).then((t=>{v(t)})).catch((e=>{if(fr(e))return Bf=!0,void v(r({},s,{compression:void 0,url:Yf(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return fr(t)||e===dr})(e)&&(Bf=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}_n(t){this.wn?this.wn.retriableRequest(t):this._send_request(t)}_execute_array(t){Sp++;try{var e,r=[],i=[],n=[];bs(t,(t=>{if(t)if(Ir(e=t[0]))n.push(t);else if(Tr(t))try{t.call(this)}catch(e){ms.error("Error executing queued PostHog call",t,e)}else Ir(t)&&"alias"===e?r.push(t):Ir(t)&&-1!==e.indexOf("capture")&&Tr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){bs(t,(function(t){try{if(Ir(t[0])){var r=e;_s(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ms.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{Sp--}}push(t){if(Sp>0&&Ir(t)&&Or(t[0])){var e=Dp.prototype[t[0]];Tr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.bn){if(this.is_capturing())if(!Pr(t)&&Or(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){if(this.hn.length>0){var v={};for(var f of this.hn.slice())try{ws(v,f())}catch(t){ms.error("Failed to produce browser extension event properties",t)}e=r({},v,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Or(null==(s=e)?void 0:s.$current_url)&&(ms.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=i&&i.Pn||ms.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==i?void 0:i.timestamp)||g,y=rn(null==i?void 0:i.uuid,xh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===vh&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),c&&(b.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Fu);(null==i?void 0:i.$set)&&!_&&(b.$set=null==i?void 0:i.$set);var w=null==i?void 0:i.$unset;w&&(b.$unset=w);var x=_?void 0:this.On(null==i?void 0:i.$set_once,t!==gh,t===ph);if(x&&(b.$set_once=x),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,l=b,u=t=>Or(t)?t.slice(0,a):t,h=new Set,b=function t(e,r){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var i;if(h.add(e),Ir(e))i=[],bs(e,(e=>{i.push(t(e))}));else{var n={};_s(e,((e,r)=>{h.has(e)||(n[r]=t(e,r))})),i=n}return i}}(l)),b.timestamp=m,Pr(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return nr.forEach(i),e.forEach(i),r}(b.properties,Rp)),t===Ll.DISMISSED||t===Ll.SENT){var k,S,C=null==(k=e)?void 0:k[Dl.SURVEY_ID],M=null==(S=e)?void 0:S[Dl.SURVEY_ITERATION];ru({id:C,current_iteration:M}),b.$set=r({},b.$set,{[Bl({id:C,current_iteration:M},t===Ll.SENT?"responded":"dismissed")]:!0})}else t===Ll.SHOWN&&(b.$set=r({},b.$set,{[Dl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var I,T=null==(I=e)?void 0:I.$product_tour_type;T&&(b.$set=r({},b.$set,{["$product_tour_last_seen_date/"+T]:(new Date).toISOString()}))}var E=r({},b.properties.$set,b.$set);if(Rr(E)||this.setPersonPropertiesForFlags(E),!$r(this.config.before_send)){var R=this.Rt(b);if(!R)return;(b=R).uuid=rn(b.uuid,xh)}this.en.emit("eventCaptured",b);var P=null!==(o=null==i?void 0:i._url)&&void 0!==o?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:P,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._n(O):this.bn.enqueue(O),b}ms.critical("This capture call is ignored due to client rate limiting.")}}else ms.error("No event name provided to posthog.capture")}else ms.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Fn(){var t;return null!==(t=this.Mn)&&void 0!==t?t:this.Mn=new xp(this)}nn(t){this.hn.push(t);var e=!0;return()=>{if(e){e=!1;var r=this.hn.indexOf(t);-1!==r&&this.hn.splice(r,1)}}}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.ln()&&(a[eh]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Or(a.distinct_id)&&!Lr(a.distinct_id)||Fr(a.distinct_id))&&ms.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!cs)return{};var l,u=t?[...Vd,...e||[]]:[],h=function(t){for(var e=0;Yi.length>e;e++){var r=Yi[e],i=r[1],n=r[0].exec(t),s=n&&(Tr(i)?i(n,t):i);if(s)return s}return["",""]}(cs),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Pr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==is||null==(o=is.screen)?void 0:o.width,b=null==is||null==(a=is.screen)?void 0:a.height,_=null==is?void 0:is.devicePixelRatio;Pr(g)||(p.userAgentDataPlatform=g),Pr(m)||(p.maxTouchPoints=m),Pr(y)||(p.screenWidth=y),Pr(b)||(p.screenHeight=b),Pr(_)||(p.devicePixelRatio=_);var w,x=ws(Cs({$os:d,$os_version:c,$browser:Qi(cs,navigator.vendor,v,f),$device:Xi(cs),$device_type:tn(cs,p),$timezone:ic(),$timezone_offset:nc()}),{$current_url:As(i?nn(null==as?void 0:as.href):null==as?void 0:as.href,u,Zd),$host:null==as?void 0:as.host,$pathname:null==as?void 0:as.pathname,$raw_user_agent:cs.length>1e3?cs.substring(0,997)+"...":cs,$browser_version:Ki(cs,navigator.vendor,v,f),$browser_language:Yd(),$browser_language_prefix:(w=Yd(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==is?void 0:is.screen.height,$screen_width:null==is?void 0:is.screen.width,$viewport_height:null==is?void 0:is.innerHeight,$viewport_width:null==is?void 0:is.innerWidth,$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return ps.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=ps.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&ws(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&ws(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.wn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===cp&&(a.$lib_custom_api_host=this.config.api_host),u=t!==vh||s?t!==fh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ws(a,u),t===vh&&os&&(a.title=os.title),!Pr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}cs&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();_s(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(a=ws({},h,p,g,a)).$is_identified=this._isIdentified(),Ir(this.config.property_denylist)?_s(this.config.property_denylist,(function(t){delete a[t]})):ms.error(Ep+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(ms.error(Tp),a=m(a,t));var y=this.An();return a.$process_person_profile=y,y&&!s&&this.$n("_calculate_event_properties"),a}On(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.An())return t;if(this.un&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ws({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(ms.error(Tp),o=a(o,"$set_once")),e&&(this.un=!0),Rr(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)}Ln(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.en.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Ip}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Ip})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ip})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=nu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Ip}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Ip})}Dn(t){return!t||Fr(t)?(ms.critical("Unique user id has not been set in posthog.identify"),!1):t===th?(ms.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ms.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return ms.uninitializedWarning("posthog.identify");if(Lr(t)&&(t=t.toString(),ms.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Dn(t)&&this.$n("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ou)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(lu)&&(this.unregister(lu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Zu)||lh)===lh,o=t!==i,a=!o&&s;if(o&&s)this.persistence.set_property(Zu,uh),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(ph,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.fn=Ch(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i);else if(a){this.persistence.set_property(Zu,uh);var l=e||{},u=r||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.fn=Ch(t,e,r)}else(e||r)&&this.setPersonProperties(e,r);o?(this.reloadFeatureFlags(),this.unregister(Uu)):a&&(e||r)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.$n("posthog.setPersonProperties")){var r=Ch(this.get_distinct_id(),t,e);this.fn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.fn=r):ms.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(Ir(t)?t:[t]).filter((t=>Or(t)&&t.length>0));0!==r.length&&this.$n("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.fn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(gh,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ms.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.$n("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n,s,o,a,l,u,h;if(ms.info("reset"),!this.__loaded)return ms.uninitializedWarning("posthog.reset");var d,c=this.get_property(ou),v=this.get_property(au),f=this.get_property(bu);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),Pr(f)||null==(d=this.persistence)||d.register({[bu]:f}),null==(i=this.surveys)||i.reset(),null==(n=this.En)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(Zu,lh),null==(h=this.sessionManager)||h.resetSessionId(),this.fn=null,this.config.cookieless_mode===ah)this.register_once({distinct_id:th,$device_id:null},"");else{var p=this.config.get_device_id(xh());this.register_once({distinct_id:p,$device_id:t?p:c},""),t||Pr(v)||this.register({[au]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s,o,a;r.__loaded?(null==(t=r.En)||t.stop(),null==(e=r.Mn)||e.dispose(),null==(i=r.logs)||i.flushLogs("sendBeacon"),null==(n=r.metrics)||n.flush("sendBeacon"),null==(s=r.bn)||s.unload(),null==(o=r.wn)||o.unload(),null==(a=r.featureFlags)||a.destroy()):ms.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Nn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.qn()}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 e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(su)?(ms.critical("Attempting to create alias for existing People user - aborting."),-2):this.$n("posthog.alias")?(Pr(e)&&(e=this.get_distinct_id()),t!==e?(this.Ln(lu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ms.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Er(t)){var i,n,s,o,a,l,u,h,d,c,v;ws(this.config,$p(t));var f=this.yn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rf(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.pn(this.config.debug);Nr(p)&&(this.config.debug=p),Nr(this.config.debug)&&(this.config.debug?(ps.DEBUG=!0,Ah.N()&&Ah.A("ph_debug",!0),ms.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ps.DEBUG=!1,Ah.N()&&Ah.D("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.jn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){ps.LIB_NAME=t,ps.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Dp.Hn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Pp;return e!==Pp&&(e=Pp+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Zu))===uh||(null==(e=this.sessionPersistence)?void 0:e.get_property(Zu))===uh}An(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===hh&&!this._isIdentified()&&Rr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[lu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Xu]))}Rn(){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.An()||this.$n("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$n("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$n(t){return"never"===this.config.person_profiles?(ms.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ln(Xu,!0),!0)}yn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==oh)}jn(){var t,e,r,i,n=this.yn();return(null==(t=this.persistence)?void 0:t.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==ah){if(this.ln()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new up(this),this.pageViewManager=new Gv(this),this.persistence&&(this.sessionPropsManager=new op(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Dp.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.an(this.sessionRecording,new l(this)),this.tn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.tn)))}var u,h;this.consent.optInOut(!0),this.jn(),this.In(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==oh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Pr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Tn()}else ms.warn(Mp)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==ah?(this.config.cookieless_mode===oh&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.jn(),this.config.cookieless_mode===oh&&(this.register({distinct_id:th,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Tn(),this.In())):ms.warn(Mp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===ah||(this.config.cookieless_mode===oh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.jn()}_is_bot(){return ss?hp(ss,this.config.custom_blocked_useragents):void 0}Tn(){os&&("visible"===os.visibilityState?this.dn||(this.dn=!0,this.capture(vh,{title:os.title},{send_instantly:!0}),this.cn&&(os.removeEventListener(dh,this.cn),this.cn=null)):this.cn||(this.cn=this.Tn.bind(this),Ts(os,dh,this.cn)))}debug(t){!1===t?(null==is||is.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==is||is.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}))}Ur(){var t=this.gn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ms.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):function(t,e,r,i,n){var s=e in t&&!$r(t[e]),o=r in t&&!$r(t[r]);return s?t[e]:!!o&&(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])}(t,"advanced_disable_flags","advanced_disable_decide",0,ms)}Rt(t){var e;if($r(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Hr),i=Ir(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),$r(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return jr(t.event)?ms.warn(o+". This can cause unexpected behavior."):ms.info(o),null}n.properties&&!Rr(n.properties)||ms.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&$r(n.properties[a]))return ms.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ir)?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)})}pn(t){var e=Nr(t)&&!t,r=Ah.N()&&"true"===Ah.q("ph_debug");return!e&&(!!r||t)}}Dp.__defaultExtensionClasses={},Dp.Hn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Ss(t.prototype[e[r]])}(Dp,["identify"]);var Np=ys("[ExceptionAutocapture]"),qp=ys("[TracingHeaders]"),jp=ys("[Web Vitals]"),Hp=9e5,Bp="disabled",Up="lazy_loading",zp="awaiting_config",Vp="missing_config";ys("[SessionRecording]"),ys("[SessionRecording]");var Wp="[SessionRecording]",Zp=ys(Wp),Gp=ys("[Heatmaps]");function Qp(t){return Er(t)&&"clientX"in t&&"clientY"in t&&Lr(t.clientX)&&Lr(t.clientY)}var Jp=ys("[Product Tours]"),Kp=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(mu))},Yp=["$set_once","$set"],Xp=ys("[SiteApps]"),tg="Error while initializing PostHog app with config id ";function eg(t,e,r){if($r(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 rg{constructor(t){this.Bn=new ap,this.Un=(t,e)=>this.zn(t,e)&&this.Vn(t,e)&&this.Wn(t,e)&&this.Zn(t,e),this.zn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Gn=new Set,this.Qn=new Set}init(){var t,e;Pr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Pr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.Qn)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Gn)||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.Gn.has(t)||this.Gn.has(e.event))&&this.Qn&&(null==(r=this.Qn)?void 0:r.size)>0&&this.Qn.forEach((t=>{this.Jn(e,t)&&this.Bn.emit("actionCaptured",t.name)}))}Kn(t){this.onAction("actionCaptured",(e=>t(e)))}Jn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Un(t,r))return!0;return!1}onAction(t,e){return this.Bn.on(t,e)}Vn(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(!eg(i,e.url,e.url_matching||"contains"))return!1}return!0}Wn(t,e){return!!this.Yn(t,e)&&!!this.Xn(t,e)&&!!this.ts(t,e)}Yn(t,e){var r;if(null==e||!e.href)return!0;var i=this.es(t);if(i.length>0)return i.some((t=>eg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&eg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Xn(t,e){var r;if(null==e||!e.text)return!0;var i=this.es(t);if(i.length>0)return i.some((t=>eg(t.text,e.text,e.text_matching||"exact")||eg(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!$r(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>eg(t,s,o))))}ts(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}es(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Zn(t,e){return null==e||!e.properties||0===e.properties.length||Th(e.properties.reduce(((t,e)=>{var r=Ir(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 ig{constructor(t){var e;this.rs=[],this._instance=t,this.ns=new Map,this.ss=new Map,this.os=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.ls(t)))}us(t,e){return!!t&&Th(t.propertyFilters,null==e?void 0:e.properties)}hs(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}ds(t,e,r){var i=(r===Il?this.ns:this.ss).get(t),n=[];return this.cs((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.us(s,e)}))}register(t){var e;Pr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.vs(t),this.fs(t))}fs(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.ps&&(this.ps=new rg(this._instance),this.ps.init(),this.ps.Kn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.os.get(e.name);r&&r.push(t.id),this.os.set(e.name,r||[t.id])}})))})))}vs(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ns=this.hs(t,Il),this.ss=this.hs(t,Tl))}onEvent(t,e){var r,i,n=this.gs(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ys(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.bs([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),void this._s(s)}if(this.ss.has(t)){var a=this.ds(t,e,Tl);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.bs(a.map((t=>t.id))),a.forEach((t=>this.ws(t.id))))}if(this.ns.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ns.get(t)});var l=this.ds(t,e,Il);this.xs(l.map((t=>t.id)))}}onAction(t){this.os.has(t)&&this.xs(this.os.get(t)||[])}xs(t){0!==t.length&&(this.rs=[...new Set([...this.rs,...t])],this.gs().info("updating activated items",{activatedItems:this.getActivatedIds()}))}_s(t){this.rs=this.rs.filter((e=>e!==t));var e=this.ks();e.includes(t)||(this.Ss([...e,t]),this.Cs())}bs(t){var e=new Set(t);this.rs=this.rs.filter((t=>!e.has(t)));var r=this.Ms(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.Ss(i),0===i.length&&this.Is())}Ms(){var t,e=this.Ts();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}ks(){var t,e,r=this.Ms();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Es()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}Cs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Rs(e)}Is(){this.Ps()}ls(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Es()];r&&r!==t&&(this.Ms().length>0&&this.Ss([]),this.Is())}getActivatedIds(){return[...new Set([...this.ks(),...this.rs])].filter((t=>!this.Os(t)))}reset(){this.rs=[],this.Ms().length>0&&this.Ss([]),this.Is()}getEventToItemsMap(){return this.ns}Fs(){return this.ps}}class ng extends ig{constructor(t){super(t)}Ts(){return ju}Es(){return Hu}As(){return Ll.SHOWN}cs(t){var e;null==(e=this._instance)||e.getSurveys(t)}ws(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}gs(){return Ql}Ss(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ju]:t})}Rs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Hu]:t})}Ps(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(Hu)}Os(){return!1}ys(t,e){var r;return this.cs((t=>{r=t.find((t=>t.id===e))})),!r||Gl(r)?t===Ll.SHOWN?"consume":"ignore":t===Ll.SHOWN?"persist":t===Ll.DISMISSED||t===Ll.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var sg="SDK is not enabled or survey functionality is not yet loaded",og="Disabled. Not loading surveys.",ag=null!=is&&is.location?$s(is.location.hash,"__posthog")||$s(location.hash,"state"):null,lg="_postHogToolbarParams",ug=ys("[Toolbar]"),hg=ys("[FeatureFlags]"),dg=ys("[FeatureFlags]",{debugEnabled:!0}),cg="\" failed. Feature flags didn't load in time.",vg=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},fg=t=>{var e={};for(var r of xs(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},pg="Refusing to render web experiment since the viewer is a likely bot",gg={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Sh(e,t),not_regex:(t,e)=>!Sh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class mg{get Te(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{mg.$s("retrieved web experiments from the server"),e.Ls=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Ls&&(mg.$s("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ls)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Or(i)&&t.variants[i]&&e.Ds(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];mg.Ns(s,e._instance)&&e.Ds(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())mg.$s(pg);else if(!this.Te.disable_web_experiments){if($r(this.Ls))return this.Ls=new Map,this.loadIfEnabled(),void this.previewWebExperiment();mg.$s("applying feature flags",t),t.forEach((t=>{var e;if(this.Ls&&null!=(e=this.Ls)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ls)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ds(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=mg.getWindowLocation();if(null!=t&&t.search){var e=Fs(null==t?void 0:t.search,"__experiment_id"),r=Fs(null==t?void 0:t.search,"__experiment_variant");e&&r&&(mg.$s("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.qs(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Te.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.Te.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}qs(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(mg.$s("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ds(i[0].name,e,i[0].variants[e].transforms))}static Ns(t,e){return!$r(t.conditions)&&mg.js(t,e)&&mg.Hs(t)}static js(t,e){var r;if($r(t.conditions)||$r(null==(r=t.conditions)?void 0:r.url))return!0;var i=mg.getWindowLocation();if(i){var n,s,o,a=Hs(e,i.href);return null==(n=t.conditions)||!n.url||gg[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==is?void 0:is.location}static Hs(t){var e;if($r(t.conditions)||$r(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Qd();if(r.utm_source){var i,n,s,o,a,l,u,h,d=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,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static $s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];ms.info("[WebExperiments] "+t,r)}Ds(t,e,r){this._is_bot()?mg.$s(pg):"control"!==e?r.forEach((r=>{if(r.selector){var i;mg.$s("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)}))}})):mg.$s("Control variants leave the page unmodified.")}_is_bot(){return ss&&this._instance?hp(ss,this.Te.custom_blocked_useragents):void 0}}var yg=ys("[Conversations]"),bg="Conversations not available yet.",_g="console",wg={featureFlags:class{constructor(t){this.Bs=!1,this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.Gs=!1,this.Qs=!1,this.Js=0,this.Ks=()=>{var t=this.Ys();this.Js=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],is&&Ts(is,"online",this.Ks)}destroy(){null==is||is.removeEventListener("online",this.Ks)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Xs(t){return this._instance.get_property(t)}eo(){var t,e;return null!==(t=null==(e=this.mi)?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ro(){return!!this.eo()&&(this.Qs||this.zs||(this.Qs=!0,hg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}io(){var t,e=null!==(t=this.Te.evaluation_contexts)&&void 0!==t?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.Gs||(hg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||hg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}no(){return this.io().length>0}so(){var t=this.Te.flag_keys;if(!Pr(t)){if(Ir(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||hg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));hg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.Xs(Iu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.Xs(Pu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:er(v),variant:rr(v),reason:void 0,metadata:Pr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Us}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Xs(Ru),e=this.Xs(Au),i=this.Xs($u);if(!i&&!e)return t||{};var n=ws({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Pr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Pr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Bs||(hg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Bs=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:er(i),variant:rr(i),payload:tr(e[r])}}))}getFlagVariants(){var t=this.Xs(Iu),e=this.Xs(Au);if(!e)return t||{};for(var r=ws({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Bs||(hg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Bs=!0),r}getFlagPayloads(){var t=this.Xs(Pu),e=this.Xs($u);if(!e)return t||{};for(var r=ws({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Bs||(hg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Bs=!0),r}reloadFeatureFlags(){this.Vs||this.Te.advanced_disable_feature_flags||this.Ys()||this.oo||(this._instance.en.emit("featureFlagsReloading",!0),this.oo=setTimeout((()=>{this.ao()}),5))}lo(){clearTimeout(this.oo),this.oo=void 0}ensureFlagsLoaded(){this.Us||this.zs||this.oo||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Vs=t}ao(t){var e;if(this.lo(),!this._instance.Ur()&&!this.Ys())if(this.zs)this.Ws=!0;else{var i=this.Te.token,n=this.Xs(ou),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.mi)?void 0:e.get_initial_props())||{},this.Xs(Lu)||{},{$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION}),group_properties:this.Xs(Du),timezone:ic()};Ar(n)||Pr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.no()&&(s.evaluation_contexts=this.io());var o=this.so();Pr(o)||(s.flag_keys=o);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.zs=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Te.disable_compression?void 0:Ml,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.uo(t.statusCode),200===t.statusCode&&(this.Ws||(this.$anon_distinct_id=void 0),n=!1),this.zs=!1,!s.disable_flags||this.Ws){this.Zs=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Vu]:o}),u)hg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ws&&(this.Ws=!1,this.ao())}}})}}Ys(){return Ls(this.Js,3)}uo(t){this.Js=Ds(t,this.Js,3,(()=>hg.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else hg.warn('getFeatureFlag for key "'+t+cg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Xs(Ou)||void 0,l=this.Xs(Wu)||void 0,u=this.Xs(Uu)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.Xs(zu);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Uu]:u,[zu]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Ir(u[t])?u[t].push(o):u[t]=[o],null==(v=this.mi)||v.register({[Uu]:u});var S=this.getFeatureFlagDetails(t),C=[...null!==(f=this.Xs(Vu))&&void 0!==f?f:[]];Pr(n)&&C.push("flag_missing");var M={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Te.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.Zs};Pr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(M.$feature_flag_has_experiment=S.metadata.has_experiment),Pr(null==S||null==(y=S.metadata)?void 0:y.version)||(M.$feature_flag_version=S.metadata.version);var I,T=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;T&&(M.$feature_flag_reason=T),null!=S&&null!=(x=S.metadata)&&x.id&&(M.$feature_flag_id=S.metadata.id),Pr(null==S?void 0:S.original_variant)&&Pr(null==S?void 0:S.original_enabled)||(M.$feature_flag_original_response=Pr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(M.$feature_flag_original_payload=null==S||null==(I=S.metadata)?void 0:I.original_payload),C.length&&(M.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",M)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:tr(s)}}}else hg.warn('getFeatureFlagResult for key "'+t+cg)}getRemoteConfigPayload(t,e){var r=this.Te.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION}};this.no()&&(i.evaluation_contexts=this.io());var n=this.so();Pr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Te.disable_compression?void 0:Ml,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Zs)return e.defaultValue;if(!(this.Us||this.getFlags()&&this.getFlags().length>0))return hg.warn('isFeatureEnabled for key "'+t+cg),e.defaultValue;var r=this.getFeatureFlag(t,e);return Pr(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.mi){this.Us=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(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]})))):t.featureFlags&&hg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(Ir(u)){hg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;e&&e.register({[Tu]:u,[Iu]:v,[Fu]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[Tu]:Object.keys(fg(p)),[Iu]:p||{},[Pu]:g||{},[Ru]:m||{},[Fu]:!0===t.minimalFlagCalledEvents},d?{[Ou]:d}:{},c?{[Wu]:c}:{}))}}}(t,this.mi,n,s,o,i),e||(this.Qs=!1),this.ho(e)}}override(t,e){void 0===e&&(e=!1),hg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return hg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.mi.unregister(Au),this.mi.unregister($u),this.ho(),dg.info("All overrides cleared");if(Ir(t)){var e=vg(t);return this.mi.register({[Au]:e}),this.ho(),dg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Bs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Au),dg.info("Flag overrides cleared");else if(i.flags){if(Ir(i.flags)){var n=vg(i.flags);this.mi.register({[Au]:n})}else this.mi.register({[Au]:i.flags});dg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister($u),dg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[$u]:i.payloads}),dg.info("Payload overrides set",{payloads:i.payloads}))),void this.ho()}if(t&&"object"==typeof t)return this.mi.register({[Au]:t}),this.ho(),dg.info("Flag overrides set",{flags:t});hg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Us){var e=this.do(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){hg.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.Xs(Eu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this.mi)||n.register({[Tu]:Object.keys(fg(l)),[Iu]:l}),this.ho()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.Xs(Eu),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.Te.token+n),method:"GET",timestampMode:"query",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(Eu),null==(i=this.mi)||i.register({[Eu]:n}),t(n)}}})}do(){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)),{})}}ho(t){var e=this.do(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){hg.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Xs(Lu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Lu]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.Xs(Lu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Lu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Lu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Xs(Du)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Du]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Xs(Du)||{};this._instance.register({[Du]:r({},e,{[t]:{}})})}else this._instance.unregister(Du)}reset(){this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.$anon_distinct_id=void 0,this.lo(),this.Bs=!1,this.Js=0}}},xg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!(null==(t=this.co)||!t.isStarted)}get status(){var t,e;return this.vo===zp||this.vo===Vp?this.vo:null!==(t=null==(e=this.co)?void 0:e.status)&&void 0!==t?t:this.vo}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.vo=Bp,this.fo=void 0,this._instance=t,!this._instance.sessionManager)throw Zp.error("started without valid sessionManager"),new Error(Wp+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===ah)throw new Error(Wp+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get po(){var t,e=!(null==(t=this._instance.get_property(bu))||!t.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return is&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.po||null==(e=this.co)||!e.isStarted){var r=!Pr(Object.assign)&&!Pr(Array.from);this.po&&r?(this.mo(t),Zp.info("starting")):(this.vo=Bp,this.stopRecording())}}mo(t){var e,r,i;this.po&&(this.vo!==zp&&this.vo!==Vp&&(this.vo=Up),null!=aa&&null!=(e=aa.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=aa.__PosthogExtensions__)&&r.initSessionRecording?this.yo(t):null==(i=aa.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.bo,(e=>{if(e)return Zp.error("could not load recorder",e);this.yo(t)})))}stopRecording(){var t,e;null==(t=this.fo)||t.call(this),this.fo=void 0,null==(e=this.co)||e.stop()}_o(){var t,e;null==(t=this.fo)||t.call(this),this.fo=void 0,null==(e=this.co)||e.discard()}wo(){var t,e;null==(t=this.mi)||t.unregister(Mu),null==(e=this.mi)||e.unregister(_u)}xo(t,e){if($r(t))return null;var r,i=Lr(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Zp.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}ko(t){if(this.mi){var e,i,n=this.mi,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.xo(null==(e=this.Te.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.xo(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;$r(a)&&this.wo();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[bu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Pr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.fo)||e.call(this),this.fo=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.ko(e),void this._o()):(this.ko(e),void this.startIfEnabledOrStop()):(this.vo===zp&&(this.vo=Vp,Zp.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.co)&&r.log?this.co.log(t,e):Zp.warn("log called before recorder was ready")}get bo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(bu);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}So(){var t,e,r=this._instance.get_property(bu);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Zp.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}yo(t){var e,r;if(null==(e=aa.__PosthogExtensions__)||!e.initSessionRecording)return Zp.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[nh]:!0});if(this.co||(this.co=null==(r=aa.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.co._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.So()){if(this.vo===Vp||this.vo===zp)return;return this.vo=zp,Zp.info("persisted remote config is stale, requesting fresh config before starting"),void new af(this._instance).load()}this.vo=Up,this.co.start(t)}onRRwebEmit(t){var e;null==(e=this.co)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.co||null==(e=this.mi)||e.register({[xu]:!0}),null==(t=this.co)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.co||null==(e=this.mi)||e.register({[wu]:!0}),null==(t=this.co)||t.overrideSampling()}overrideTrigger(t){var e,r;this.co||null==(r=this.mi)||r.register({["url"===t?ku:Su]:!0}),null==(e=this.co)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.co)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.co)||!r.tryAddCustomEvent(t,e))}}},kg={autocapture:class{constructor(t){this.Co=!1,this.Mo=null,this.Io=!1,this.To=!1,this.instance=t,this.rageclicks=new kv(t.config.rageclick),this.Eo=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=Er(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}Ro(){if(this.isBrowserSupported()){if(is&&os){var t=t=>{t=t||(null==is?void 0:is.event);try{this.Po(t)}catch(t){Cv.error("Failed to capture event",t)}};if(Ts(os,"submit",t,{capture:!0}),Ts(os,"change",t,{capture:!0}),Ts(os,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||(null==is?void 0:is.event);try{this.Po(t,Sv)}catch(t){Cv.error("Failed to capture copy/cut event",t)}};Ts(os,"copy",e,{capture:!0}),Ts(os,"cut",e,{capture:!0})}}}else Cv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Co&&(this.Ro(),this.Co=!0)}onRemoteConfig(t){if(this.Io=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);var r=e.autocapture_opt_out;Nr(r)&&(this.instance.persistence&&this.instance.persistence.register({[hu]:r}),this.Mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Eo=t}getElementSelectors(t){var e,r=[];return null==(e=this.Eo)||e.forEach((e=>{var i=null==os?void 0:os.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[hu],i=this.Mo,n=this.instance.Ur()&&!this.Io;if(Ar(i)&&!Nr(r)&&!n)return!1;var s=null!==(e=this.Mo)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}Po(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=no(t);Js(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())&&go(i,this.instance.config.rageclick)&&this.Po(t,"$rageclick");var n=e===Sv;if(i&&function(t,e,r,i,n,s){var o;if(!is||mo(t))return!1;if(null!=r&&r.url_allowlist&&!to(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&to(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((t=>e.type===t)))return!1}var l=yo(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Pr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!oo(h,null==r?void 0:r.css_selector_allowlist))return!1;if(oo(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:lo))return!1;try{var d=is.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){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 u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(so.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=Tv(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===Sv){var l,u=ro(null==is||null==(l=is.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Tr(null==os?void 0:os.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Oo=(null==is||null==(e=is.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ms.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Fo&&this.Fo(),this.Fo=void 0,ms.info("History API monitoring stopped")}monitorHistoryChanges(){is&&is.history&&(this.Ao("pushState"),this.Ao("replaceState"),this.$o())}Ao(t){var e;if(is&&(null==(e=is.history[t])||!e.__posthog_wrapped__)){var r=this;qs(is.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Lo(t)}))}}Lo(t){try{var e,r=null==is||null==(e=is.location)?void 0:e.pathname;if(!r)return;r!==this.Oo&&this.isEnabled&&this._instance.capture(vh,{navigation_type:t}),this.Oo=r}catch(e){ms.error("Error capturing "+t+" pageview",e)}}$o(){if(!this.Fo){var t=()=>{this.Lo("popstate")};Ts(is,"popstate",t),this.Fo=()=>{is&&is.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Do=!1,this.Co=!1,this.No=null,this.instance=t,this.Do=!(null==(e=this.instance.persistence)||!e.props[du]),this.rageclicks=new kv(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Er(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return $r(this.Te.capture_heatmaps)?$r(this.Te.enable_heatmaps)?this.Do:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Co)return;Gp.info("starting..."),this.qo(),this.xe()}else{var t;clearInterval(null!==(t=this.No)&&void 0!==t?t:void 0),this.jo(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[du]:r}),this.Do=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Ho(t){Qp(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}xe(){this.No&&clearInterval(this.No),this.No=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(os)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}qo(){is&&os&&(this.Bo=this.oi.bind(this),Ts(is,ch,this.Bo),this.Uo=t=>this.pe(t||(null==is?void 0:is.event)),Ts(os,"click",this.Uo,{capture:!0}),this.zo=t=>this.Vo(t||(null==is?void 0:is.event)),Ts(os,"mousemove",this.zo,{capture:!0}),this.Wo=new Uv(this.instance,Hv,this.Ho.bind(this)),this.Wo.startIfEnabledOrStop(),this.Zo=this.xe.bind(this),Ts(os,dh,this.Zo),this.Co=!0)}jo(){var t;is&&os&&(this.Bo&&is.removeEventListener(ch,this.Bo),this.Uo&&os.removeEventListener("click",this.Uo,{capture:!0}),this.zo&&os.removeEventListener("mousemove",this.zo,{capture:!0}),this.Zo&&os.removeEventListener(dh,this.Zo),clearTimeout(this.Go),null==(t=this.Wo)||t.stop(),this.Co=!1)}Qo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&Gs(i)&&!Qs(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:is)?void 0:s.getComputedStyle(i).position}catch(t){return!1}if(_r(e,n))return!0;i=ao(i)}return!1}(no(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}pe(t,e){var i;if(void 0===e&&(e="click"),!Zs(t.target)&&Qp(t)){var n=this.Qo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&go(no(t),this.instance.config.rageclick)&&this.Wt(r({},n,{type:"rageclick"})),this.Wt(n)}}Vo(t){!Zs(t.target)&&Qp(t)&&(clearTimeout(this.Go),this.Go=setTimeout((()=>{this.Wt(this.Qo(t,"mousemove"))}),500))}Wt(t){if(is){var e=this.Te.disable_capture_url_hashes?nn(is.location.href):is.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Vd,...r||[]]:[],n=As(e,i,Zd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(t)}}oi(){this.R&&!Rr(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Uv,webVitalsAutocapture:class{constructor(t){var e;this.Do=!1,this.Co=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Jo=()=>{clearTimeout(this.Ko),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.Yo=t=>{var e;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Xo();if(!Pr(i))if($r(null==t?void 0:t.name)||$r(null==t?void 0:t.value))jp.error("Invalid metric received",t);else if(!this.ta||this.ta>t.value){this.R.url!==i&&(this.Jo(),this.Ko=setTimeout(this.Jo,this.flushToCaptureTimeoutMs)),Pr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Pr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});Pr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Jo()}else jp.error("Ignoring metric with value >= "+this.ta,t)},this.ea=()=>{if(!this.Co){var t,e,r,i,n=aa.__PosthogExtensions__;if(!Pr(n)&&!Pr(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;t=s.onLCP,e=s.onCLS,r=s.onFCP,i=s.onINP}t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Yo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Yo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Yo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Yo.bind(this)),this.Co=!0):jp.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Do=!(null==(e=this._instance.persistence)||!e.props[pu]),this.startIfEnabled()}get ra(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Er(this.ra)?null==(t=this.ra)?void 0:t.web_vitals_allowed_metrics:void 0;return $r(r)?(null==(e=this._instance.persistence)?void 0:e.props[yu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Er(this.ra)?this.ra.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Er(this.ra)?this.ra.web_vitals_attribution:void 0;return null!=t&&t}get ta(){var t=Er(this.ra)&&Lr(this.ra.__web_vitals_max_value)?this.ra.__web_vitals_max_value:Hp;return t>0&&6e4>=t?Hp:t}get isEnabled(){var t=null==as?void 0:as.protocol;if("http:"!==t&&"https:"!==t)return jp.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Er(this.ra)?this.ra.web_vitals:Nr(this.ra)?this.ra:void 0;return Nr(e)?e:this.Do}startIfEnabled(){this.isEnabled&&!this.Co&&(jp.info("enabled, starting..."),this.tr(this.ea))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Er(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Er(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[pu]:r}),this._instance.persistence.register({[yu]:i})),this.Do=r,this.startIfEnabled()}}}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?jp.error("failed to load script",e):t()}))}Xo(){var t=is?this._instance.config.disable_capture_url_hashes?nn(is.location.href):is.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Vd,...e||[]]:[];return As(t,r,Zd)}jp.error("Could not determine current URL")}}},Sg={exceptionObserver:class{constructor(t){var e;this.ea=()=>{var t;if(is&&this.isEnabled&&null!=(t=aa.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=aa.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=aa.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=aa.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ia&&this.Te.capture_unhandled_errors&&(this.ia=e(this.captureException.bind(this))),!this.na&&this.Te.capture_unhandled_rejections&&(this.na=r(this.captureException.bind(this))),!this.sa&&this.Te.capture_console_errors&&(this.sa=i(this.captureException.bind(this)))}catch(t){Np.error("failed to start",t),this.oa()}}},this._instance=t,this.aa=!(null==(e=this._instance.persistence)||!e.props[cu]),this.la=new Qr(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,it:Np})),this.Te=this.ua(),this.startIfEnabledOrStop()}ua(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Er(t)?e=r({},e,t):(Pr(t)?this.aa:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Np.info("enabled"),this.oa(),this.tr(this.ea)):this.oa()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Np.error("failed to load script",e);t()}))}oa(){var t,e,r;null==(t=this.ia)||t.call(this),this.ia=void 0,null==(e=this.na)||e.call(this),this.na=void 0,null==(r=this.sa)||r.call(this),this.sa=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.aa=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cu]:this.aa}),this.Te=this.ua(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ua()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.la.consumeRateLimit(n)?Np.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.ha=[],this.da=Tc(),this._instance=t,this.ha=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(vu))&&void 0!==e?e:[],this.ca=ts(this.va()),this.fa=new es(this.ca)}onConfigChange(){this.ca=ts(this.va()),this.fa.setConfig(this.ca)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ha=s,this._instance.persistence&&this._instance.persistence.register({[vu]:this.ha,[fu]:o})}}}get pa(){var t,e=!!this._instance.get_property(fu),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.da.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ca.enabled)try{if(!Or(t)||0===t.trim().length)return void Ic.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>Yn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.ga(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&Ic.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.fa.add(r({[Jn]:t,[Kn]:(new Date).toISOString()},n))}catch(t){Ic.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ma(e)){if(this.ya(e))return this.ba("Exception dropped: matched a suppression rule"),void Ic.info("Skipping exception capture because a suppression rule matched");if(!this.pa&&this._a(e))return this.ba("Exception dropped: thrown by a browser extension"),void Ic.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.wa(e))return this.ba("Exception dropped: thrown by the PostHog SDK"),void Ic.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ca.enabled&&$r(t.$exception_steps)?this.xa(t):t,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(r.$release_id=i);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Pn:!0});return n&&this.fa.clear(),n}catch(t){return Ic.error("Failed to capture exception event. Dropping this exception.",t),void this.fa.clear()}}catch(t){return void Ic.error("Failed to process exception event. Ignoring this exception.",t)}var s}xa(t){try{var e=this.fa.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return Ic.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ba(t){this.ca.enabled&&this.fa.add({[Jn]:t,[Kn]:(new Date).toISOString()})}ga(t){return Er(t)?r({},t):{}}va(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ya(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Or(r)&&r.length>0&&t.$exception_types.push(r),Or(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.ha.some((t=>{var r=t.values.map((t=>{var r=Mh[t.operator],i=e[t.key];if(!r||!i)return!1;var n=Ir(t.value)?t.value:[t.value];return n.length>0&&r(n,i)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}catch(t){return Ic.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}_a(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://")))}wa(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ma(t){return!$r(t)&&Ir(t)}}},Cg=r({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.ka=null,this.Sa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.mi&&this.mi.register({[mu]:!!e.productTours}),!Kp(this._instance))return!this.ka&&$r(null==(r=this.mi)?void 0:r.props[Bu])||Jp.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.ka)||i.stop(),this.ka=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ka&&Kp(this._instance)&&this.tr((()=>this.Ca()))}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Jp.error("Could not load product tours script",e):t()}))}Ca(){var t;!this.ka&&null!=(t=aa.__PosthogExtensions__)&&t.generateProductTours&&(this.ka=aa.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ir(this.Sa)||e){var r=this.mi;if(r){var i=r.props[Bu];if(Ir(i)&&!e)return this.Sa=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",timestampMode:"query",callback:e=>{if(Kp(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Jp.error(n),void t([],{isLoaded:!1,error:n})}var s=Ir(e.json.product_tours)?e.json.product_tours:[];this.Sa=s,r&&r.register({[Bu]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Sa,{isLoaded:!0})}getActiveProductTours(t){$r(this.ka)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ka.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ka)||e.showTourById(t)}previewTour(t){this.ka?this.ka.previewTour(t):this.tr((()=>{var e;this.Ca(),null==(e=this.ka)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ka)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ka)||t.nextStep()}previousStep(){var t;null==(t=this.ka)||t.previousStep()}clearCache(){var t;this.Sa=null,null==(t=this.mi)||t.unregister(Bu)}resetTour(t){var e;null==(e=this.ka)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ka)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ka)||e.cancelPendingTour(t)}}},wg),Mg={siteApps:class{constructor(t){this.Ma=0,this._instance=t,this.Ia=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ta(t,e){if(e){var r=this.globalsForEvent(e);this.Ia.push(r),this.Ia.length>1e3&&(this.Ia=this.Ia.slice(10))}}get siteAppLoaders(){var t;return null==(t=aa._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ta.bind(this));this.Ea=()=>{t(),this.Ia=[],this.Ea=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=t.$set_once,g=t.$set;return{event:r({},i(t,Yp),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Ra(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Xp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Xp.error("prepare_external_dependency_script returned null"),null):t}Pa(){var t,e,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==os?void 0:os.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Ma++,this.Oa)return this.Fa();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.Ra(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Ar(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.Oa=()=>{h.forEach((t=>t())),this.Oa=void 0},this.Fa()}Fa(){var t=!1;return()=>{var e;t||(t=!0,this.Ma--,0===this.Ma&&(null==(e=this.Oa)||e.call(this)))}}Aa(t,e){void 0===e&&(e=!0);var r=this.Pa();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Ia.length&&(Xp.info("Processing "+this.Ia.length+" events for site app with id "+t.id),this.Ia.forEach((t=>this.Aa((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Ea)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Xp.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Aa((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){Xp.error(tg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Xp.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}$a(){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)}La(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Aa((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){Xp.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.$a(),void this._instance.on("eventCaptured",(t=>this.La(t)))):void Xp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Ea)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;aa["__$$ph_site_app_"+e]=n._instance,null==(t=aa.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return Xp.error(tg+e,t)}))};for(var a of s.siteApps)o()}else Xp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Ig={tracingHeaders:class{constructor(t){this.Da=void 0,this.Na=void 0,this.qa=void 0,this.ea=()=>{var t,e,r=this.ja();r?(Pr(this.Da)&&(this.Da=null==(t=aa.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Pr(this.Na)&&(this.Na=null==(e=aa.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.oa()},this._instance=t}initialize(){this.startIfEnabledOrStop()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return qp.error("failed to load script",e);t()}))}Ha(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}ja(){var t=this.Ha();return Ir(t)?(Ir(this.qa)?this.qa.splice(0,this.qa.length,...t):this.qa=[...t],t.length>0?this.qa:void 0):(Ir(this.qa)&&this.qa.splice(0),this.qa=t||void 0,this.qa)}oa(){var t,e;null==(t=this.Da)||t.call(this),null==(e=this.Na)||e.call(this),this.Da=void 0,this.Na=void 0}startIfEnabledOrStop(){this.ja()?this.tr(this.ea):this.oa()}}},Tg=r({surveys:class{get Te(){return this._instance.config}constructor(t){this.Ba=void 0,this._surveyManager=null,this.Ua=!1,this.za=[],this.Va=null,this.Wa=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return Ql.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if($r(e))return Ql.warn("Flags not loaded yet. Not loading surveys.");var r=Ir(e);this.Ba=r?e.length>0:e,Ql.info("flags response received, isSurveysEnabled: "+this.Ba),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Yl)||null!=i&&i.startsWith(Xl))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.Ua)Ql.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Ql.info(og);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Ql.info("Not loading surveys in cookieless mode without consent.");else{var t=null==aa?void 0:aa.__PosthogExtensions__;if(t){if(!Pr(this.Ba)||this.Te.advanced_enable_surveys){var e=this.Ba||this.Te.advanced_enable_surveys;this.Ua=!0;try{var r=t.generateSurveys;if(r)return void this.Za(r,e);var i=t.loadExternalDependency;if(!i)return void this.Ga(sh);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Ga("Could not load surveys script",r):this.Za(t.generateSurveys,e)}))}catch(t){throw this.Ga("Error initializing surveys",t),t}finally{this.Ua=!1}}}else Ql.error("PostHog Extensions not found.")}}Za(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new ng(this._instance),Ql.info("Surveys loaded successfully"),this.Qa({isLoaded:!0})}Ga(t,e){Ql.error(t,e),this.Qa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.za.push(t),this._surveyManager&&this.Qa({isLoaded:!0}),()=>{this.za=this.za.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Te.disable_surveys)return Ql.info(og),t([]);var r,i=this._instance.get_property(Nu);if(i&&!e)return t(i,{isLoaded:!0}),void(this.Ja()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Va?this.Va.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.Va=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:e=>{var i;this.Va=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ql.error(s),this.Wa=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.Wa=null;var a,l=e.json.surveys||[],u=l.filter((t=>Jl(t)&&(Zl(t)||Kl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Nu]:l,[qu]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}Ja(){return this.Ka()&&!this.Va&&!this.Ya()}Ka(){var t=this._instance.get_property(qu);return Lr(t)&&Date.now()-t>3e5}Ya(){return Lr(this.Wa)&&3e5>Date.now()-this.Wa}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};ru(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Qa(t){for(var e of this.za)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ql.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!$r(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ql.warn("init was not called")}Xa(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}tl(t){if($r(this._surveyManager))return{eligible:!1,reason:sg};var e="string"==typeof t?this.Xa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}el(t){if($r(this._surveyManager))return{eligible:!1,reason:sg};var e="string"==typeof t?this.Xa(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if($r(this._surveyManager))return Ql.warn("init was not called"),{visible:!1,disabledReason:sg};var e=this.el(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return $r(this._surveyManager)?(Ql.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:sg})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.el(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if($r(this._surveyManager))Ql.warn("init was not called");else{var n="string"==typeof t?this.Xa(t):t;if(null!=n&&n.id)if(iu.includes(n.type)){var s=null==os?void 0:os.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ql.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ql.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Ql.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ql.warn("Survey element not found")}else Ql.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ql.warn("Survey not found")}}displaySurvey(t,e){var i;if($r(this._surveyManager))Ql.warn("init was not called");else{var n=this.Xa(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Nl&&e.initialResponses&&Ql.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.tl(n);if(!o.eligible)return void Ql.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ql.warn("Survey not found")}}cancelPendingSurvey(t){$r(this._surveyManager)?Ql.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},wg),Eg={toolbar:class{constructor(t){this.instance=t}rl(t){aa.ph_toolbar_state=t}il(){var t;return null!==(t=aa.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Es(this.instance.config))return!1;if(!is||!os)return!1;t=null!=t?t:is.location,r=null!=r?r:is.history;try{if(!e){try{is.localStorage.setItem("test","test"),is.localStorage.removeItem("test")}catch(t){return!1}e=null==is?void 0:is.localStorage}var i,n=ag||$s(t.hash,"__posthog")||$s(t.hash,"state"),s=n?ks((()=>JSON.parse(atob(decodeURIComponent(n)))))||ks((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(lg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}nl(t){var e=aa.ph_load_toolbar||aa.ph_load_editor;!$r(e)&&Tr(e)?e(t,this.instance):ug.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==os||!os.getElementById(Us));if(!is||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(is.localStorage.setItem(lg,JSON.stringify(r({},n,{source:void 0}))),2===this.il())this.nl(n);else if(0===this.il()){var s;this.rl(1),null==(s=aa.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return ug.error("[Toolbar] Failed to load",t),void this.rl(0);this.rl(2),this.nl(n)})),Ts(is,"turbolinks:load",(()=>{this.rl(0),this.loadToolbar(n)}))}return!0}sl(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)}}},Rg=r({experiments:mg},wg),Pg={conversations:class{constructor(t){this.ol=void 0,this._conversationsManager=null,this.al=!1,this.ll=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;$r(e)||(Nr(e)?this.ol=e:(this.ol=e.enabled,this.ll=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.ol=void 0,this.ll=null}loadIfEnabled(){if(!(this._conversationsManager||this.al||this._instance.config.disable_conversations||Es(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==aa?void 0:aa.__PosthogExtensions__;if(t&&!Pr(this.ol)&&this.ol)if(this.ll&&this.ll.token){this.al=!0;try{var e=t.initConversations;if(e)return this.ul(e),void(this.al=!1);var r=t.loadExternalDependency;if(!r)return void this.hl(sh);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.hl("Could not load conversations script",e):this.ul(t.initConversations),this.al=!1}))}catch(t){this.hl("Error initializing conversations",t),this.al=!1}}else yg.error("Conversations enabled but missing token in remote config.")}}ul(t){if(this.ll)try{this._conversationsManager=t(this.ll,this._instance),yg.info("Conversations loaded successfully")}catch(t){this.hl("Error completing conversations initialization",t)}else yg.error("Cannot complete initialization: remote config is null")}hl(t,e){yg.error(t,e),this._conversationsManager=null,this.al=!1}show(){this._conversationsManager?this._conversationsManager.show():yg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ol&&!Ar(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):(yg.warn(bg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(yg.warn(bg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(yg.warn(bg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(yg.warn(bg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(yg.warn(bg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(yg.warn(bg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(yg.warn(bg),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}Nn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Og={logs:class{constructor(t){var e;this.dl=!1,this.cl=!1,this.it=ys("[logs]"),this.Gr=[],this.vl=[],this.Js=0,this.fl=()=>{var t,e;this.Js=0,null==(t=this.pl)||t.onReconnect(),null==(e=this.gl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.dl=!0),is&&Ts(is,"online",this.fl)}ml(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Pr(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new gn(this.yl(t,e),s,this.it,(()=>this.bl()),(t=>t()),void 0,i),s]}_l(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.pl||this.wl!==e){var r;null==(r=this.pl)||r.reset(),this.wl=e;var i=this.ml((()=>this.Gr),(t=>{this.Gr=t}));this.pl=i[0],this.xl=i[1]}return this.pl}kl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.gl||this.Sl!==e){var r;null==(r=this.gl)||r.reset(),this.Sl=e;var i=this.ml((()=>this.vl),(t=>{this.vl=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},_g);this.gl=i[0],this.Cl=i[1]}return this.gl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!$r(r)&&r&&(this.dl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],null==(t=this.pl)||t.reset(),this.vl=[],null==(e=this.gl)||e.reset(),this.Js=0}captureLog(t){this._l().captureLog(t)}le(t){this.kl().captureLog(t)}get logger(){return this.Ml||(this.Ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Ml}flushLogs(t){t?this.Il(t):(this.pl&&this.pl.flush().catch((t=>this.it.error("PostHog logs flush failed:",t))),this.gl&&this.gl.flush().catch((t=>this.it.error("PostHog logs flush failed:",t))))}loadIfEnabled(){if(this.dl&&!this.cl){var t=null==aa?void 0:aa.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.it.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.cl=!0)})):this.it.error(sh)}else this.it.error("PostHog Extensions not found.")}}yl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===sr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===sr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},$t:t=>this.$t(t),getLibraryId:()=>ps.LIB_NAME,getLibraryVersion:()=>ps.LIB_VERSION}}$t(t){return new Promise((e=>{if(Ls(this.Js,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Tl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.El(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}El(t){(0!==t||this._instance.__loaded)&&(this.Js=Ds(t,this.Js,3,(()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Il(t){this.Gr.length>0&&this.Rl(t,this.Gr,this.xl,ps.LIB_NAME,(t=>{this.Gr=t})),this.vl.length>0&&this.Rl(t,this.vl,this.Cl,_g,(t=>{this.vl=t}))}Rl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=pn(s,fn(r,ps.LIB_NAME,ps.LIB_VERSION),i,ps.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Tl(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Tl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}bl(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=i,$r(n)||(e.sessionStartTimestamp=n),$r(s)||(e.lastActivityTimestamp=s)}if(null!=aa&&null!=(t=aa.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?nn(aa.location.href):aa.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},Fg={metrics:class{constructor(t){this.it=ys("[metrics]"),this._instance=t}initialize(){}_l(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.pl&&this.wl===r||(null==(e=this.pl)||e.reset(),this.wl=r,this.pl=new _n(this.yl(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.it)),this.pl}count(t,e,r){void 0===e&&(e=1),this._l().count(t,e,r)}gauge(t,e,r){this._l().gauge(t,e,r)}histogram(t,e,r){this._l().histogram(t,e,r)}flush(t){if(!this.pl)return Promise.resolve();if(t){var e=this.pl.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.pl.flush().catch((t=>this.it.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.pl)||t.reset()}yl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>ps.LIB_NAME,getLibraryVersion:()=>ps.LIB_VERSION}}Kt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.Pl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}Pl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Ag=r({},wg,xg,kg,Sg,Cg,Mg,Tg,Ig,Eg,Rg,Pg,Og,Fg);Dp.__defaultExtensionClasses=r({},Ag),function(){ps.SDK_DIST_CHANNEL="cdn";var t=aa.posthog;if(!t||Ir(t._i)){var e=kp[Pp]=new Dp;if(t){var r=[];_s(t._i,(function(i){if(i&&Ir(i)){var n=e.init(i[0],i[1],i[2]),s=t[i[2]]||t;n.__loaded&&-1===r.indexOf(s)&&(r.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}}))}e.__SV=1,aa.posthog=e,function(){function t(){t.done||(t.done=!0,Op=!1,_s(kp,(function(t){t._dom_loaded()})))}null!=os&&os.addEventListener?"complete"===os.readyState?t():Ts(os,"DOMContentLoaded",t,{capture:!1}):is&&ms.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
|
|
1
|
+
!function(){"use strict";function t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(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))(l||{}),u=(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))(u||{}),h=(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))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(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))(v||{}),f=(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))(f||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in g?g[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return y[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):r}catch(t){return r}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var _={};function w(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=b(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var x={};function k(t,e,r){var i=t+"."+String(r);if(x[i])return x[i].bind(e);var n=b(t)[r];return"function"!=typeof n?e[r]:(x[i]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function C(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:C};function I(t){return t.nodeType===t.ELEMENT_NODE}function T(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>P(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function P(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return B(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?B(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),I(t)){var r=M.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function F(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&A(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function A(t){return t.toLowerCase()}var L="__rrweb_original__";function D(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?A(e):null}catch(t){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,q=/^(?:[a-z+]+:)?\/\//i,j=/^www\..*/i,H=/^(data:)([^,]*),(.*)/i;function B(t,e){return(t||"").replace(N,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(q.test(l)||j.test(l))return"url("+u+l+u+")";if(H.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var U,z,V="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,Z=1,G=new RegExp("[^a-z0-9-_:]"),Q=-2;function J(){return Z++}var K=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,X=new WeakMap;function tt(t,e){return e&&""!==e.trim()?et(t,e):e}function et(t,e){var r=X.get(t);if(r||(r=t.createElement("a"),X.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function rt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?V:t}(t,e.maxBase64ImageLength):t}function it(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=tt(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,l,s.type,s.quality)),rt(u,s)}if("image"===e)return rt(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=tt(t,i);return"image"===e&&h.startsWith("data:")?rt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Y),e.length>r;){var s=i(K);if(","===s.slice(-1))s=tt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=tt(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?B(i,et(t)):"object"===e&&"data"===r?tt(t,i):i:tt(t,i)}function nt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function st(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&st(M.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&st(M.parentNode(t),e,r)}function ot(t,e,r,i){var n;if(I(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.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(st(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 at(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var lt=new Map;function ut(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function ht(t){return null==t?"":t.toLowerCase()}var dt=50,ct=!1,vt=!1;function ft(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,C=e.onSerialize,P=e.onIframeLoad,O=e.iframeLoadTimeout,N=void 0===O?5e3:O,q=e.onIframeListenerRegistered,j=e.onStylesheetLoad,H=e.stylesheetLoadTimeout,V=void 0===H?5e3:H,W=e.keepIframeSrcFn,Z=void 0===W?()=>!1:W,K=e.newlyAddedElement,Y=void 0!==K&&K,X=e.depth,tt=void 0===X?0:X,rt=e.maxDepth,st=void 0===rt?dt:rt,pt=e.needsMask,gt=e.preserveWhiteSpace,mt=void 0===gt||gt;if(tt>=st)return vt=!0,ct||(ct=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+st+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;pt||(pt=ot(t,o,a,void 0===pt));var yt,bt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=A(t.tagName);return G.test(e)?"div":e}(t),k={},S=t.attributes.length,C=0;S>C;C++){var I=t.attributes[C];nt(x,I.name)||(k[I.name]=it(o,x,A(I.name),I.value,t,c))}if("link"===x&&a){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=ut(o,E))&&E.includes(".css")&&(T=ut(o,window.location.origin+"/"+E.replace(window.location.href,"")))}var P=null;T&&(P=R(T)),P&&(delete k.rel,delete k.href,k._cssText=P)}if("style"===x&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var O=R(t.sheet);O&&(k._cssText=O)}if("input"===x||"textarea"===x||"select"===x){var N=t.value,q=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&N?k.value=F({element:t,type:D(t),tagName:x,value:N,maskInputOptions:u,maskInputFn:h}):q&&(k.checked=q)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((L in n?n[L]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var j=t.toDataURL(c.type,c.quality),H=o.createElement("canvas");H.width=t.width,H.height=t.height,j!==H.toDataURL(c.type,c.quality)&&(k.rr_dataURL=j)}if("img"===x&&v){U||(U=o.createElement("canvas"),z=U.getContext("2d"));var B=t,V=B.currentSrc||B.getAttribute("src")||"<unknown-src>",W=B.crossOrigin,Z=()=>{at(B,"load",Z);try{U.width=B.naturalWidth,U.height=B.naturalHeight,z.drawImage(B,0,0),k.rr_dataURL=U.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?Z():B.addEventListener("load",Z));console.warn("Cannot inline img src="+V+"! Error: "+t)}"anonymous"===B.crossOrigin&&(W?k.crossOrigin=W:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?Z():B.addEventListener("load",Z)}if("audio"===x||"video"===x){var Q=k;Q.rr_mediaState=t.paused?"paused":"played",Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var J=t.getBoundingClientRect(),K=J.width,Y=J.height,X=J.left,tt=J.top,et=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);k={class:k.class,rr_width:K+"px",rr_height:Y+"px",rr_left:Math.floor(X+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(tt+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},et&&(k.rr_position=et.position||"static",et.transform&&"none"!==et.transform&&(k.rr_transform=et.transform),et.display&&et.display.startsWith("inline")&&(k.rr_display=et.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(rt=t,Boolean("svg"===rt.tagName||rt.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s};var rt}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=M.parentNode(t),a=o&&o.tagName,l=M.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=R(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=B(l,et(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,M.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:M.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:Z,newlyAddedElement:Y});if(!bt)return console.warn(t,"not serialized"),null;yt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,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}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ht(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ht(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ht(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ht(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ht(t.attributes.property).match(/^(og|twitter|fb):/)||ht(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ht(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ht(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ht(t.attributes.name))||ht(t.attributes.property).match(/^article:/)||ht(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ht(t.attributes.name)))return!0}}return!1}(bt,m)||!mt&&bt.type===f.Text&&!bt.isStyle&&!bt.textContent.replace(/^\s+|\s+$/gm,"").length?Q:J();var _t=Object.assign(bt,{id:yt});if(i.add(t,_t),yt===Q)return null;C&&C(t);var wt=!u;if(_t.type===f.Element){wt=wt&&!_t.needBlock,delete _t.needBlock;var xt=M.shadowRoot(t);xt&&E(xt)&&(_t.isShadowHost=!0)}if((_t.type===f.Document||_t.type===f.Element)&&wt){m.headWhitespace&&_t.type===f.Element&&"head"===_t.tagName&&(mt=!1);var kt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onIframeListenerRegistered:q,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt+1,maxDepth:st};if(_t.type===f.Element&&"textarea"===_t.tagName&&void 0!==_t.attributes.value);else for(var St of Array.from(M.childNodes(t))){var Ct=ft(St,kt);Ct&&_t.childNodes.push(Ct)}var Mt=null;if(I(t)&&(Mt=M.shadowRoot(t)))for(var It of Array.from(M.childNodes(Mt))){var Tt=ft(It,kt);Tt&&(E(Mt)&&(Tt.isShadow=!0),_t.childNodes.push(Tt))}}var Et=M.parentNode(t);if(Et&&T(Et)&&E(Et)&&(_t.isShadow=!0),_t.type===f.Element&&"iframe"===_t.tagName){var Rt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),at(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?at(t,"load",o):(a=!0,at(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),at(t,"load",o)}}return t.addEventListener("load",o),()=>{at(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&P){var r=ft(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onIframeListenerRegistered:q,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt+1,maxDepth:st});r&&P(t,r)}}),N);null==q||q(t,Rt)}return _t.type===f.Element&&"link"===_t.tagName&&"stylesheet"===_t.attributes.rel&&function(e,l,u){if(!lt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(j){var e=ft(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:pt,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:mt,onSerialize:C,onIframeLoad:P,iframeLoadTimeout:N,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:Z,depth:tt,maxDepth:st});e&&j(t,e)}})()}finally{lt.delete(e),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),lt.set(e,c)}}}(t,0,V),_t}function pt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class gt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof gt))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"}}function mt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>yt(r,t,e,i)}function yt(t,e,r,i){bt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function bt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var _t="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.",wt={map:{},getId(){return console.error(_t),-1},getNode(){return console.error(_t),null},removeNodeFromMap(){console.error(_t)},has(){return console.error(_t),!1},reset(){console.error(_t)}};function xt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function kt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>kt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get(t,e,r){return"map"===e&&console.error(_t),Reflect.get(t,e,r)}}));var St=Date.now;function Ct(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=M.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Mt(){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 Tt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Et(t,e,r,i){if(!t)return!1;var n=Tt(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(st(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 Rt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Q}function Pt(t,e){if(T(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=M.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Pt(i,e))}function Ot(t){return Boolean(t.changedTouches)}function Ft(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function At(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function $t(t){return!!t&&(t instanceof gt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(St=()=>(new Date).getTime());class Lt{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 Dt(t){var e,r=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(r=M.host(M.getRootNode(t))),r}function Nt(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Dt(r);)r=e;return r}(t);return M.contains(e,r)}(t))}function qt(t){return"__ln"in t}class jt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&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 Ht,Bt=(t,e)=>t+"@"+e;class Ut{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,"removesSubTreeCache",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,"canvasMaskingConfigured"),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,"canvasManagerReleased",!1),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 jt,i=t=>{for(var e=t,r=Q;r===Q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=M.parentNode(n);if(s&&Nt(n)&&"TEXTAREA"!==s.tagName){var o=T(s)?this.mirror.getId(Dt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ft(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,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Ft(t,this.mirror)&&this.iframeManager.addIframe(t),At(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),$t(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Vt(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||Vt(this.removesSubTreeCache,o)?Wt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(M.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(M.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=M.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=M.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 e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=F({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:D(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Rt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Et(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ot(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Tt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=D(r);n=F({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Et(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!nt(r.tagName,i))if(o.attributes[i]=it(this.doc,A(r.tagName),A(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Et(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(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Et(t.target,this.blockClass,this.blockSelector,!1)||Rt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Pt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Bt(r,i)]?zt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!T(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),M.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Rt(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[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Et(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),$t(t)&&M.childNodes(M.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","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function zt(t,e){t.delete(e),M.childNodes(e).forEach((e=>zt(t,e)))}function Vt(t,e,r){return 0!==t.size&&function(t,e,r){var i=M.parentNode(e);return!!i&&t.has(i)}(t,e)}function Wt(t,e){return 0!==t.size&&Zt(t,e)}function Zt(t,e){var r=M.parentNode(e);return!!r&&(!!t.has(r)||Zt(t,r))}var Gt=t=>Ht?function(){try{return t(...arguments)}catch(t){if(Ht&&!0===Ht(t))return;throw t}}:t,Qt=[];function Jt(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 Kt(t,e){var r=new Ut;Qt.push(r),r.init(t);var i=new(S())(Gt(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function Yt(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Jt(t);if(o&&!Et(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Ct(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),e({id:h,x:l,y:u}))}},u=[mt("scroll",Gt(xt(Gt((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(mt("scrollend",Gt(l),r)),()=>u.forEach((t=>t()))}function Xt(t,e){for(var r=Qt.length-1;r>=0;r--){var i=Qt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Qt.splice(r,1))}}}var te=["INPUT","TEXTAREA","SELECT"],ee=new WeakMap;function re(t){return function t(e,r){if(oe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||oe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||oe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||oe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ie(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ne(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var a="#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==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&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;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),Gt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function se(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...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){var o=Kt(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=xt(Gt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=Gt(xt(Gt((t=>{var e=Jt(t),r=Ot(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=St()),l.push({x:i,y:o,id:n.getId(e),timeOffset:St()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[mt("mousemove",d,i),mt("touchmove",d,i),mt("drag",d,i)];return Gt((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=A(t),l=(t=>i=>{var a=Jt(i);if(!Et(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Ot(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Ot(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Gt(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(mt(a,l,i))})),Gt((()=>{u.forEach((t=>t()))}))}(t),x=Yt(t),k=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return mt("resize",Gt(xt(Gt((()=>{var t=Mt(),e=It();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),S=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Jt(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=M.parentElement(e)),e&&c&&te.indexOf(c)>=0&&!Et(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=D(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=F({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ee.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ee.set(t,i);var o=n.getId(t);Gt(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>mt(t,Gt(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>kt(t[0],t[1],{set(){Gt(c)({target:this,isTrusted:!1})}},!1,p)))),Gt((()=>{f.forEach((t=>t()))}))}(t),I=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Gt((t=>xt(Gt((e=>{var r=Jt(e);if(r&&!Et(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[mt("play",y(v.Play),m),mt("pause",y(v.Pause),m),mt("seeked",y(v.Seeked),m),mt("volumechange",y(v.VolumeChange),m),mt("ratechange",y(v.RateChange),m)],Gt((()=>{b.forEach((t=>t()))}))),T=()=>{},E=()=>{},R=()=>{},P=()=>{};t.recordDOM&&(T=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Gt(((t,e,s)=>{var o=s[0],a=s[1],l=ie(e,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};ae("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ae("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ae("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ae("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Gt(((t,e,s)=>{var o=s[0],a=s[1],l=ie(e.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...re(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Gt(((t,e,s)=>{var o=s[0],a=ie(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...re(e),o]}]}),t.apply(e,s)}))})})),Gt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),E=ne(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Gt(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=ie(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:re(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Gt(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=ie(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:re(e.parentRule)}),t.apply(e,o)}))}),Gt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(P=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=C(r.fonts,"add",(function(t){return function(r){return setTimeout(Gt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Gt((()=>{n.forEach((t=>t()))}))}(t)));var O=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Gt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Et(d,i,n,!0)||Et(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),mt("selectionchange",a)}(t),L=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?C(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),N=[];for(var q of t.plugins)N.push(q.observer(q.callback,s,q.options));return Gt((()=>{if(n){n.destroy(),n.reset();var e=Qt.indexOf(n);-1!==e&&Qt.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),_(),w(),x(),k(),S(),I(),T(),E(),R(),P(),O(),L(),N.forEach((t=>t()))}))}function oe(t){return void 0!==window[t]}function ae(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class le{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class ue{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new le(J)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new le(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>bt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{yt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);bt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}bt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var 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 l.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),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.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 u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(yt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(yt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{bt((()=>this.mirror.removeNodeFromMap(t)))})),bt((()=>Xt(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&yt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{yt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class he{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){var i,n;if(E(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=Kt(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Qt.indexOf(l);-1!==t&&Qt.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Yt(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(M.host(t))),this.restoreHandlers.push({doc:s,handler:ne({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({doc:e,handler:C(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=M.shadowRoot(this);return s&&Nt(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var de="skip-frame";function ce(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pe=0;64>pe;pe++)fe[ve.charCodeAt(pe)]=pe;var ge=new Map,me=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=ge.get(t);return r||ge.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ye(t,e,r,i){if(t instanceof Array)return t.map((t=>ye(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=ve[r[e]>>2],n+=ve[(3&r[e])<<4|r[e+1]>>4],n+=ve[(15&r[e+1])<<2|r[e+2]>>6],n+=ve[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);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[ye(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ye(t.data,e,r,i),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:me(t,e,r)}:t}var be=(t,e,r,i)=>t.map((t=>ye(t,e,r,i))),_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])))},we=["webgl","webgl2"];function xe(t){return"nodeType"in t}function ke(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return C(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||xe(o)&&Et(o,e,i,!0))return n.call(this,s);xe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=C(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Et(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&we.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Se(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=C(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(me(d,s,this),"tagName"in this.canvas&&!Et(this.canvas,i,n,!0)){var c=be(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=kt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ce,Me,Ie,Te='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Ee="undefined"!=typeof self&&self.Blob&&new Blob([Te],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(self.URL||self.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Te),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Pe{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,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),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 e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=ke(r,i,n,!0),h=new Map;try{a=new Re}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Et(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return de}if(void 0!==o){if(!Array.isArray(o)||!o.every(ce))return de;var a=r/n,l=i/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),r=Math.floor(t.y*l);return{x:e,y:r,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-r}}))}}}(s.canvasMasking,t,c,v,u,d);if(f===de)return void h.set(i,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ke(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=C(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Et(this.canvas,r,i,!0)||setTimeout((()=>{var r=be(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=kt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Se(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Se(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Oe{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Lt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:P(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,lt.forEach((t=>t.abort())),lt.clear()}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 Ae=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var $e=document.createElement("iframe");document.body.appendChild($e),Array.from=(null==(n=$e.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild($e)}}catch(t){console.debug("Unable to override Array.from",t)}var Le=new O,De=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ne(t){void 0===t&&(t={});var e=t,i=e.emit,n=e.checkoutEveryNms,s=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,h=e.blockSelector,d=void 0===h?null:h,c=e.ignoreClass,v=void 0===c?"rr-ignore":c,f=e.ignoreSelector,p=void 0===f?null:f,g=e.maskTextClass,m=void 0===g?"rr-mask":g,y=e.maskTextSelector,b=void 0===y?null:y,_=e.inlineStylesheet,w=void 0===_||_,x=e.maskAllInputs,k=e.maskInputOptions,S=e.slimDOMOptions,C=e.maskInputFn,I=e.maskTextFn,T=e.hooks,E=e.packFn,R=e.sampling,P=void 0===R?{}:R,F=e.dataURLOptions,A=void 0===F?{}:F,L=e.canvasResolutionScale,D=e.canvasMasking,N=e.mousemoveWait,q=e.recordDOM,j=void 0===q||q,H=e.recordCanvas,B=void 0!==H&&H,U=e.recordCrossOriginIframes,z=void 0!==U&&U,V=e.recordAfter,W=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=e.userTriggeredOnInput,G=void 0!==Z&&Z,Q=e.collectFonts,J=void 0!==Q&&Q,K=e.inlineImages,Y=void 0!==K&&K,X=e.plugins,tt=e.keepIframeSrcFn,et=void 0===tt?()=>!1:tt,rt=e.ignoreCSSAttributes,it=void 0===rt?new Set([]):rt,nt=e.attributeFilter;Ht=e.errorHandler;var st=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),ot=!z||window.parent===window,at=!1;if(!ot)try{window.parent.document&&(at=!1)}catch(t){at=!0}if(ot&&!i)throw new Error("emit function is required");if(!ot&&!at)return()=>{};void 0!==N&&void 0===P.mousemove&&(P.mousemove=N),Le.reset();var lt,ut=!0===x?{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!==k?k:{password:!0},ht=pt(void 0!==S&&S);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var dt,ct,vt=0,gt=new Map,yt=t=>{for(var e of X||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!at&&(t=E(t)),t};Ce=(t,e)=>{var r,o=t;if(o.timestamp=St(),!(null==(r=Qt[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&De.has(o.data.source)||Qt.forEach((t=>t.unfreeze())),ot)null==i||i(yt(o),e);else if(at){var a={type:"rrweb",event:yt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)lt=o,vt=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;vt++,(s&&vt>=s||n&&o.timestamp-lt.timestamp>n)&&Me(!0)}};var _t=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Le.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Tt.getIframeElementById(r);n&&i.has(n)?Tt.forgetIframeId(r):(null==dt||dt(r),Tt.removeIframeById(r))}})),null==ct||ct(),Tt.cleanupDetachedIframes()}Ce({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},wt=t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),xt=t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),kt=new Oe({mutationCb:_t,adoptedStyleSheetCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Tt=new ue({mirror:Le,mutationCb:_t,stylesheetManager:kt,recordCrossOriginIframes:z,wrappedEmit:Ce});for(var Et of X||[])Et.getMirror&&Et.getMirror({nodeMirror:Le,crossOriginIframeMirror:Tt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Tt.crossOriginIframeStyleMirror});var Rt=new Fe,Pt=null==D?void 0:D.configured;Ie=new Pe({recordCanvas:B,mutationCb:xt,win:window,blockClass:a,blockSelector:d,mirror:Le,sampling:P.canvas,dataURLOptions:st,resolutionScale:L,canvasMasking:D});var Ot=new he({mutationCb:_t,scrollCb:wt,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskInputOptions:ut,dataURLOptions:st,maskTextFn:I,maskInputFn:C,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,sampling:P,slimDOMOptions:ht,iframeManager:Tt,stylesheetManager:kt,canvasManager:Ie,keepIframeSrcFn:et,processedNodeManager:Rt,attributeFilter:nt},mirror:Le});Me=function(t){if(void 0===t&&(t=!1),j){Ce({type:l.Meta,data:{href:window.location.href,width:It(),height:Mt()}},t),kt.reset(),Ot.init(),Qt.forEach((t=>t.lock()));var e=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new O:i,s=r.blockClass,o=r.blockSelector,a=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,h=r.inlineImages,d=void 0!==h&&h,c=r.recordCanvas,v=void 0!==c&&c,f=r.canvasMaskingConfigured,p=r.maskAllInputs,g=void 0!==p&&p,m=r.slimDOM,y=r.dataURLOptions,b=r.preserveWhiteSpace,_=r.onSerialize,w=r.onIframeLoad,x=r.iframeLoadTimeout,k=r.onIframeListenerRegistered,S=r.onStylesheetLoad,C=r.stylesheetLoadTimeout,M=r.keepIframeSrcFn,I=void 0===M?()=>!1:M,T=r.maxDepth;return ft(t,{doc:t,mirror:n,blockClass:void 0===s?"rr-block":s,blockSelector:void 0===o?null:o,maskTextClass:void 0===a?"rr-mask":a,maskTextSelector:void 0===l?null:l,skipChild:!1,inlineStylesheet:void 0===u||u,maskInputOptions:!0===g?{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===g?{password:!0}:g,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:pt(void 0!==m&&m),dataURLOptions:y,inlineImages:d,recordCanvas:v,canvasMaskingConfigured:f,preserveWhiteSpace:b,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:x,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:T})}(document,{mirror:Le,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskAllInputs:ut,maskTextFn:I,maskInputFn:C,slimDOM:ht,dataURLOptions:st,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,onSerialize(t){Ft(t,Le)&&Tt.addIframe(t),At(t,Le)&&kt.trackLinkElement(t),$t(t)&&Ot.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){Tt.attachIframe(t,e),Ot.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Tt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){kt.attachLinkElement(t,e)},keepIframeSrcFn:et});if(!e)return console.warn("Failed to snapshot the document");Ce({type:l.FullSnapshot,data:{node:e,initialOffset:Ct(window)}},t),Qt.forEach((t=>t.unlock())),Ie.onFullSnapshot(),z&&Tt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&kt.adoptStyleSheets(document.adoptedStyleSheets,Le.getId(document))}};try{var Lt=[];dt=t=>{var e=gt.get(t);e&&(e.forEach((t=>{bt(t);var e=Lt.indexOf(t);-1!==e&&Lt.splice(e,1)})),gt.delete(t))},ct=()=>{for(var t of gt){var e=t[0],r=Le.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var Dt=t=>{var e;return Gt(se)({mutationCb:_t,mousemoveCb:(t,e)=>Ce({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:wt,viewportResizeCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:xt,fontCb:t=>Ce({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){Ce({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){Ce({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:b,maskInputOptions:ut,inlineStylesheet:w,sampling:P,recordDOM:j,recordCanvas:B,canvasMaskingConfigured:Pt,inlineImages:Y,userTriggeredOnInput:G,collectFonts:J,doc:t,maskInputFn:C,maskTextFn:I,keepIframeSrcFn:et,blockSelector:d,slimDOMOptions:ht,dataURLOptions:st,mirror:Le,iframeManager:Tt,stylesheetManager:kt,shadowDomManager:Ot,processedNodeManager:Rt,canvasManager:Ie,ignoreCSSAttributes:it,attributeFilter:nt,plugins:(null==(e=null==X?void 0:X.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ce({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},T)};Tt.addLoadListener((t=>{try{var e=Le.getId(t),r=Dt(t.contentDocument);if(Lt.push(r),-1!==e){var i=gt.get(e);i||gt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Tt.addPageHideListener((t=>{var e=Le.getId(t);null==dt||dt(e),Xt(t)}));var Nt=-1,qt=t=>Ce({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),jt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Le.getId(s):-1;o!==Nt&&(-1!==Nt&&qt({id:Nt,enter:!1}),Nt=o,-1!==o&&qt({id:o,enter:!0}))},Bt=()=>{Me(),Lt.push(Dt(document)),Lt.push(mt("fullscreenchange",jt)),Lt.push(mt("webkitfullscreenchange",jt)),Lt.push(mt("mozfullscreenchange",jt)),Lt.push(mt("MSFullscreenChange",jt)),Ae=!0};return["interactive","complete"].includes(document.readyState)?Bt():(Lt.push(mt("DOMContentLoaded",(()=>{Ce({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===W&&Bt()}))),Lt.push(mt("load",(()=>{Ce({type:l.Load,data:{}}),"load"===W&&Bt()}),window))),()=>{Lt.forEach((t=>bt(t))),Rt.destroy(),Tt.removeLoadListener(),Tt.destroy(),gt.clear(),Ot.reset(),Le.reset(),Ae=!1,Ht=void 0}}catch(t){console.warn(t)}}Ne.addCustomEvent=(t,e)=>{if(!Ae)throw new Error("please add custom event after start recording");Ce({type:l.Custom,data:{tag:t,payload:e}})},Ne.freezePage=()=>{Qt.forEach((t=>t.freeze()))},Ne.takeFullSnapshot=t=>{if(!Ae)throw new Error("please take full snapshot after start recording");Me(t)},Ne.mirror=Le;var qe=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class He{constructor(t){je(this,"fileName"),je(this,"functionName"),je(this,"lineNumber"),je(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 Be=/(^|@)\S+:\d+/,Ue=/^\s*at .*(\S+:\d+|\(native\))/m,ze=/^(eval@)?(\[native code])?$/,Ve={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ue)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ue)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new He({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(ze)}),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 He({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new He({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new He({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new He({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Be)&&!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 He({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function We(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Ze(t){return Array.isArray(t)}function Ge(t){return"object"==typeof t&&null!==t&&!Ze(t)}function Qe(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ge(t[i])&&Qe(t[i],e-1))return!0;return!1}function Je(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Ge(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ge(o)&&Qe(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Ze(u)?We(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ke={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 Ye(t,e,r){var i,n=r?Object.assign({},Ke,r):Ke,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=Ve.parse(e.error).map((t=>t.toString())),s=[Je(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Je("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Je("Uncaught (in promise)",n.stringifyOptions),Je(e.reason,n.stringifyOptions)]);var s=Ve.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Ve.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>Je(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Je("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Xe=t=>({name:"rrweb/console@1",observer:Ye,options:t}),tr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function er(t){return"string"==typeof t||t}function rr(t){return"string"==typeof t?t:void 0}var ir,nr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],sr=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),or=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ar="min_length",lr="max_length",ur=["$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"],hr=["token"],dr="NativeGzipValidationError",cr=t=>t.length>=2&&31===t[0]&&139===t[1],vr=(t,e)=>t===or.GZipJS||e===or.GZipJS||"gzip"===e,fr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),pr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=dr,e},gr=function(){var t=e((function*(t,e){18>t.size&&pr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());cr(r)&&8===r[2]||pr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(ir)return ir;ir=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;ir[t]=e>>>0}return ir})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&pr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&pr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function mr(){return mr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield gr(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),mr.apply(this,arguments)}var yr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],br=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return yr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function _r(t,e){return-1!==t.indexOf(e)}var wr=function(t){return t.trim()},xr=function(t){return t.replace(/^\$/,"")};function kr(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var Sr=Object.prototype,Cr=Sr.hasOwnProperty,Mr=Sr.toString,Ir=Array.isArray||function(t){return"[object Array]"===Mr.call(t)},Tr=t=>"function"==typeof t,Er=t=>t===Object(t)&&!Ir(t),Rr=t=>{if(Er(t)){for(var e in t)if(Cr.call(t,e))return!1;return!0}return!1},Pr=t=>void 0===t,Or=t=>"[object String]"==Mr.call(t),Fr=t=>Or(t)&&0===t.trim().length,Ar=t=>null===t,$r=t=>Pr(t)||Ar(t),Lr=t=>"[object Number]"==Mr.call(t)&&t==t,Dr=t=>Lr(t)&&t>0,Nr=t=>"[object Boolean]"===Mr.call(t),qr=t=>t instanceof FormData,jr=t=>_r(ur,t),Hr=t=>_r(hr,t);function Br(t){return null===t||"object"!=typeof t}function Ur(t,e){return{}.toString.call(t)==="[object "+e+"]"}function zr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Vr=[!0,"true",1,"1","yes"],Wr=t=>_r(Vr,t),Zr=[!1,"false",0,"0","no"];function Gr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),Lr(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Gr(n||r,e,r,i))}class Qr{constructor(t){this.tt={},this.et=t.et,this.rt=Gr(t.bucketSize,0,100,t.it),this.nt=Gr(t.refillRate,0,this.rt,t.it),this.st=Gr(t.refillInterval,0,864e5,t.it)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.rt),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.rt,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var Jr="Mobile",Kr="iOS",Yr="Android",Xr="Tablet",ti=Yr+" "+Xr,ei="iPad",ri="Apple",ii=ri+" Watch",ni="Safari",si="BlackBerry",oi="Samsung",ai=oi+"Browser",li=oi+" Internet",ui="Chrome",hi=ui+" OS",di=ui+" "+Kr,ci="Internet Explorer",vi=ci+" "+Jr,fi="Opera",pi=fi+" Mini",gi="Edge",mi="Microsoft "+gi,yi="Firefox",bi=yi+" "+Kr,_i="Nintendo",wi="PlayStation",xi="Xbox",ki=Yr+" "+Jr,Si=Jr+" "+ni,Ci="Windows",Mi=Ci+" Phone",Ii="Nokia",Ti="Ouya",Ei="Generic",Ri=Ei+" "+Jr.toLowerCase(),Pi=Ei+" "+Xr.toLowerCase(),Oi="Konqueror",Fi="Oculus Browser",Ai="Vivaldi",$i="Yandex",Li="Whale",Di="DuckDuckGo",Ni="Pale Moon",qi="Waterfox",ji="Brave",Hi="Google Search App",Bi="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+Bi),zi=new RegExp(xi,"i"),Vi=new RegExp(wi+" \\w+","i"),Wi=new RegExp(_i+" \\w+","i"),Zi=new RegExp(si+"|PlayBook|BB10","i"),Gi={"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"},Qi=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?ji:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&_r(t,"GSA/")?Hi:_r(t," OPR/")&&_r(t,"Mini")?pi:_r(t," OPR/")?fi:Zi.test(t)?si:_r(t,"IE"+Jr)||_r(t,"WPDesktop")?vi:_r(t,"OculusBrowser")?Fi:_r(t,ai)?li:_r(t,gi)||_r(t,"Edg/")?mi:_r(t,Ai+"/")?Ai:_r(t,"YaBrowser/")?$i:_r(t,Li+"/")?Li:_r(t,Di+"/")||_r(t,"Ddg/")?Di:_r(t,"FBIOS")?"Facebook "+Jr:_r(t,"UCWEB")||_r(t,"UCBrowser")?"UC Browser":_r(t,"CriOS")?di:_r(t,"CrMo")||_r(t,ui)?ui:_r(t,Yr)&&_r(t,ni)?ki:_r(t,"FxiOS")?bi:_r(t.toLowerCase(),Oi.toLowerCase())?Oi:_r(t,ji+"/")?ji:((t,e)=>e&&_r(e,ri)||function(t){return _r(t,ni)&&!_r(t,ui)&&!_r(t,Yr)}(t))(t,e)?_r(t,Jr)?Si:ni:_r(t,"PaleMoon/")?Ni:_r(t,qi+"/")?qi:_r(t,yi)?yi:_r(t,"MSIE")||_r(t,"Trident/")?ci:_r(t,"Gecko")?yi:"")},Ji={[vi]:[new RegExp("rv:"+Bi)],[mi]:[new RegExp(gi+"?\\/"+Bi)],[ui]:[new RegExp("("+ui+"|CrMo)\\/"+Bi)],[di]:[new RegExp("CriOS\\/"+Bi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Bi)],[ni]:[Ui],[Si]:[Ui],[fi]:[new RegExp("(Opera|OPR)\\/"+Bi)],[yi]:[new RegExp(yi+"\\/"+Bi)],[bi]:[new RegExp("FxiOS\\/"+Bi)],[Oi]:[new RegExp("Konqueror[:/]?"+Bi,"i")],[si]:[new RegExp(si+" "+Bi),Ui],[ki]:[new RegExp("android\\s"+Bi,"i")],[li]:[new RegExp(ai+"\\/"+Bi)],[Fi]:[new RegExp("OculusBrowser\\/"+Bi)],[Ai]:[new RegExp(Ai+"\\/"+Bi)],[$i]:[new RegExp("YaBrowser\\/"+Bi)],[Li]:[new RegExp(Li+"\\/"+Bi)],[ji]:[new RegExp(ji+"\\/"+Bi)],[Di]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Bi)],[Ni]:[new RegExp("PaleMoon\\/"+Bi)],[qi]:[new RegExp(qi+"\\/"+Bi)],[Hi]:[new RegExp("GSA\\/"+Bi)],[ci]:[new RegExp("(rv:|MSIE )"+Bi)],Mozilla:[new RegExp("rv:"+Bi)]},Ki=function(t,e,r,i){var n=Qi(t,e,r,i),s=Ji[n];if(Pr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Yi=[[new RegExp(xi+"; "+xi+" (.*?)[);]","i"),t=>[xi,t&&t[1]||""]],[new RegExp(_i,"i"),[_i,""]],[new RegExp(wi,"i"),[wi,""]],[Zi,[si,""]],[new RegExp(Ci,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Mi,""];if(new RegExp(Jr).test(e)&&!/IEMobile\b/.test(e))return[Ci+" "+Jr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Gi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[Ci,i]}return[Ci,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Kr,[t[3],t[4],t[5]||"0"].join(".")]:[Kr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Pr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Yr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Yr+")","i"),t=>t&&t[2]?[Yr,[t[2],t[3],t[4]||"0"].join(".")]:[Yr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[hi,""]],[/Linux|debian/i,["Linux",""]]],Xi=function(t){return Wi.test(t)?_i:Vi.test(t)?wi:zi.test(t)?xi:new RegExp(Ti,"i").test(t)?Ti:new RegExp("("+Mi+"|WPDesktop)","i").test(t)?Mi:/iPad/.test(t)?ei:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ii:Zi.test(t)?si:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ii,"i").test(t)?Ii:/(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(Jr).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)?Yr:ti:new RegExp("(pda|"+Jr+")","i").test(t)?Ri:new RegExp(Xr,"i").test(t)&&!new RegExp(Xr+" pc","i").test(t)?Pi:""},tn=function(t,e){var r,i,n,s,o=Xi(t);return o===ei||o===ti||"Kobo"===o||"Kindle Fire"===o||o===Pi?Xr:o===_i||o===xi||o===wi||o===Ti?"Console":o===ii?"Wearable":o?Jr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Jr:Xr:"Desktop"},en=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rn(t,e){return"string"==typeof(r=t)&&en.test(r)?t:e();var r}function nn(t){return t?t.split("#")[0]:t}function sn(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function on(t,e,r){return an.apply(this,arguments)}function an(){return(an=e((function*(t,e,r){var i;try{return yield Promise.race([t,new Promise(((t,n)=>{i=sn((()=>{try{null==r||r(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(i)}}))).apply(this,arguments)}var ln=t=>t instanceof Error,un={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},hn=un.info;function dn(t){if(Nr(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Ir(t))return{arrayValue:{values:t.map((t=>dn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function cn(t){var e=[];for(var r in t){var i=t[r];Ar(i)||Pr(i)||e.push({key:r,value:dn(i)})}return e}function vn(t,e){var i=un[t.level||"info"]||hn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),$r(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),$r(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:cn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Pr(t.trace_flags)||(u.flags=t.trace_flags),u}function fn(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function pn(t,e,r,i){return{resourceLogs:[{resource:{attributes:cn(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let gn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=r,this.ut=i,this.ht=n,this.dt=s,this.ct=o,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.It=e.maxLogsPerInterval}reset(){this.Tt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Rt(t);if(null!==e)if(e.body){if(this.Pt()){var r={record:vn(e,this.ut())};this.ht((()=>this.Ot(r)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Ir(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.it.info("Log was rejected in beforeSend function"),null;i=s}catch(t){return this.it.error("Error in beforeSend function for log:",t),null}return i}Pt(){if(void 0===this.It)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.It>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.It+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return e((function*(){var e;t.Tt();var r=null!==(e=t._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.ft=0;var a=Math.min(r.length,t.Ct),l=r.slice(0,a),u=l.map((t=>t.record)),h=pn(u,t.At(),null!==(s=t.ct)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.$t(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.Lt(l.length),r=null!==(o=t._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Lt(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.ft),n=null!==(e=r._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(sr.LogsQueue,n.slice(i)),yield r.dt()}))()}At(){return fn(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(sr.LogsQueue))&&void 0!==e?e:[];this.kt>r.length||(r.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(sr.LogsQueue,r),this.xt>r.length?this.Dt():this.Et()}}Dt(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=sn((()=>{this.Nt=void 0,this.Et()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(sr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.Tt();var e=r.flush().catch((()=>{}));void 0!==t?yield on(e,t):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=r.flush();yield on(e,t,(()=>{e.catch((()=>{}))}))}))()}Et(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.Dt(this.qt())}))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var mn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(t){return String(t)+"000000"}function bn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let _n=class{constructor(t,e,r){this._instance=t,this.Te=e,this.it=r,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,r){void 0===e&&(e=1),this.Wt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Wt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Wt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.vt,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.Zt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.vt===n&&(this.vt=null)}));return this.vt=n,n}drainWindow(){if(0===this.Ht.size)return null;var t=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Tt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=bn(e.type,e.name,e.unit,i)}catch(t){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ht.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ht.set(n,s)}var o=this.Ut.get(e.name);void 0===o?this.Ut.set(e.name,e.type):o===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.Dt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(mn.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,mn)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Ir(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.it.info("Metric was rejected in beforeSend function"),null;i=s}catch(t){return this.it.error("Error in beforeSend function for metric:",t),null}return i}Dt(){this.Nt||(this.Nt=sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.it.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Ht.size){var e=t.Ht;t.Ht=new Map,t.Bt=!1,t.Ut=new Map,t.zt=new Set;var r=t.Vt,i=yield t._instance.Kt(t.Gt(e));if(r===t.Vt)switch(i.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Dt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",i.error)}}}))()}Gt(t){return e=this.Xt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:cn(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,i,n,s}Xt(t){var e=yn(Date.now()),i=new Map;for(var n of t.values()){var s,o=bn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=cn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=yn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:e,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:mn})}return Array.from(i.values())}Yt(t){var e,r;for(var i of t){var n=i[0],s=i[1],o=this.Ht.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Qt()&&this.Ht.set(n,s)}}};function wn(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var xn,kn,Sn;function Cn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Sn&&r.length===kn||(kn=r.length,Sn=r.reduce(((r,i)=>{xn||(xn={});var n=xn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,xn[i]=[l,u];break}}return r}),{})),Sn}}class Mn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ir(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:Cn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var In="?";function Tn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?In:r,in_app:!0};return Pr(i)||(s.lineno=i),Pr(n)||(s.colno=n),s}var En=(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]:In,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Rn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,On=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fn=(t,e)=>{var r=Rn.exec(t);if(r)return Tn(e,r[1],In,+r[2],+r[3]);var i=Pn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=On.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=En(i[1]||In,i[2]);return Tn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},An=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ln=(t,e)=>{var r=An.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=$n.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||In,o=En(s,n);return Tn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Dn=/\(error: (.*)\)/,Nn=50;class qn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Or(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 Ur(t,"DOMException")}isDOMError(t){return Ur(t,"DOMError")}}class jn{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 String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Hn{constructor(){}match(t){return Ur(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s: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 Vn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Wn{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 zr(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: "+Vn(t)}isSeverityLevel(t){return Or(t)&&!Fr(t)&&zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(ln(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Zn{match(t){return zr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Vn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return Br(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 Qn{match(t){return Ur(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!zr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return Br(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Jn="$message",Kn="$timestamp",Yn=new Set([Jn,Kn]),Xn={enabled:!0,max_bytes:32768};function ts(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Xn.enabled,max_bytes:rs(t.max_bytes,Xn.max_bytes)}:r({},Xn)}class es{constructor(t){this.$e=[],this.ze=0,this.Te=ts(t)}setConfig(t){this.Te=ts(t),this.Ze()}add(t){var e=function(t){var e;try{e=kr(t)}catch(t){return}try{var r=JSON.parse(e);if(!Er(r))return;var i=r,n=i[Jn],s=i[Kn];if(!Or(n)||0===n.trim().length)return;if(!Or(s)&&!Lr(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Te.max_bytes||(this.$e.push({step:e.step,bytes:r}),this.ze+=r,this.Ze())}}getAttachable(){return this.$e.map((t=>t.step))}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var t=this.$e.shift();t&&(this.ze-=t.bytes)}}}function rs(t,e){if(!Lr(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var is="undefined"!=typeof window?window:void 0,ns="undefined"!=typeof globalThis?globalThis:is,ss=null==ns?void 0:ns.navigator,os=null==ns?void 0:ns.document,as=null==ns?void 0:ns.location,ls=null==ns?void 0:ns.fetch,us=null!=ns&&ns.XMLHttpRequest&&"withCredentials"in new ns.XMLHttpRequest?ns.XMLHttpRequest:void 0,hs=null==ns?void 0:ns.AbortController,ds=null==ns?void 0:ns.CompressionStream,cs=null==ss?void 0:ss.userAgent;function vs(){return!(!is||!1===is.navigator.onLine)}var fs=t=>"undefined"!=typeof Document&&t instanceof Document,ps={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},gs=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(is&&(ps.DEBUG||is.POSTHOG_DEBUG||r)&&!Pr(is.console)&&is.console){for(var i=("__rrweb_original__"in is.console[e]?is.console[e].__rrweb_original__:is.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>gs(t+" "+e,r)};return i},ms=gs("[PostHog.js]"),ys=ms.createLogger;function bs(t,e){Ir(t)&&t.forEach(e)}function _s(t,e){if(!$r(t))if(Ir(t))t.forEach(e);else if(qr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Cr.call(t,r)&&e(t[r],r)}var ws=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function xs(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 ks=function(t){try{return t()}catch(t){return}},Ss=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){ms.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ms.critical(t)}}},Cs=function(t){var e={};return _s(t,(function(t,r){(Or(t)&&t.length>0||Lr(t))&&(e[r]=t)})),e};var Ms=["herokuapp.com","vercel.app","netlify.app"];function Is(t){var e=null==t?void 0:t.hostname;if(!Or(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Ms)if(r===i)return!1;return!0}function Ts(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Es(t){return"ph_toolbar_internal"===t.name}var Rs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return kr(t)}},Ps=t=>{var e=null==os?void 0:os.createElement("a");return Pr(e)?null:(e.href=t,e)},Os=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return _s(t,(function(t,e){Pr(t)||Pr(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)},Fs=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Ir(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){ms.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},As=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Ir(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},$s=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Ls=(t,e)=>t>=e&&vs(),Ds=(t,e,r,i)=>{if(0===t){if(vs()){var n=e+1;return n===r&&i(),n}return e}return 0},Ns=()=>{};function qs(t,e,r){try{if(!(e in t))return Ns;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Tr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Tr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return Ns}}function js(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Hs(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Tr(i))return e;try{var n=i(e);return Or(n)&&n?n:e}catch(t){return ms.error("Error in get_current_url, falling back to window.location.href",t),e}}function Bs(t){var e,r=null==is||null==(e=is.location)?void 0:e.href;return Pr(r)?void 0:Hs(t,r)}var Us="__POSTHOG_TOOLBAR__",zs=1,Vs=3,Ws=11;function Zs(t){return t instanceof Element&&(t.id===Us||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Gs(t){return!!t&&t.nodeType===zs}function Qs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Js(t){return!!t&&t.nodeType===Vs}function Ks(t){return!!t&&t.nodeType===Ws&&Gs(t.host)}var Ys=1e3;function Xs(t){return t?wr(t).split(/\s+/):[]}function to(t,e){var r=Bs(e);return!!(r&&t&&t.some((t=>r.match(t))))}function eo(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 Xs(e)}function ro(t){return $r(t)?null:wr(t).split(/(\s+)/).filter((t=>To(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function io(t){var e="";return bo(t)&&!_o(t)&&t.childNodes&&t.childNodes.length&&_s(t.childNodes,(function(t){var r;Js(t)&&t.textContent&&(e+=null!==(r=ro(t.textContent))&&void 0!==r?r:"")})),wr(e)}function no(t){var e;return Pr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var so=["a","button","form","input","select","textarea","label"];function oo(t,e){if(Pr(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function ao(t){var e=t.parentNode;return!(!e||!Gs(e))&&e}var lo=[".ph-no-autocapture","[data-ph-no-autocapture]"],uo=["next","previous","prev",">","<"],ho=[...uo,"+","-","−","–"],co=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,vo=[".ph-no-deadclick",".ph-no-capture"],fo=[".ph-no-rageclick",".ph-no-capture"],po=["","text","search","email","password","url","tel","number"];function go(t,e){if(!is||mo(t))return!1;var r,i,n,s,o;if(Nr(e)?(r=!!e&&fo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:fo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!Gs(t))&&(!!Qs(t,"textarea")||(Qs(t,"input")?_r(po,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=yo(t,!1).targetElementList;return!function(t,e){if(!1===t||Pr(t))return!1;var r;if(!0===t)r=uo;else{if(!Ir(t))return!1;if(t.length>10)return ms.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>co(e,t)||co(i,t)))}))}(i,a.map((t=>{var e;return{safeText:io(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!oo(a,r)}var mo=t=>!t||Qs(t,"html")||!Gs(t),yo=(t,e)=>{if(!is||mo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!Qs(n,"body");)if(Ks(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ao(n);if(!s)break;if(e||so.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=is.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function bo(t){for(var e=new Set,r=0,i=t;i.parentNode&&!Qs(i,"body");i=i.parentNode){if(r++>=Ys||e.has(i))return!1;e.add(i);var n=eo(i);if(_r(n,"ph-sensitive")||_r(n,"ph-no-capture"))return!1}if(_r(eo(t),"ph-include"))return!0;var s=t.type||"";if(Or(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Or(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function _o(t){return!!(Qs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qs(t,"select")||Qs(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var wo=new RegExp("^(?:(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}))$"),xo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ko=[16,15,14,13],So=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Co=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Mo=/[0-9A-Za-z_]/;function Io(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function To(t,e){if(void 0===e&&(e=!0),$r(t))return!1;if(Or(t)){t=wr(t);var r=e?wo.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(xo.lastIndex=0;e=xo.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of ko){var o=n+s;if(i.length>=o){var a=i.slice(n,o);if(wo.test(a)&&Io(a))return!0}}}return!1}(t);if(r)return!1;var i=e?So.test(t):function(t){var e;for(Co.lastIndex=0;e=Co.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Mo.test(r)&&Mo.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function Eo(t){var e=io(t);return To(e=(e+" "+Ro(t)).trim())?e:""}function Ro(t){var e="";return t&&t.childNodes&&t.childNodes.length&&_s(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=io(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ro(t)).trim())}catch(t){ms.error("[AutoCapture]",t)}})),e}function Po(t){return t.replace(/"|\\"/g,'\\"')}function Oo(t){var e=t.attr__class;if(e)return Ir(e)?e:Xs(e)}var Fo=1e6,Ao={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:Fo,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},$o=ys("[Recorder]"),Lo=t=>"navigation"===t.entryType,Do=t=>"resource"===t.entryType;function No(t,e){return!!e&&(Nr(e)||e[t])}function qo(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var jo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ho(t){var e=t.type,r=t.recordBody,i=t.headers;function n(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.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!qo(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(jo))return!1;if(Nr(r))return!0;if(Ir(r))return n(r);var s=r[e];return Nr(s)?s:n(s)}function Bo(t,e,r,i,n,s){return Uo.apply(this,arguments)}function Uo(){return Uo=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return $o.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Do(o=t[s])&&o.initiatorType===e&&(Pr(i)||o.startTime>=i)&&(Pr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Bo(t,e,r,i,n,s+1))})),Uo.apply(this,arguments)}function zo(t){var e=t.body,r=t.options,i=t.url;if($r(e))return null;var n=js(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Or(e))return e;if(fs(e))return e.textContent;if(qr(e))return Os(e);if(Er(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 Vo=t=>!Ar(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Wo(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Pr(a)?void 0:Math.round(a),endTime:Pr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Vo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Zo=["video/","audio/"];function Go(t){return Er(t)&&Tr(t.getReader)&&Tr(t.tee)}var Qo=500,Jo="[SessionReplay] Timeout while trying to read body",Ko="[SessionReplay] Failed to read body";function Yo(t){return Ko+": "+t}function Xo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function ta(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Jo)),Qo);try{t.clone().text().then((t=>e(t)),(t=>e(Yo(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Ko)}}))}(t);var r=function(t){var e;return Math.min(Fo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Fo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Xo(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(Jo)),Qo);try{a=t.clone()}catch(t){return void o(Ko)}var u=a.body;if(Go(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(Ko)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Xo(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Yo(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Yo(t))))}catch(t){o(Ko)}}))}(t,r)}function ea(){return ea=e((function*(t){var e=t.r,r=t.options,i=js(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):ta(e,r)})),ea.apply(this,arguments)}function ra(){return ra=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Zo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=js(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Ar(i)?ta(e,r):Promise.resolve(i)})),ra.apply(this,arguments)}var ia=null;function na(t,i,n){if(!("performance"in i))return()=>{};if(ia)return $o.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ao,n):Ao,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Lo(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Wo({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=>Lo(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Wo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=No("request",r.recordHeaders),n=No("response",r.recordHeaders),s=qs(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Ho({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=zo({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.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),Ho({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=zo({body:d.response,options:r,url:a})),Bo(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Wo({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){$o.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=No("request",i.recordHeaders),s=No("response",i.recordHeaders),o=qs(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return $o.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Go(null==a?void 0:a.body)&&Ho({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return ea.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){$o.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=qo(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),Ho({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ra.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Bo(r,"fetch",l.url,h,d).then((e=>{var r,i=Wo({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),ia=()=>{a(),l(),u(),ia=null}}var sa=t=>({name:"rrweb/network@1",observer:na,options:t}),oa="undefined"!=typeof globalThis?globalThis:is;oa&&"undefined"==typeof self&&(oa.self=oa),oa&&"undefined"==typeof File&&(oa.File=function(){});var aa=null!=is?is:{};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Xe,getRecordNetworkPlugin:sa},aa.__PosthogExtensions__.rrweb={record:Ne,version:"v2",wasMaxDepthReached:()=>vt,resetMaxDepthState(){vt=!1,ct=!1}},aa.rrweb={record:Ne,version:"v2"},aa.rrwebConsoleRecord={getRecordConsolePlugin:Xe},aa.getRecordNetworkPlugin=sa;var la,ua,ha,da,ca,va,fa,pa,ga,ma,ya,ba,_a,wa,xa,ka={},Sa=[],Ca=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ma=Array.isArray;function Ia(t,e){for(var r in e)t[r]=e[r];return t}function Ta(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ea(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?la.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Ra(t,o,i,n,null)}function Ra(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ha:n,__i:-1,__u:0};return null==n&&null!=ua.vnode&&ua.vnode(s),s}function Pa(t){return t.children}function Oa(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?$(t):null}function Fa(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=Ia({},e);s.__v=e.__v+1,ua.vnode&&ua.vnode(s),Ua(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?$(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Va(i,s,n),e.__e=e.__=null,s.__e!=r&&Aa(s)}}function Aa(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Aa(t)}function $a(t){(!t.__d&&(t.__d=!0)&&da.push(t)&&!La.__r++||ca!=ua.debounceRendering)&&((ca=ua.debounceRendering)||va)(La)}function La(){try{for(var t,e=1;da.length;)da.length>e&&da.sort(fa),t=da.shift(),e=da.length,Fa(t)}finally{da.length=La.__r=0}}function Da(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||Sa,b=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Ra(null,o,null,null,null):Ma(o)?o=t.__k[s]=Ra(Pa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Ra(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=qa(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Qa(a,a));return i}(r,e,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ka,v.__i=d,g=Ua(t,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ga(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=Na(v,l,t,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function Na(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Na(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=$(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function qa(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ja(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ca.test(e)?r:r+"px"}function Ha(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||ja(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||ja(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ya,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[ma]=i[ma]:(r[ma]=ba,t.addEventListener(e,s?wa:_a,s)):t.removeEventListener(e,s?wa:_a,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function Ba(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[ga])e[ga]=ba++;else if(r[ma]>e[ga])return;return r(ua.event?ua.event(e):e)}}}function Ua(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ua.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(b?e.__c=c=new C(y,_):(e.__c=c=new Oa(y,_),c.constructor=C,c.render=Ja),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=C.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ia({},c.__s)),Ia(c.__s,C.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=e,v)b&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),Sa.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=t,c.__e=!1,w=ua.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),Sa.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=Ia(Ia({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Pa&&null==h.key?Wa(h.props.children):h,a=Da(t,Ma(k)?k:[k],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(S=s.length;S--;)Ta(s[S]);za(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||za(e);ua.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=Za(r.__e,e,r,i,n,s,o,l,u);return(h=ua.diffed)&&h(e),128&e.__u?void 0:a}function za(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(za))}function Va(t,e,r){for(var i=0;r.length>i;i++)Ga(r[i],r[++i],r[++i]);ua.__c&&ua.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ua.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b>0?t:Ma(t)?t.map(Wa):void 0!==t.constructor?null:Ia({},t)}function Za(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ka,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ua.__m&&ua.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&la.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Ha(t,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||Ha(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Da("template"==e.type?t.content:t,Ma(c)?c:[c],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)Ta(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Ha(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Ha(t,u,p,g[u],n))}return t}function Ga(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ua.__e(t,r)}}function Qa(t,e,r){var i,n;if(ua.unmount&&ua.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ga(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ua.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Qa(i[n],e,r||"function"!=typeof t.type);r||Ta(t.__e),t.__c=t.__=t.__e=void 0}function Ja(t,e,r){return this.constructor(t,r)}function Ka(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ua.__&&ua.__(t,e),i=e.__k,n=[],s=[],Ua(e,t=e.__k=Ea(Pa,null,[t]),i||ka,ka,e.namespaceURI,i?null:e.firstChild?la.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Va(n,t,s),t.props.children=null}la=Sa.slice,ua={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ha=0,Oa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ia({},this.state),"function"==typeof t&&(t=t(Ia({},r),this.props)),t&&Ia(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),$a(this))},Oa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$a(this))},Oa.prototype.render=Pa,da=[],va="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(t,e){return t.__v.__b-e.__v.__b},La.__r=0,pa=Math.random().toString(8),ga="__d"+pa,ma="__a"+pa,ya=/(PointerCapture)$|Capture$/i,ba=0,_a=Ba(!1),wa=Ba(!0),xa=0;var Ya,Xa,tl,el,rl=0,il=[],nl=ua,sl=nl.__b,ol=nl.__r,al=nl.diffed,ll=nl.__c,ul=nl.unmount,hl=nl.__;function dl(t,e){nl.__h&&nl.__h(Xa,t,rl||e),rl=0;var r=Xa.__H||(Xa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function cl(t){return rl=1,function(t,e,r){var i=dl(Ya++,2);if(i.t=t,!i.__c&&(i.__=[kl(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=Xa,!Xa.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};Xa.__f=!0;var s=Xa.shouldComponentUpdate,o=Xa.componentWillUpdate;Xa.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Xa.shouldComponentUpdate=n}return i.__N||i.__}(kl,t)}function vl(t,e){var r=dl(Ya++,3);!nl.__s&&xl(r.__H,e)&&(r.__=t,r.u=e,Xa.__H.__h.push(r))}function fl(t){return rl=5,pl((function(){return{current:t}}),[])}function pl(t,e){var r=dl(Ya++,7);return xl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function gl(t){var e=Xa.context[t.__c],r=dl(Ya++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Xa)),e.props.value):t.__}function ml(){for(var t;t=il.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(_l),e.__h.some(wl),e.__h=[]}catch(r){e.__h=[],nl.__e(r,t.__v)}}}nl.__b=function(t){Xa=null,sl&&sl(t)},nl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),hl&&hl(t,e)},nl.__r=function(t){ol&&ol(t),Ya=0;var e=(Xa=t.__c).__H;e&&(tl===Xa?(e.__h=[],Xa.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&ml(),Ya=0)),tl=Xa},nl.diffed=function(t){al&&al(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==il.push(e)&&el===nl.requestAnimationFrame||((el=nl.requestAnimationFrame)||bl)(ml)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),tl=Xa=null},nl.__c=function(t,e){e.some((function(t){try{t.__h.some(_l),t.__h=t.__h.filter((function(t){return!t.__||wl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],nl.__e(r,t.__v)}})),ll&&ll(t,e)},nl.unmount=function(t){ul&&ul(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{_l(t)}catch(t){e=t}})),r.__H=void 0,e&&nl.__e(e,r.__v))};var yl="function"==typeof requestAnimationFrame;function bl(t){var e,r=function(){clearTimeout(i),yl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);yl&&(e=requestAnimationFrame(r))}function _l(t){var e=Xa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Xa=e}function wl(t){var e=Xa;t.__c=t.__(),Xa=e}function xl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function kl(t,e){return"function"==typeof e?e(t):e}function Sl(t){var e=!0;return{dispose(){if(e){e=!1;var r=t();r&&Tr(r.then)&&r.then(void 0,(()=>{}))}}}}var Cl="gzip-js",Ml="base64",Il="events",Tl="cancelEvents",El={Tab:"tab",Selector:"selector"},Rl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Pl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Ol={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Fl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Al={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},$l="always",Ll={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Dl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Nl="popover";function ql(t){return"$survey_response_"+t}function jl(t,e){if(!e)return null;var r=t[ql(e)];return Ir(r)?[...r]:r}function Hl(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Pr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=jl(t,e.id);Pr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:jl(t,e.id)})))},t,i)}function Bl(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}function Ul(t){return"string"==typeof t&&t.trim()?t.trim():null}function zl(t){return t.toLowerCase()}function Vl(t,e,r){if(!t||!e)return null;var i=zl(e),n=Object.keys(t).find((t=>zl(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>zl(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Wl(t,e,i){var n,s=Vl(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Pr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Pr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Pr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Pr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Pr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Pr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Pr(t.thankYouMessageHeader)&&Pr(t.thankYouMessageDescription)&&Pr(t.thankYouMessageCloseButtonText)&&Pr(t.submitButtonText)&&Pr(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Vl(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Pr(o.question)||(a.question=o.question,l=!0),Pr(o.description)||(a.description=o.description,l=!0),Pr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Pr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Pr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Pr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Ir(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function Zl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Gl(t){var e;return Zl(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ql=ys("[Surveys]");function Jl(t){return!(!t.start_date||t.end_date)}function Kl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Yl="seenSurvey_",Xl="inProgressSurvey_",tu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),eu=t=>tu(Yl,t),ru=t=>{try{var e=eu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ql.error("Failed to persist survey seen state",t)}},iu=[Ol.Popover,Ol.Widget,Ol.API],nu={ignoreConditions:!1,ignoreDelay:!1,displayType:Nl},su="$people_distinct_id",ou="$device_id",au="$device_model",lu="__alias",uu="__timers",hu="$autocapture_disabled_server_side",du="$heatmaps_enabled_server_side",cu="$exception_capture_enabled_server_side",vu="$error_tracking_suppression_rules",fu="$error_tracking_capture_extension_exceptions",pu="$web_vitals_enabled_server_side",gu="$dead_clicks_enabled_server_side",mu="$product_tours_enabled_server_side",yu="$web_vitals_allowed_metrics",bu="$session_recording_remote_config",_u="$replay_sample_rate",wu="$replay_override_sampling",xu="$replay_override_linked_flag",ku="$replay_override_url_trigger",Su="$replay_override_event_trigger",Cu="$sesid",Mu="$session_is_sampled",Iu="$enabled_feature_flags",Tu="$active_feature_flags",Eu="$early_access_features",Ru="$feature_flag_details",Pu="$feature_flag_payloads",Ou="$feature_flag_request_id",Fu="$minimal_flag_called_events",Au="$override_feature_flags",$u="$override_feature_flag_payloads",Lu="$stored_person_properties",Du="$stored_group_properties",Nu="$surveys",qu="$surveys_loaded_at",ju="$surveys_activated",Hu="$surveys_activated_session",Bu="ph_product_tours",Uu="$flag_call_reported",zu="$flag_call_reported_session_id",Vu="$feature_flag_errors",Wu="$feature_flag_evaluated_at",Zu="$user_state",Gu="$client_session_props",Qu="$capture_rate_limit",Ju="$initial_campaign_params",Ku="$initial_referrer_info",Yu="$initial_person_info",Xu="$epp",th="$posthog_cookieless",eh="$cookieless_mode",rh="$sdk_debug_extensions_init_method",ih="$sdk_debug_extensions_init_time_ms",nh="$sdk_debug_recording_script_not_loaded",sh="PostHog loadExternalDependency extension not found.",oh="on_reject",ah="always",lh="anonymous",uh="identified",hh="identified_only",dh="visibilitychange",ch="beforeunload",vh="$pageview",fh="$pageleave",ph="$identify",gh="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Lr(t)&&isFinite(t)&&Math.floor(t)===t});class mh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,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 mh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new mh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class yh{generate(){var t=this.generateOrAbort();if(!Pr(t))return t;this.S=0;var e=this.generateOrAbort();if(Pr(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.M++,this.M>4398046511103&&(this.S++,this.C())}return mh.fromFieldsV7(this.S,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.M=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}constructor(){this.S=0,this.M=0,this.I=new wh}}var bh,_h=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};is&&!Pr(is.crypto)&&crypto.getRandomValues&&(_h=t=>crypto.getRandomValues(t));class wh{nextUint32(){return this.R.length>this.O||(_h(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var xh=()=>kh().toString(),kh=()=>(bh||(bh=new yh)).generate(),Sh=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 Ch(t,e,r){return Rs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Mh={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=>Sh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Sh(e,t))))),icontains:(t,e)=>e.map(Ih).some((e=>t.map(Ih).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Ih).every((e=>t.map(Ih).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)))}))},Ih=t=>t.toLowerCase();function Th(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Pr(i)||Ar(i))return!1;var n=[String(i)],s=Mh[r.operator];return!!s&&s(r.values,n)}))}var Eh=t=>{if(os){try{for(var e=t+"=",r=os.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Rh="",Ph=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Oh={N:()=>!!os,P(t){ms.error("cookieStore error: "+t)},q:Eh,F(t){var e;try{e=JSON.parse(Oh.q(t))||{}}catch(t){}return e},A(t,e,r,i,n){if(!os)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=os),Rh)return Rh;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_"+xh();!Rh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Rh=s)}return Rh}(t);if(!r){var i=(t=>{var e=t.match(Ph);return e?e[0]:""})(t);i!==r&&ms.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(os.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ms.warn("cookieStore warning: large cookie, len="+u.length),os.cookie=u,!0}catch(t){return!1}},D(t,e){if(null!=os&&os.cookie)try{Oh.A(t,"",-1,e)}catch(t){return}}},Fh=null,Ah={N(){if(!Ar(Fh))return Fh;var t=!0;if(Pr(is))t=!1;else try{var e="__mplssupport__";Ah.A(e,"xyz"),'"xyz"'!==Ah.q(e)&&(t=!1),Ah.D(e)}catch(e){t=!1}return t||ms.error("localStorage unsupported; falling back to cookie store"),Fh=t,t},P(t){ms.error("localStorage error: "+t)},q(t){try{return null==is?void 0:is.localStorage.getItem(t)}catch(t){Ah.P(t)}return null},F(t){try{return JSON.parse(Ah.q(t))||{}}catch(t){}return null},A(t,e){try{return null==is||is.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ah.P(t)}return!1},D(t){try{null==is||is.localStorage.removeItem(t)}catch(t){Ah.P(t)}}},$h=[ou,"distinct_id",Cu,Mu,Xu,Yu,Zu],Lh={},Dh={N:()=>!0,P(t){ms.error("memoryStorage error: "+t)},q:t=>Lh[t]||null,F:t=>Lh[t]||null,A:(t,e)=>(Lh[t]=e,!0),D(t){delete Lh[t]}},Nh=null,qh={N(){if(!Ar(Nh))return Nh;if(Nh=!0,Pr(is))Nh=!1;else try{var t="__support__";qh.A(t,"xyz"),'"xyz"'!==qh.q(t)&&(Nh=!1),qh.D(t)}catch(t){Nh=!1}return Nh},P(t){ms.error("sessionStorage error: ",t)},q(t){try{return null==is?void 0:is.sessionStorage.getItem(t)}catch(t){qh.P(t)}return null},F(t){try{return JSON.parse(qh.q(t))||null}catch(t){}return null},A(t,e){try{return null==is||is.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){qh.P(t)}return!1},D(t){try{null==is||is.sessionStorage.removeItem(t)}catch(t){qh.P(t)}}},jh=ys("[Stylesheet Loader]"),Hh=is,Bh=os,Uh="#020617",zh={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:Rl.Right,widgetType:El.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Uh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Vh=[Rl.Center,Rl.Left,Rl.Right];function Wh(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 Zh(t){var e;void 0===t&&(t=zh.backgroundColor),"#"===t[0]&&(e=Wh(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=Wh(r)),!e)return Uh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Uh:"white"}return Uh}var Gh=(t,e,i)=>{var n=cd(t),s=Bh.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Bh.createElement("div");((t,e,i)=>{var n=r({},zh,i),s=t.style,o=!Vh.includes(n.position)||e===Ol.Widget&&(null==i?void 0:i.widgetType)===El.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Zh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Zh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Zh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Zh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Zh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Tr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(jh.error("prepare_external_dependency_stylesheet returned null"),null)})(Bh,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.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-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Bh.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Qh=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(ru(i),s.capture(Ll.SENT,r({[Dl.SURVEY_NAME]:i.name,[Dl.SURVEY_ID]:i.id,[Dl.SURVEY_ITERATION]:i.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Dl.SURVEY_SUBMISSION_ID]:n,[Dl.SURVEY_COMPLETED]:o},l&&{[Dl.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Hl(e,i),a,{$set:{[Bl(i,"responded")]:!0}})),o&&(Hh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),dd(i),s.reloadFeatureFlags())):Ql.error("[survey sent] event not captured, PostHog instance not found.")},Jh=(t,e,i)=>{return r({[Dl.SURVEY_NAME]:t.name,[Dl.SURVEY_ID]:t.id,[Dl.SURVEY_ITERATION]:t.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Dl.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!$r(t))))},(null==e?void 0:e.surveyLanguage)&&{[Dl.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Dl.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Hl(null==e?void 0:e.responses,t));var n},Kh=(t,e,i,n)=>{if(e){if(!i){var s=ud(t);e.capture(Ll.DISMISSED,r({},Jh(t,s,e),n&&{[Dl.SURVEY_LANGUAGE]:n},{$set:{[Bl(t,"dismissed")]:!0}})),dd(t),ru(t),Hh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ql.error("[survey dismissed] event not captured, PostHog instance not found.")},Yh=(t,e)=>{if(e){var r=(t=>tu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=ud(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Ll.ABANDONED,Jh(t,i,e),{transport:"sendBeacon"})}}else Ql.error("[survey abandoned] event not captured, PostHog instance not found.")},Xh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),td=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ed=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?td(t.questions,Xh(t.questions)):t.questions,rd=t=>Gl(t)||hd(t),id=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,$a(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"+xa++,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(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),nd=()=>gl(id),sd=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=Ia({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?la.call(arguments,2):r),Ra(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function od(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Bs(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return Mh[o](s,[n])}var ad=t=>tu(Xl,t),ld=(t,e)=>{try{localStorage.setItem(ad(t),JSON.stringify(e))}catch(t){Ql.error("Error setting in-progress survey state in localStorage",t)}},ud=t=>{try{var e=localStorage.getItem(ad(t));if(e)return JSON.parse(e)}catch(t){Ql.error("Error getting in-progress survey state from localStorage",t)}return null},hd=t=>{var e=ud(t);return!$r(null==e?void 0:e.surveySubmissionId)},dd=t=>{try{localStorage.removeItem(ad(t))}catch(t){Ql.error("Error clearing in-progress survey state from localStorage",t)}};function cd(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function vd(t,e,r){if(void 0===e&&(e=Rl.Right),t===Ol.ExternalSurvey)return{};switch(e){case Rl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Rl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Rl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Rl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Rl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Rl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Rl.Left:return{left:"30px"};case Rl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ol.Widget&&r===El.Tab?"60px":"30px"}}}var fd=0;function pd(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--fd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ua.vnode&&ua.vnode(u),u}var gd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),md=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),yd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),bd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),_d=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:pd("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"})}),wd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:pd("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"})}),xd=pd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:pd("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"})}),kd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return pd("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[pd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),pd("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:r})]})},Sd=pd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[pd("g",{"clip-path":"url(#clip0_2415_6911)",children:[pd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:pd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),pd("g",{mask:"url(#mask0_2415_6911)",children:[pd("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"}),pd("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"}),pd("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"}),pd("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"}),pd("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"}),pd("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"})]})]}),pd("defs",{children:pd("clipPath",{id:"clip0_2415_6911",children:pd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Cd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return pd("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Sd]})}function Md(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=gl(id).isPreviewMode,d=!!l&&!!u,c=!a&&pd("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==is||is.open(s)),h?null==o||o():n()},children:e});return pd("div",{className:"bottom-section",children:[d?pd("div",{className:"form-buttons form-buttons-with-back",children:[pd("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&pd(Cd,{urlParams:{utm_source:"survey-footer"}})]})}function Id(t){var e=t.question,r=t.forceDisableHtml;return pd("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[pd(e.type===Fl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&sd({component:Ea("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Td(t){return pd("button",{className:"form-cancel",onClick:t.onClick,disabled:gl(id).isPreviewMode,"aria-label":"Close survey",type:"button",children:kd({fill:"black"})})}pd("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:pd("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 Ed=is;function Rd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=gl(id).isPopup;return vl((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ts(Ed,"keydown",t),()=>{Ed.removeEventListener("keydown",t)}}),[o]),pd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&pd(Td,{onClick:()=>o()}),pd("h3",{className:"thank-you-message-header",children:e}),r&&sd({component:Ea("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&pd(Md,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Pd=t=>Ir(t)&&t.every((t=>Or(t)));function Od(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=nd().isPreviewMode,d=fl(null),c=cl((()=>Or(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;vl((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=pl((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case ar:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case lr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),y=wn(e.validation,ar),b=wn(e.validation,lr),_=pl((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:e,forceDisableHtml:r,htmlFor:g}),pd("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),_&&pd("div",{className:"validation-hint",children:_})]}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Fd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return pd(Pa,{children:[pd("div",{className:"question-container",children:pd(Id,{question:e,forceDisableHtml:t.forceDisableHtml})}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Ad(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=cl((()=>Lr(l)?l:Ir(l)&&l.length>0&&Lr(parseInt(l[0]))?parseInt(l[0]):Or(l)&&Lr(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=nd().isPreviewMode,y=t=>m?a(t):o(t);return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:r,forceDisableHtml:i}),pd("div",{className:"rating-section",children:[pd("div",{className:"rating-options",children:["emoji"===r.display&&pd("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=jd[r.scale])?void 0:e.map(((t,e)=>pd("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&pd("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Hd(r.scale).map(((t,e)=>pd($d,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&pd("div",{className:"rating-text",children:[pd("div",{children:r.lowerBoundLabel}),pd("div",{children:r.upperBoundLabel})]})]})]}),pd(Md,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ar(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function $d(t){var e=t.num,r=t.setActiveNumber;return pd("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function Ld(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=fl(null),c=pl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=td(e,Xh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=cl((()=>((t,e)=>Or(t)||Pd(t)?t:e===Fl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=cl((()=>((t,e)=>{if(Or(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Pd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=nd().isPreviewMode,_=e.type===Fl.SingleChoice,w=e.type===Fl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),b&&a(t)));w&&Ir(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},M=()=>!(e.optional||!Ar(f)&&(!Ir(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),I=()=>{m.isSelected&&w?Ir(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return pd(Pa,{children:[pd("div",{className:"question-container",children:[pd(Id,{question:e,forceDisableHtml:i}),pd("fieldset",{className:"multiple-choice-options limit-height",children:[pd("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===t:Ir(f)&&f.includes(t);return pd("label",{className:i?"choice-option-open":"",children:[pd("div",{className:"response-choice",children:[pd("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(t,i),id:s,"aria-controls":o}),pd("span",{children:i?t+":":t})]}),i&&pd("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),pd(Md,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:s,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Dd=[1,2,3,4,5],Nd=[1,2,3,4,5,6,7],qd=[0,1,2,3,4,5,6,7,8,9,10],jd={2:[wd,xd],3:[yd,md,gd],5:[bd,yd,md,gd,_d]};function Hd(t){switch(t){case 5:default:return Dd;case 7:return Nd;case 10:return qd}}var Bd=ys("[Surveys]");function Ud(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Al.End:s;if(n.branching.type===Al.End)return Al.End;if(n.branching.type===Al.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Al.ResponseBased){if(n.type===Fl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Al.End?Al.End:s}}else if(n.type===Fl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Al.End?Al.End:s}}return s}return Bd.warn("Falling back to next question index due to unexpected branching type"),s}var zd="https?://(.*)",Vd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Wd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Vd],Zd="<masked>",Gd=["li_fat_id"];function Qd(t,e,r){if(!os)return{};var i,n=e?[...Vd,...r||[]]:[],s=Jd(As(os.URL,n,Zd),t),o=(i={},_s(Gd,(function(t){var e=Eh(t);i[t]=e||null})),i);return ws(o,s)}function Jd(t,e){var r=Wd.concat(e||[]),i={};return _s(r,(function(e){var r=Fs(t,e);i[e]=r||null})),i}function Kd(t){var e=function(t){return t?0===t.search(zd+"google.([^/?]*)")?"google":0===t.search(zd+"bing.com")?"bing":0===t.search(zd+"yahoo.com")?"yahoo":0===t.search(zd+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Ar(e)){i.$search_engine=e;var n=os?Fs(os.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Yd(){return navigator.language||navigator.userLanguage}var Xd="$direct";function tc(){return(null==os?void 0:os.referrer)||Xd}function ec(t,e,r){void 0===r&&(r=!1);var i=t?[...Vd,...e||[]]:[],n=r?nn(null==as?void 0:as.href):null==as?void 0:as.href,s=null==n?void 0:n.substring(0,1e3);return{r:tc().substring(0,1e3),u:s?As(s,i,Zd):void 0}}function rc(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?nn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==Xd?Xd:null==(r=Ps(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ps(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=Jd(s);ws(o,l)}if(i){var u=Kd(i);ws(o,u)}return o}function ic(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function nc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var sc=ys("[SurveyTranslations]");function oc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=Ul(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Ul(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Ul(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Tr(t.get_property)?t.get_property(Lu):void 0,locale:Yd()},sc)}(e);if(!r)return sc.info("No user language detected"),{survey:t,language:null};var i=Wl(t,r,sc);return{survey:i.survey,language:i.matchedKey}}var ac=is,lc=os,uc="ph:show_survey_widget",hc="PHWidgetSurveyClickListener";function dc(t,e){try{var r=t.getBoundingClientRect(),i=ac.innerHeight,n=ac.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:zh.zIndex}}catch(t){return Ql.warn("Failed to calculate trigger position:",t),null}}class cc{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Nu);if(t)for(var e of t)hd(e)&&Yh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=this.U(t),l=a.survey,u=a.language,h=null!=e&&e.position||null!=e&&e.selector?r({},l,{appearance:r({},l.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):l;this.W(h.id);var d=null!=e?e:{},c=d.properties,v=d.initialResponses,f=!(!v||0>=Object.keys(v).length)&&this.V(h,v,c,u);if(!f||null!=(i=h.appearance)&&i.displayThankYouMessage){this.Z(h);var p={};if((null==(n=h.appearance)?void 0:n.position)===Rl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=lc.querySelector(h.appearance.widgetSelector);m&&(p=dc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||zh.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,b=Gh(h,this._posthog).shadow,_={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=y)return Ka(pd(gc,r({},_)),b);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Ql.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Ka(pd(gc,r({},_,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),b)}),1e3*y);this.j.set(h.id,w)}},this.Y=t=>{var e=this.U(t),r=e.survey,i=e.language,n=Gh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Ka(pd(yc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.K=t=>{this.J(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(hc),this.H.delete(t.id),Ql.info("Removed click listener for survey "+t.id))},this.X=(t,e)=>{var r=lc.querySelector(e),i=this.H.get(t.id);if(r){if(this.Y(t),i){if(r===i.element)return;Ql.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.K(t)}if(!r.hasAttribute(hc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Rl.NextToTrigger?dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||zh.maxWidth)):{};ac.dispatchEvent(new CustomEvent(uc,{detail:{surveyId:t.id,position:n}}))};Ts(r,"click",n),r.setAttribute(hc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ql.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.K(t)},this.renderPopover=t=>{var e=this.U(t),r=e.survey,i=e.language,n=Gh(r,this._posthog).shadow;Ka(pd(gc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.U(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o,r)),Ka(pd(gc,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.G(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Ol.Popover||t.type===Ol.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.j.keys()))i.has(n)||e.cancelSurvey(n);var s=e.te(r),o=new Set;s.forEach((t=>{if(t.type===Ol.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===El.Tab)return void e.Y(t);(null==(i=t.appearance)?void 0:i.widgetType)===El.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.X(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ar(e.re)&&t.type===Ol.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var r=t.survey;o.has(r.id)||e.K(r)}))}),t)},this.Z=t=>{Ar(this.re)||Ql.error("Survey "+this.re+" already in focus. Cannot add survey "+t.id+"."),this.re=t.id},this.$=t=>{this.re!==t.id&&Ql.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.W(t.id),this.re=null,this.J(t)},this._posthog=t,this.re=null}W(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Ql.info("Cancelled pending survey "+t),this.W(t),this.re===t&&(this.re=null))}te(t){return t.sort(((t,e)=>{var r,i,n=hd(t),s=hd(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===$l,a=e.schedule===$l;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(t){return oc(t,this._posthog)}ee(t,e,r){if(this.B.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Pr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(ac.location.search),n=i.params;if(0===Object.keys(n).length)return!1;Ql.info("[Survey Prefill] Detected URL prefill parameters");var s=this.ne(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&Qh({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:e}),this.B.add(t.id),l}V(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Ir(o)?o.map(String):[String(o)]}Ql.info("[Survey] Processing initial responses");var a=this.ne(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Qh({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=ql(t.id);try{switch(t.type){case Fl.SingleChoice:if(!t.choices||0===t.choices.length)return void ms.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void ms.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Fl.MultipleChoice:if(!t.choices||0===t.choices.length)return void ms.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void ms.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&ms.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Fl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void ms.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:ms.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ms.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ql.warn("[Survey Prefill] No valid responses after conversion"),null;var n=xh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>i&&o>a&&(a++,e.includes(i));){var l=t.questions[i];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ql(l.id);Pr(r[u])||(n[u]=r[u])}s.push(i);var h=Ud(t,i,l.id?r[ql(l.id)]:null);if(h===Al.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:s}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return ld(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:r}),Ql.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return Ql.error("[Survey Prefill] Error handling prefill:",t),null}}ie(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ae(t){return!t.conditions||od(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!cs)return!1;var s=tn(cs,{userAgentDataPlatform:null==ss||null==(r=ss.userAgentData)?void 0:r.platform,maxTouchPoints:null==ss?void 0:ss.maxTouchPoints,screenWidth:null==is||null==(i=is.screen)?void 0:i.width,screenHeight:null==is||null==(n=is.screen)?void 0:n.height,devicePixelRatio:null==is?void 0:is.devicePixelRatio});return Mh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Bh||!Bh.querySelector(t.conditions.selector))}(t)}oe(t){var e;return rd(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ie(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Jl(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!iu.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;if(!this.ie(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ie(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ah.q("lastSeenSurveyDate"))?(t=>!!Ah.q(eu(t))&&!rd(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=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.se(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}se(t){var e;if(!Zl(t)&&!Kl(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}ue(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ie(e)}))}G(t){return this.checkSurveyEligibility(t).eligible&&this.ae(t)&&this.se(t)&&this.ue(t)}J(t){try{var e=lc.querySelector(cd(t,!0));null!=e&&e.shadowRoot&&Ka(null,e.shadowRoot),null==e||e.remove()}catch(e){Ql.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.j,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function vc(t,e){if(lc&&ac){var r,i=new cc(t);if(t.config.disable_surveys_automatic_display)return Ql.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ql.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Pr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Ts(lc,"visibilitychange",(()=>{lc.hidden?Pr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function fc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;vl((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Ol.Widget,s=od(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===El.Tab&&r;if(!s)return Ql.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(Ql.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ts(ac,"popstate",r),Ts(ac,"hashchange",r);var s=ac.history.pushState,l=ac.history.replaceState;return ac.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},ac.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{ac.removeEventListener("popstate",r),ac.removeEventListener("hashchange",r),ac.history.pushState=s,ac.history.replaceState=l}}}),[o,e,i,n,a])}function pc(t){switch(void 0===t&&(t=Pl.Right),t){case Pl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Pl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Pl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function gc(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,M=t.properties,I=t.isSurveyCompleted,T=t.skipShownEvent,E=t.surveyLanguage,R=fl(null),P=Number.isInteger(v),O=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,F=function(t,e,i,n,s,o,a,l,u){var h=cl(n||0===i||t.type===Ol.ExternalSurvey),d=h[0],c=h[1],v=cl(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};lc.startViewTransition?lc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return vl((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(od(t,e)){c(!0),ac.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Ll.SHOWN,r({[Dl.SURVEY_NAME]:t.name,[Dl.SURVEY_ID]:t.id,[Dl.SURVEY_ITERATION]:t.current_iteration,[Dl.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[Dl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Ts(ac,"PHSurveyClosed",m),Ts(ac,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),ac.removeEventListener("PHSurveyClosed",m),ac.removeEventListener("PHSurveySent",s)}}return o(),()=>{ac.removeEventListener("PHSurveyClosed",m),ac.removeEventListener("PHSurveySent",s)}}}else Ql.error("usePopupVisibility hook called without a PostHog instance.")}),[]),fc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,T,E),A=F.isPopupVisible,L=F.hidePopupWithViewTransition,D=F.isSurveySent||v===l.questions.length||!0===I,N=pl((()=>{var t=ud(l),e=(null==t?void 0:t.surveySubmissionId)||xh();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){E?Kh(l,h,P,E):Kh(l,h,P),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:M,surveyLanguage:E}}),[P,v,m,h,l,k,b,w,M,E]);return A?pd(id.Provider,{value:N,children:pd("div",{className:"ph-survey",style:r({},vd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:D?pd(Rd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||zh,onClose(){L(),C()}}):pd(mc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function mc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=cl((()=>{var t=ud(n);return null!=t&&t.responses&&Ql.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),l=a[0],u=a[1],h=gl(id),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,b=h.surveyLanguage,_=cl((()=>{var t=ud(n);return d||(null==t?void 0:t.lastQuestionIndex)||0})),w=_[0],x=_[1],k=cl((()=>{var t,e=ud(n);return null!==(t=null==e?void 0:e.visitedIndices)&&void 0!==t?t:[]})),S=k[0],C=k[1],M=pl((()=>ed(n)),[n]);vl((()=>{m&&!Pr(d)&&x(d)}),[d,m]);var I=!(null==(e=n.appearance)||!e.allowGoBack)&&(m?(null!=d?d:0)>0:S.length>0),T=M.at(w);return T?pd("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&pd(Td,{onClick(){c()}}),pd("div",{className:"survey-box","data-question-index":w,children:bc({question:T,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||zh,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=ql(s),h=r({},l,{[a]:e});u(h);var d=Ud(n,i,e),c=d===Al.End,v=[...S,i];if(c||(C(v),x(d),ld(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:b})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=M[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ql(t)))),p=Object.fromEntries(Object.entries(h).filter((t=>f.has(t[0]))));Qh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:b})}}else Ql.error("onNextButtonClick called without a questionId.");else Ql.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:w,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?l[ql(T.id)]:void 0,canGoBack:I,onBack(){if(m)p();else if(0!==S.length){var t=S[S.length-1],e=S.slice(0,-1);C(e),x(t),ld(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:b})}}})})]}):null}function yc(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=cl(!0),f=v[0],p=v[1],g=cl(!1),m=g[0],y=g[1],b=cl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(vl((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(Ql.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Ts(ac,uc,e),()=>{ac.removeEventListener(uc,e)}}}else Ql.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),fc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==$l&&p(!1),setTimeout((()=>{y(!1)}),200)};return pd(Pa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&pd("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Pl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:pc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&pd(gc,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var bc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Fl.Open:return Ea(Od,r({},s,{question:e,key:e.id}));case Fl.Link:return Ea(Fd,r({},s,{question:e,key:e.id}));case Fl.Rating:return Ea(Ad,r({},s,{question:e,key:e.id}));case Fl.SingleChoice:case Fl.MultipleChoice:return Ea(Ld,r({},s,{question:e,key:e.id}));default:return Ql.error("Unsupported question type: "+e.type),null}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.generateSurveys=vc,aa.extendPostHogWithSurveys=vc;var _c=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),wc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return _c(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return _c(e,JSON.stringify(t.slice(0,n)),r)},xc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,kc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Sc=(t,e,r)=>{if(!r.truncated)if(Er(t)){if(r.seen.has(t))return void kc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Sc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else kc(e,t,r)},Cc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!xc(t))return!n||_c(e,"null",r);if(Ar(t)||(t=>{try{return Lr(t)||Nr(t)}catch(t){return!1}})(t))return _c(e,JSON.stringify(t),r);if("string"==typeof t)return wc(t,e,r);if(!Er(t)&&!Ir(t))return _c(e,JSON.stringify(t),r);if(i.has(t))return wc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Tr(o))return Cc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return wc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return _c(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Cc(l,e,r,i,n,s)}if(Ir(t)){if(!_c(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!_c(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Cc(d,e,r,i,!0))return!1}return _c(e,"]",r)}if(!_c(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{Sc(f,v,s)}catch(t){}if(xc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!_c(e,p,r))return!1;var b=e.length,_=Cc(f,e,r,i,!1),w=r.truncated;if(e.length!==b){if(c=!1,!_)return!1}else if(e.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(t){}return _c(e,"}",r)},Mc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.logs={initializeLogs(t){var e={host:aa.location.host},i=!1,n=function(n){var s=aa.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Er(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||_c(r," ",i))&&Cc(t[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.le({level:Mc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(aa.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),aa.console[n]=o};for(var s of Object.keys(Mc))n(s)}};var Ic=ys("[Error tracking]");function Tc(){return new Mn([new qn,new Qn,new Hn,new jn,new Zn,new Wn,new Un,new Gn],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Dn.test(l)?l.replace(Dn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=Nn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Nn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||In});var i}))}(s)}}("web:javascript",Fn,Ln))}var Ec=ys("[ExceptionAutocapture]"),Rc=Tc(),Pc={wrapOnError(t){var e=is;e||Ec.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){var e,i=Rc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return t(i),!!Tr(r)&&null!==(e=r(...arguments))&&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=is;e||Ec.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Rc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Tr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||Ec.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Rc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Tr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.errorWrappingFunctions=Pc,aa.posthogErrorWrappingFunctions=Pc;var Oc="X-POSTHOG-SESSION-ID",Fc="X-POSTHOG-WINDOW-ID",Ac="X-POSTHOG-DISTINCT-ID",$c=[Oc,Fc,Ac],Lc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Dc=(t,e)=>({}.hasOwnProperty.call(t,e)),Nc=t=>"object"==typeof t&&!Ar(t)||Tr(t),qc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),jc=t=>{try{var e;return qc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==is||null==(e=is.location)?void 0:e.href).toString()}catch(t){return}},Hc=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(Ir(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Oc,a.sessionId),n.set(Fc,l),o=!0}var u=(t=>Tr(t)?t():t)(e);return u&&u!==th&&(n.set(Ac,u),o=!0),o};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{};var Bc={_patchFetch:(t,e,i)=>qs(is,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=jc(s);if(u)if(qc(s)){var h=new Request(s,o);Hc(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Nc(o)?o.headers:void 0);if(Hc(t,e,i,u,d)){var c=((t,e)=>{if(Pr(t)||Ar(t))return{headers:e};if(Nc(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Dc(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Dc(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Lc.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Lc.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,r)=>qs(is.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=jc(s);d&&Hc(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return $c.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};aa.__PosthogExtensions__.tracingHeadersPatchFns=Bc,aa.postHogTracingHeadersPatchFns=Bc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Uc=-1,zc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Uc=e.timeStamp,t(e))}),!0)},Vc=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Wc=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Zc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Gc=()=>{var t,e;return null!==(t=null==(e=Zc())?void 0:e.activationStart)&&void 0!==t?t:0},Qc=function(t,e){void 0===e&&(e=-1);var r=Zc(),i="navigate";return 0>Uc?r&&(document.prerendering||Gc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Jc=new WeakMap;function Kc(t,e){var r=Jc.get(e);return r||(r=new WeakMap,Jc.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Yc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Xc,tv=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},ev=t=>{var e=!1;return()=>{e||(t(),e=!0)}},rv=-1,iv=new Set,nv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,sv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of iv)e();isFinite(rv)||(rv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",sv,!0))}},ov=()=>{if(0>rv){var t,e=Gc(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;rv=null!=r?r:nv(),addEventListener("visibilitychange",sv,!0),addEventListener("prerenderingchange",sv,!0),zc((()=>{setTimeout((()=>{rv=nv()}))}))}return{get firstHiddenTime(){return rv},onHidden(t){iv.add(t)}}},av=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},lv=[1800,3e3],uv=function(t,e){void 0===e&&(e={}),av((()=>{var r,i=ov(),n=Qc("FCP"),s=tv("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Gc(),0),n.entries.push(e),r(!0)))}));s&&(r=Vc(t,n,lv,e.reportAllChanges),zc((i=>{n=Qc("FCP"),r=Vc(t,n,lv,e.reportAllChanges),Wc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},hv=[.1,.25],dv=0,cv=1/0,vv=0,fv=t=>{for(var e of t)e.interactionId&&(cv=Math.min(cv,e.interactionId),vv=Math.max(vv,e.interactionId),dv=vv?(vv-cv)/7+1:0)},pv=()=>{var t;return Xc?dv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},gv=0;class mv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){gv=pv(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((pv()-gv)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var yv=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=ev(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},bv=[200,500];class _v{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var wv=[2500,4e3],xv={onLCP(t,e){void 0===e&&(e={}),av((()=>{var r,i=ov(),n=Qc("LCP"),s=Kc(e,_v),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Gc(),0),n.entries=[o],r())},a=tv("largest-contentful-paint",o);if(a){r=Vc(t,n,wv,e.reportAllChanges);var l=ev((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(yv(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});zc((i=>{n=Qc("LCP"),r=Vc(t,n,wv,e.reportAllChanges),Wc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=ov();uv(ev((()=>{var i,n=Qc("CLS",0),s=Kc(e,Yc),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=tv("layout-shift",o);a&&(i=Vc(t,n,hv,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),zc((()=>{s.i=0,n=Qc("CLS",0),i=Vc(t,n,hv,e.reportAllChanges),Wc(i)})),setTimeout(i))})))},onFCP:uv,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=ov();av((()=>{var i;"interactionCount"in performance||Xc||(Xc=tv("event",fv,{durationThreshold:0}));var n,s=Qc("INP"),o=Kc(e,mv),a=t=>{yv((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=tv("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Vc(t,s,bv,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),zc((()=>{o.v(),s=Qc("INP"),n=Vc(t,s,bv,e.reportAllChanges)})))}))}}};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.postHogWebVitalsCallbacks=xv,aa.postHogWebVitalsCallbacks=xv,aa.__PosthogExtensions__.loadWebVitalsCallbacks=()=>xv;class kv{constructor(t){this.disabled=!1===t;var e=Er(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var Sv="$copy_autocapture",Cv=ys("[AutoCapture]");function Mv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Iv(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Gs(e));return e}function Tv(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!Gs(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!Qs(v,"body")&&Ys>d.length;)if(Ks(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Gs(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(_s(d,(t=>{var e=bo(t);if(Qs(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&To(r))&&(h?nn(r):r)}_r(eo(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};so.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Mv(1024,Eo(t)):Mv(1024,io(t)));var a=eo(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),_s(t.attributes,(function(r){var s;if((!_o(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&To(r.value)&&(!Or(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Xs(a).join(" ")),o["attr__"+r.name]=Mv(1024,"href"===r.name&&n?nn(a):a)}}));for(var l=1,u=1,h=t;h=Iv(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!bo(t))return{};var e={};return _s(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&&To(i)&&(e[r]=i)}})),e}(t);ws(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=Qs(t,"a")||Qs(t,"button")?Eo(t):io(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ps(b))?void 0:w.host,S=null==is||null==(x=is.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:ws({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return xs(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Po(t[0].toString())]=Po(e.toString())})),(n+=":")+xs(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).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:Oo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return xs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var Ev={};function Rv(t,e){var r=Ev[t];if(r)return r;var i=e[t];if((t=>Tr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==is||!is.Zone))return Ev[t]=i.bind(e);var n=e.document;if(n&&Tr(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,l,u=s.contentWindow;u&&u[t]&&(i=u[t],"MutationObserver"===t&&function(t){return _r(t,"AppleWebKit")&&!_r(t,"Chrome")}(null!==(a=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){ms.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!o&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return i&&Tr(i)?Ev[t]=i.bind(e):i}function Pv(t,e){var i=no(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Ov(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Fv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Av="canvas,video,audio,embed,object";function $v(t,e){return Lr(t)&&t>=e}class Lv{ce(t){var e,r,i,n,s,o,a,l,u=this.de((null==t?void 0:t.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.ve=[],this.fe=0,this.de=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.pe=t=>{var e=Pv(t,{type:"click"});Ar(e)||this.me(e)||this.ve.push(e),this.ye()},this.ge=()=>{var t=Date.now();this.be=t,t%50==0&&this.ve.forEach((e=>{Pr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.we=()=>{this.ke=Date.now()},this.xe=()=>{"visible"===(null==os?void 0:os.visibilityState)&&(this.Se=Date.now())},this.Ce=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this._e=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Me=()=>{this._e=void 0},this.Ie=t=>{var e,r=this._e;if(this._e=void 0,!Pr(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Te.swipe_threshold_px;if(a>=l*l&&![this.be,this.Re,this.ke].some((t=>Lr(t)&&t>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==os||null==os.elementsFromPoint?void 0:os.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(Av))))return;var h=Pv(i,{type:"swipe",swipeDirection:Ov(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ar(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=t,this.Te=this.ce(e),this._onCapture=this.Te.__onCapture}start(t){this.Le(),this.Oe(),this.Ne(),this.Ae(),this.qe(t),this.Te.capture_dead_swipes&&this.De()}qe(t){if(!this.Pe){var e=function(t){return Rv("MutationObserver",t)}(aa);this.Pe=new e((t=>{this.Fe(t)})),this.Pe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Pe)||t.disconnect(),this.Pe=void 0,aa.removeEventListener("click",this.pe),aa.removeEventListener("scroll",this.ge,{capture:!0}),aa.removeEventListener("selectionchange",this.we),aa.removeEventListener("touchstart",this.Ce,{capture:!0}),aa.removeEventListener("touchend",this.Ie,{capture:!0}),aa.removeEventListener("touchcancel",this.Me,{capture:!0}),null==os||os.removeEventListener("visibilitychange",this.xe),this._e=void 0}Fe(t){this.Re=Date.now()}Le(){Ts(aa,"click",this.pe)}ye(){this.ve.length&&Pr(this.je)&&(this.je=aa.setTimeout((()=>{this.He()}),1e3))}Oe(){Ts(aa,"scroll",this.ge,{capture:!0})}Ne(){Ts(aa,"selectionchange",this.we)}Ae(){Ts(os,"visibilitychange",this.xe)}De(){Ts(aa,"touchstart",this.Ce,{capture:!0,passive:!0}),Ts(aa,"touchend",this.Ie,{capture:!0,passive:!0}),Ts(aa,"touchcancel",this.Me,{capture:!0,passive:!0})}Ee(){var t=Pr(this.Be)||Lr(this.Re)&&this.Re>this.Be;return(Pr(this.Ue)||t)&&(this.Be=Date.now(),this.Ue=!(null==os||!os.querySelector(Av))),!!this.Ue}me(t){return!t||("swipe"===t.type?this.We(t):this.Ve(t))}We(t){if(Zs(t.node))return!0;var e=this.ve.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!Qs(t.node,"html")&&Gs(t.node)&&function(t,e){var r;if(!is||mo(t))return!1;var i=Nr(e)?vo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:vo;return!oo(yo(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(t){return!(this.Te.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.We(t)||(r=t.node,!(!is||mo(r))&&yo(r,!1).targetElementList.some((t=>Qs(t,"a"))));var e,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var t=this.ve;for(var e of(this.ve=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=e.timestamp?this.Re-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.ke&&this.ke>=e.timestamp?this.ke-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Se?Math.abs(e.timestamp-this.Se):void 0;var i=$v(e.scrollDelayMs,this.Te.scroll_threshold_ms),n=$v(e.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=$v(e.mutationDelayMs,this.Te.mutation_threshold_ms),o=$v(e.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=Lr(e.scrollDelayMs)&&this.Te.scroll_threshold_ms>e.scrollDelayMs,l=Lr(e.mutationDelayMs)&&this.Te.mutation_threshold_ms>e.mutationDelayMs,u=Lr(e.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Lr(e.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=$v(e.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=Fv(e);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:e.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Te.mutation_threshold_ms>e.absoluteDelayMs&&this.ve.push(e)}}this.ye()}}he(t,e){var i=Fv(t);this.instance.capture(i,r({},e,Tv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lv(t,e);var Dv=ys("[ExternalScriptsLoader]"),Nv=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Dv.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==os?void 0:os.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!os)return r("document not found");var i=os.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)os.head.appendChild(i);else{var n,s=os.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):os.body.appendChild(i)}};null!=os&&os.body?a():null==os||os.addEventListener("DOMContentLoaded",a)};aa.__PosthogExtensions__=aa.__PosthogExtensions__||{},aa.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}Nv(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Nv(t,o,r)}},aa.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Nv(t,i,r)};ps.DEBUG=!1,ps.LIB_VERSION="1.410.3",ps.LIB_NAME="web";class qv{constructor(t){this._instance=t}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===ah||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===oh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(t){this.Je.A(this.Ke,t?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.D(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get Qe(){var t=this.Je.q(this.Ke);return Wr(t)?1:_r(Zr,t)?0:-1}get Je(){var t=this.Te.opt_out_capturing_persistence_type,e="localStorage"===t?Ah:Oh;if(!this.Ye||this.Ye!==e){this.Ye=e;var r="localStorage"===t?Oh:Ah;r.q(this.Ke)&&(this.Ye.q(this.Ke)||this.optInOut(Wr(r.q(this.Ke))),r.D(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[null==ss?void 0:ss.doNotTrack,null==ss?void 0:ss.msDoNotTrack,aa.doNotTrack].some((t=>Wr(t)))}}var jv=ys("[Dead Clicks]"),Hv=()=>!0,Bv=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(gu)),i=t.instance.config.capture_dead_clicks;return Nr(i)?i:!!Er(i)||r};class Uv{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[gu]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr((()=>{this.er()})):this.stop()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?jv.error("failed to load script",e):t()}))}er(){var t;if(os){if(!this.Xe&&null!=(t=aa.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Er(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Xe=aa.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xe.start(os),jv.info("starting...")}}else jv.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,jv.info("stopping..."))}}var zv=ys("[SegmentIntegration]");var Vv="posthog-js";function Wv(t,e){var i=void 0===e?{}:e,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Zv{constructor(t,e,r,i,n,s){this.name=Vv,this.setupOnce=function(o){o(Wv(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Gv{constructor(t){this.rr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ms.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.nr()}nr(){var t;this.sr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.rr)}destroy(){var t;null==(t=this.sr)||t.call(this),this.sr=void 0}doPageView(t,e){var r,i=this.ar(t,e);return this.ir={pathname:null!==(r=null==is?void 0:is.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ar(t,null==(e=this.ir)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ir)?void 0:t.pageViewId}}ar(t,e){var r=this.ir;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 s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Pr(s)||Pr(o)||Pr(a)||Pr(l)||Pr(u)||Pr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Gr(o/s,0,1,ms):1,c=s>1?Gr(a/s,0,1,ms):1,v=l>1?Gr(u/l,0,1,ms):1,f=l>1?Gr(h/l,0,1,ms):1;i=ws(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Qv=["flags","surveys"],Jv={[su]:{exposure:"hidden"},[lu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[uu]:{exposure:"hidden"},[hu]:{exposure:"event"},[du]:{exposure:"hidden"},[cu]:{exposure:"event"},[vu]:{exposure:"hidden"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[gu]:{exposure:"event"},[mu]:{exposure:"hidden"},[yu]:{exposure:"event"},[bu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Cu]:{exposure:"hidden"},[Mu]:{exposure:"event"},[_u]:{exposure:"event",shouldSkipFromEventProperties:t=>Ar(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Iu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Er(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Tu]:{exposure:"event",storageGroup:"flags"},[Eu]:{exposure:"hidden"},[Ru]:{exposure:"hidden",storageGroup:"flags"},[Pu]:{exposure:"event",storageGroup:"flags"},[Ou]:{exposure:"event",storageGroup:"flags",volatile:!0},[Fu]:{exposure:"hidden",storageGroup:"flags"},[Au]:{exposure:"event"},[$u]:{exposure:"hidden"},[Lu]:{exposure:"hidden"},[Du]:{exposure:"hidden"},[Nu]:{exposure:"hidden",storageGroup:"surveys"},[qu]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ju]:{exposure:"event"},[Hu]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Uu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Vu]:{exposure:"hidden"},[Wu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Zu]:{exposure:"hidden"},[Gu]:{exposure:"hidden"},[Qu]:{exposure:"hidden"},[Ju]:{exposure:"hidden"},[Ku]:{exposure:"hidden"},[Yu]:{exposure:"hidden"},[Xu]:{exposure:"hidden"},[wu]:{exposure:"event"},[xu]:{exposure:"event"},[ku]:{exposure:"event"},[Su]:{exposure:"event"},[rh]:{exposure:"event"},[ih]:{exposure:"event"},[nh]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Kv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Yv=t=>{var e=Jv[t];if(e)return e;for(var r of Kv){var i=r[1];if(0===t.indexOf(r[0]))return i}},Xv={flags:Wu,surveys:qu},tf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ef="main";class rf{constructor(t,e,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=t,this.dr=i,this.props={},this.cr=void 0,this.vr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Je=this.pr(t),this.hr=this.gr(t),this.load(),t.debug&&ms.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),is){var n=()=>this.flush();Ts(is,"beforeunload",n,{capture:!1}),Ts(is,"pagehide",n,{capture:!1})}}mr(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Lr(e)&&e>0?e:0}isDisabled(){return!!this.yr}pr(t){-1===tf.indexOf(t.persistence.toLowerCase())&&(ms.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...$h,...t];return r({},Ah,{F(t){try{var r={};try{r=Oh.F(t)||{}}catch(t){}var i,n=JSON.parse(Ah.q(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Ar(a)||""===a||(s[o]=a)}i=ws(n,s)}else i=ws(r,n);return Ah.A(t,i),i}catch(t){}return null},A(t,e,r,n,s,o){var a=Ah.A(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Oh.A(t,l,r,n,s,o)}catch(t){Ah.P(t)}return a},D(t,e){try{null==is||is.localStorage.removeItem(t),Oh.D(t,e)}catch(t){Ah.P(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Ah.N()?(e=Ah,n=!0):"localstorage+cookie"===s&&i.N()?(e=i,n=!0):"sessionstorage"===s&&qh.N()?e=qh:"memory"===s?e=Dh:"cookie"===s?e=Oh:i.N()?(e=i,n=!0):e=Oh,this.ur=n,e}br(t){return this.vr+"__"+t}gr(t){return this.ur&&!!t.split_storage}_r(t){var e=null!=t?t:this.Te.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Wu];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return _s(this.props,((e,r)=>{var i=Yv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===Iu?()=>this._r():()=>!1))return;i.transformToEventProperties&&ws(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.yr){var t=this.Je.F(this.vr);t&&(this.props=ws({},t)),this.hr&&this.wr()}}wr(){for(var t of Qv){var e=Ah.F(this.br(t));if(e&&!Rr(e)){var r=this.kr(t);r.persisted=!0,this.Sr(t)||(r.fingerprint=this.Cr(e,t)),this.Mr(t,e)||ws(this.props,e)}}}Sr(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Yv(e))?void 0:r.storageGroup)===t}))}Mr(t,e){var r=Xv[t];if(!r)return!1;var i=e[r],n=this.props[r];return Lr(i)&&Lr(n)&&n>i}refreshKey(t){var e;if(!this.yr){var r=this.hr?null==(e=Yv(t))?void 0:e.storageGroup:void 0,i=r?Ah.F(this.br(r)):this.Je.F(this.vr);if(i&&t in i)this.Ir(t,i[t]);else{if(r){var n=this.Je.F(this.vr);if(n&&t in n)return void this.Ir(t,n[t])}this.Tr(t)}}}save(){if(!this.yr){var t=this.mr();t>0?Pr(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),t)):this.Rr()}}flush(){Pr(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,ef))}Pr(){var t=this.Fr(),e=t.main,r=t.groups;for(var i of(this.Or(this.Je,this.vr,e,ef),Qv)){var n,s=r[i];(!Rr(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ah,this.br(i),s,i)}}Fr(){var t={},e={flags:{},surveys:{}};return _s(this.props,((r,i)=>{var n,s=null==(n=Yv(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Cr(t,e){if(e===ef)return JSON.stringify(t)+"|"+this.Ar+"|"+this.$r+"|"+this.Lr;var r={};return _s(t,((t,e)=>{var i;r[e]=null!=(i=Yv(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Or(t,e,r,i){var n=this.kr(i);if(i===ef||n.dirty||Pr(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,r,this.Ar,this.$r,this.Lr,this.Te.debug)?(n.dirty=!1,i!==ef&&(n.persisted=!0),Pr(s)||(n.fingerprint=s)):this.Te.debug&&ms.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Pr(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.D(this.vr,!1),this.Je.D(this.vr,!0),!r&&this.dr)for(var i of Qv)Ah.D(this.br(i));r?delete this.lr[ef]:this.lr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Er(t)){Pr(e)&&(e="None"),this.Ar=Pr(r)?this.Dr:r;var i=!1;if(_s(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ir(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Er(t)){this.Ar=Pr(e)?this.Dr:e;var r=!1;if(_s(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ir(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Tr(t),this.save())}update_campaign_params(){var t=null==os?void 0:os.URL;if(t!==this.cr){var e=Qd(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Rr(Cs(e))||this.register(e),this.cr=t}}update_search_keyword(){var t;this.register((t=null==os?void 0:os.referrer)?Kd(t):{})}update_referrer_info(){var t;this.register_once({$referrer:tc(),$referring_domain:null!=os&&os.referrer&&(null==(t=Ps(os.referrer))?void 0:t.host)||Xd},void 0)}set_initial_person_info(){this.props[Ju]||this.props[Ku]||this.register_once({[Yu]:ec(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};_s([Ku,Ju],(e=>{var r=this.props[e];r&&_s(r,(function(e,r){t["$initial_"+xr(r)]=e}))}));var e=this.props[Yu];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=rc(t,e),i={};return _s(r,(function(t,e){i["$initial_"+xr(e)]=t})),i}(e,this.Te.disable_capture_url_hashes);ws(t,r)}return t}safe_merge(t){return _s(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Dr=this.Ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=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||[]),n=i?this.pr(t):this.Je,s=this.gr(t);if(i||s!==this.hr){var o=this.props;this.clear(),this.Je=n,this.hr=s,this.props=o,this.save()}}set_disabled(t){this.yr=t,this.yr?this.remove():this.save()}set_cross_subdomain(t){t!==this.$r&&(this.$r=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Lr&&(this.Lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[uu]||{};r[t]=e,this.Ir(uu,r),this.save()}remove_event_timer(t){var e=this.props[uu]||{},r=e[t];return Pr(r)||(delete e[t],this.Ir(uu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ir(t,e),this.save()}Ir(t,e){var r;this.props[t]=e,null!=(r=Yv(t))&&r.volatile||this.Nr(t)}Tr(t){delete this.props[t],this.Nr(t)}Nr(t){var e,r=null==(e=Yv(t))?void 0:e.storageGroup;r&&(this.kr(r).dirty=!0)}kr(t){return this.lr[t]||(this.lr[t]={})}}var nf=ys("[RateLimiter]");class sf{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=>{nf.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void nf.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.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 n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Qu))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Qu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var of=ys("[RemoteConfig]");class af{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=aa._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}qr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}jr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return of.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void of.warn("Remote config is disabled. Falling back to local config.");this.qr((t=>{if(!t)return of.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((t=>{this.Hr(t),this.Br()}));this.Hr(t),this.Br()}))}catch(t){of.error("Error loading remote config",t),this.Hr()}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&os&&"hidden"!==os.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var t;if(!this.zr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.zr=setInterval((()=>{this.refresh()}),e))}}Hr(t){t||of.error("Failed to fetch remote config from PostHog.");try{this._instance.Hr(t?{ok:!0,config:t}:{ok:!1})}catch(t){of.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var e;null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded()}catch(t){of.error("Error loading feature flags",t)}}}var lf=Uint8Array,uf=Uint16Array,hf=Uint32Array,df=new lf([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]),cf=new lf([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]),vf=new lf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ff=function(t,e){for(var r=new uf(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new hf(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},pf=ff(df,2),gf=pf[1];pf[0][28]=258,gf[258]=28;for(var mf=ff(cf,0)[1],yf=new uf(32768),bf=0;32768>bf;++bf){var _f=(43690&bf)>>>1|(21845&bf)<<1;yf[bf]=((65280&(_f=(61680&(_f=(52428&_f)>>>2|(13107&_f)<<2))>>>4|(3855&_f)<<4))>>>8|(255&_f)<<8)>>>1}var wf=function(t,e,r){for(var i=t.length,n=0,s=new uf(e);i>n;++n)++s[t[n]-1];var o,a=new uf(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new uf(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[yf[d]>>>l]=u}else for(o=new uf(i),n=0;i>n;++n)o[n]=yf[a[t[n]-1]++]>>>15-t[n];return o},xf=new lf(288);for(bf=0;144>bf;++bf)xf[bf]=8;for(bf=144;256>bf;++bf)xf[bf]=9;for(bf=256;280>bf;++bf)xf[bf]=7;for(bf=280;288>bf;++bf)xf[bf]=8;var kf=new lf(32);for(bf=0;32>bf;++bf)kf[bf]=5;var Sf=wf(xf,9,0),Cf=wf(kf,5,0),Mf=function(t){return(t/8>>0)+(7&t&&1)},If=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof uf?uf:t instanceof hf?hf:lf)(r-e);return i.set(t.subarray(e,r)),i},Tf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ef=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Rf=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new lf(0),0];if(1==n){var o=new lf(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new uf(c+1),f=Pf(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new lf(v),f]},Pf=function(t,e,r){return-1==t.s?Math.max(Pf(t.l,e,r+1),Pf(t.r,e,r+1)):e[t.s]=r},Of=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new uf(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},Ff=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Af=function(t,e,r){var i=r.length,n=Mf(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},$f=function(t,e,r,i,n,s,o,a,l,u,h){Tf(e,h++,r),++n[256];for(var d=Rf(n,15),c=d[0],v=d[1],f=Rf(s,15),p=f[0],g=f[1],m=Of(c),y=m[0],b=m[1],_=Of(p),w=_[0],x=_[1],k=new uf(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=Rf(k,7),M=C[0],I=C[1],T=19;T>4&&!M[vf[T-1]];--T);var E,R,P,O,F=u+5<<3,A=Ff(n,xf)+Ff(s,kf)+o,L=Ff(n,c)+Ff(s,p)+o+14+3*T+Ff(k,M)+(2*k[16]+3*k[17]+7*k[18]);if(A>=F&&L>=F)return Af(e,h,t.subarray(l,l+u));if(Tf(e,h,1+(A>L)),h+=2,A>L){E=wf(c,v,0),R=c,P=wf(p,g,0),O=p;var D=wf(M,I,0);for(Tf(e,h,b-257),Tf(e,h+5,x-1),Tf(e,h+10,T-4),h+=14,S=0;T>S;++S)Tf(e,h+3*S,M[vf[S]]);h+=3*T;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)Tf(e,h,D[H=31&j[S]]),h+=M[H],H>15&&(Tf(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=Sf,R=xf,P=Cf,O=kf;for(S=0;a>S;++S)if(i[S]>255){var H;Ef(e,h,E[257+(H=i[S]>>>18&31)]),h+=R[H+257],H>7&&(Tf(e,h,i[S]>>>23&31),h+=df[H]);var B=31&i[S];Ef(e,h,P[B]),h+=O[B],B>3&&(Ef(e,h,i[S]>>>5&8191),h+=cf[B])}else Ef(e,h,E[i[S]]),h+=R[i[S]];return Ef(e,h,E[256]),h+R[256]},Lf=new hf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Df=function(){for(var t=new hf(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Nf=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function qf(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Df[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new lf(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Af(l,u,t.subarray(h,d)):(l[h]=!0,u=Af(l,u,t.subarray(h,o)))}else{for(var c=Lf[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new uf(32768),m=new uf(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new hf(25e3),x=new uf(288),k=new uf(32),S=0,C=0,M=(h=0,0),I=0,T=0;o>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=I){var O=o-h;if((S>7e3||M>24576)&&O>423){u=$f(t,l,0,w,x,k,C,M,T,h-T,u),M=S=C=0,T=h;for(var F=0;286>F;++F)x[F]=0;for(F=0;30>F;++F)k[F]=0}var A=2,L=0,D=f,N=R-P&32767;if(O>2&&E==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),H=Math.min(258,O);j>=N&&--D&&R!=P;){if(t[h+A]==t[h+A-N]){for(var B=0;H>B&&t[h+B]==t[h+B-N];++B);if(B>A){if(A=B,L=N,B>q)break;var U=Math.min(N,B-2),z=0;for(F=0;U>F;++F){var V=h-N+F+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,P=V)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[M++]=268435456|gf[A]<<18|mf[L];var Z=31&gf[A],G=31&mf[L];C+=df[Z]+cf[G],++x[257+Z],++k[G],I=h+A,++S}else w[M++]=t[h],++x[t[h]]}}u=$f(t,l,!0,w,x,k,C,M,T,h-T,u)}return If(a,0,i+Mf(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Nf(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),Nf(l,u-8,r.d()),Nf(l,u-4,i),l}var jf=!!us||!!ls,Hf="text/plain",Bf=!1,Uf=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},zf=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Os(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Vf=t=>{if(t.Vr)return t.Vr;var e=t.data,r=t.compression;if(e){if(r===Cl){var i=qf(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new lf(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new lf(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return If(i,0,n)}(Rs(e)),{mtime:0});return{contentType:Hf,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Ml){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Rs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Rs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Rs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Wf=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:zf(t.url,{compression:Ml}),encodedBody:Vf(r({},t,{compression:Ml,Vr:void 0}))}:{url:Uf(t.url,"compression"),encodedBody:Vf(r({},t,{compression:void 0,Vr:void 0}))};try{e=Vf(t)}catch(e){if(vr(t.compression,Fs(t.url,"compression")))return ms.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&vr(t.compression,Fs(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?cr(new Uint8Array(i)):ArrayBuffer.isView(i)&&cr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Bf=!0,n()):{url:t.url,encodedBody:e}},Zf=t=>{try{return Wf(t)}catch(e){return ms.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Gf=function(){var t=e((function*(t){var e=Rs(t.data),i=yield function(t,e,r){return mr.apply(this,arguments)}(e,ps.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Vr:{contentType:Hf,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Qf=/Failed to fetch|NetworkError|Load failed/i,Jf=t=>{var e=Zf(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;_s(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(hs){var c=new hs;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Qf.test((null==t?void 0:t.message)||""))(e)?ms.warn(e):ms.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;ls(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.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){ms.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Kf=t=>{try{var e,i=Wf(t),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(ss.sendBeacon(n,u))return;var h=Ir(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ir(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>Ir(t.data)?e:r({},t.data,{batch:e});return Kf(r({},t,{data:c(h.slice(0,d))})),void Kf(r({},t,{data:c(h.slice(d))}))}ms.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Jf(r({},t,{Wr:!0}))}catch(t){ms.warn("Beacon send failed",t)}},Yf=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return zf(i===Cl?Uf(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===Cl?{}:{compression:i}))},Xf=[];ls&&Xf.push({transport:"fetch",method:Jf}),us&&Xf.push({transport:"XHR",method(t){var e=Zf(t);if(e){var r=new us,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;_s(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),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(o)}}}),null!=ss&&ss.sendBeacon&&Xf.push({transport:"sendBeacon",method:Kf});var tp=3e3;class ep{constructor(t,e){this.Zr=!0,this.Gr=[],this.Qr=Gr((null==e?void 0:e.flush_interval_ms)||tp,250,5e3,ms.createLogger("flush interval"),tp),this.Jr=t}enqueue(t){this.Gr.push(t),this.Kr||this.Yr()}unload(){this.Xr();var t=this.Gr.length>0?this.ti():{},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.ei(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var t=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var e=this.ti(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Ir(r.data)&&_s(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ei(r)};for(var i in e)r()}}),this.Qr))}ei(t){try{this.Jr(t)}catch(t){ms.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var t={};return _s(this.Gr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Pr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Gr=[],t}}var rp=["retriesPerformedSoFar"];class ip{constructor(t){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=t,this.Gr=[],this.ni=!0,!Pr(is)&&"onLine"in is.navigator&&(this.ni=is.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ts(is,"online",this.si),Ts(is,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,rp);Dr(e)&&(n.url=zf(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Ot(r({retriesPerformedSoFar:e},n));0===t.statusCode&&ms.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Ot(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ms.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var t=Date.now(),e=[],r=this.Gr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Gr=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Pr(is)||(this.si&&(is.removeEventListener("online",this.si),this.si=void 0),this.ai&&(is.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){ms.error(t)}}this.Gr=[]}}class np{constructor(t){this.hi=()=>{var t,e,r,i;this.di||(this.di={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.di.lastScrollY=Math.ceil(s),this.di.maxScrollY=Math.max(s,null!==(t=this.di.maxScrollY)&&void 0!==t?t:0),this.di.maxScrollHeight=Math.max(o,null!==(e=this.di.maxScrollHeight)&&void 0!==e?e:0),this.di.lastContentY=a,this.di.maxContentY=Math.max(a,null!==(r=this.di.maxContentY)&&void 0!==r?r:0),this.di.maxContentHeight=Math.max(l,null!==(i=this.di.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var t=this.di;return setTimeout(this.hi,0),t}startMeasuringScrollPosition(){Ts(is,"scroll",this.hi,{capture:!0}),Ts(is,"scrollend",this.hi,{capture:!0}),Ts(is,"resize",this.hi)}scrollElement(){if(!this.ci)return null==is?void 0:is.document.documentElement;var t=Ir(this.ci)?this.ci:[this.ci];for(var e of t){var r=null==is?void 0:is.document.querySelector(e);if(r)return r}}vi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[e]||0}return is?"y"===t?is.scrollY||is.pageYOffset||is.document.documentElement.scrollTop||0:is.scrollX||is.pageXOffset||is.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var sp=t=>ec(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class op{constructor(t,e,r,i){this.fi=t=>{var e=this.pi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.gi(this._instance)};this.mi.register({[Gu]:r})}},this._instance=t,this.yi=e,this.mi=r,this.gi=i||sp,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Gu]}getSetOnceProps(){var t,e=null==(t=this.pi())?void 0:t.props;return e?"r"in e?rc(e,this._instance.config.disable_capture_url_hashes):{$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 _s(Cs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+xr(r)]=e})),t}}class ap{on(t,e){return this.bi[t]||(this.bi[t]=[]),this.bi[t].push(e),()=>{this.bi[t]=this.bi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.bi[t]||[])r(e);for(var i of this.bi["*"]||[])i(t,e)}constructor(){this.bi={}}}var lp=ys("[SessionId]");class up{on(t,e){return this.wi.on(t,e)}constructor(t,e,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new ap,this.Mi=(t,e)=>!(!Dr(t)||!Dr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===ah)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=t.config,this.mi=t.persistence,this.Ii=void 0,this.Ti=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=e||xh,this.Ri=r||xh;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Gr(this.Te.session_idle_timeout_seconds||1800,60,36e3,lp.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Ai()){var s=qh.F(this.Oi),o=qh.F(this.Fi);s&&!o?this.Ii=s:qh.D(this.Oi),qh.A(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){lp.error("Invalid sessionID in bootstrap",t)}this.Li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Pr(this.ki)&&(this.ki=[]),this.ki.push(t),this.Ti&&t(this.Ti,this.Ii),()=>{this.ki=this.ki.filter((e=>e!==t))}}Ai(){return"memory"!==this.Te.persistence&&!this.mi.yr&&qh.N()}Di(t){t!==this.Ii&&(this.Ii=t,this.Ai()&&qh.A(this.Oi,t))}Ni(){return this.Ii?this.Ii:this.Ai()?qh.F(this.Oi):null}qi(t){var e=this.xi;return!Ar(e)&&!Ar(t)&&5e3>Math.abs(t-e)}$i(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Ti||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Ti=t,n&&!i||n&&this.qi(e)||(this.xi=e,this.mi.register({[Cu]:[e,t,r]}))}ji(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Dr(e)&&e>0}Hi(){this.ji()?this.mi.refreshKey(Cu):(this.mi.flush(),this.mi.load())}Bi(){var t;if(!Ar(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var e=this.Ui();e[1]===this.Ti&&e[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[Cu]:[this._sessionActivityTimestamp,null!==(t=this.Ti)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var t=this.Ui()[0],e=Dr(t)?t:0,r=Dr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Vi(t){return this.Hi(),this.Mi(t,this.zi())}Ui(){var t=this.mi.props[Cu];return Ir(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&is&&(is.removeEventListener(ch,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Li(){this.Si=()=>{this.Bi(),this.Ai()&&qh.D(this.Fi)},Ts(is,ch,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Te.cookieless_mode===ah)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),i=this.Ui(),n=i[1],s=i[2],o=this.zi(),a=this.Ni(),l=Dr(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!t&&this.Mi(r,o);if(v){(v=this.Vi(r))||lp.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],s=f[2]}d||v||l?(n=this.Ei(),a=this.Ri(),lp.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.Ri(),u=!0),(h=n!==c)&&(lp.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Dr(o)&&t&&!l?o:r,g=Dr(s)?s:(new Date).getTime();this.Di(a),this.$i(n,p,g),t||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((t=>t(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var t=this.Ti;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:t})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var hp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&br(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>br(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function dp(){return dp=e((function*(){var t=null==ss?void 0:ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Or(r)&&r.length>0?r:void 0}catch(t){return void ms.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),dp.apply(this,arguments)}var cp="custom",vp="i.posthog.com",fp=/^\/static\//;class pp{constructor(t){this.Zi={},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("."+vp,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":cp),this.Zi[this.apiHost]}Gi(t){if(fp.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}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("assets"===t){var r=this.Gi(e);if(r)return""+r+e}if(this.region===cp)return this.apiHost+e;var i=vp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var gp=ys("[PostHog ExternalIntegrations]"),mp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class yp{constructor(t){this._instance=t}tr(t,e){var r;null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return gp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=aa.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.tr(mp[s],(()=>{var e;null==(e=aa.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=aa.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=aa.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;e()}}}class bp{constructor(t,e){this.it=t,this.Qi=e,this.Ji=new Map,this.Ki=!1}add(t){var r=this;return e((function*(){if(r.Ki)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(r.Ji.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');r.Ji.set(t.name,t);try{var e=t.setup(r.Qi);e&&(yield e)}catch(e){var i=r.Ji.get(t.name)===t;i&&r.Ji.delete(t.name),r.it.error('Failed to set up browser extension "'+t.name+'"',e),i&&r.Yi(t)}}))()}dispose(){if(!this.Ki){this.Ki=!0;var t=Array.from(this.Ji.values()).reverse();for(var e of(this.Ji.clear(),t))this.Yi(e)}}Yi(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Tr(e.then)&&e.then(void 0,(e=>{this.it.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.it.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class _p{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var r;null==(r=this._instance.persistence)||r.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var wp="extensionsRemoteConfig";class xp{constructor(t){this.Ki=!1,this.instance=t,this.it=ms.createLogger("[BrowserExtensions]"),this.Xi=t.tn,this.kv=new _p(t),this.onEvent=t=>Sl(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.it.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.Ki)return Sl((()=>{}));var e=e=>{try{t(e)}catch(t){this.it.error("Browser extension remote config listener failed",t)}},r=this.instance.en.on(wp,e);return this.Xi&&e(this.Xi),Sl(r)},this.rn=new bp(this.it,this)}get logger(){return this.it}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(ou))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,r,i,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(r=null==n?void 0:n.windowId)&&void 0!==r?r:"",sessionStartTimestamp:null!==(i=null==n?void 0:n.sessionStartTimestamp)&&void 0!==i?i:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.rn.add(t)}capture(t,r,i){var n=this;return e((function*(){i?n.instance.capture(t,r,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):n.instance.capture(t,r)}))()}registerDynamicEventProperties(t){return Sl(this.instance.nn(t))}handleRemoteConfig(t){this.Ki||(this.Xi=t,this.instance.en.emit(wp,t))}sendRequest(t,r){var i=this;return e((function*(){var e;void 0===r&&(r={});var n=i.instance.requestRouter.endpointFor(null!==(e=r.target)&&void 0!==e?e:"api",t),s={method:r.method,url:r.query?zf(n,r.query):n,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport};return"sendBeacon"===r.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.Ki||(this.Ki=!0,this.rn.dispose())}}var kp={},Sp=0,Cp=()=>{},Mp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ip="Surveys module not available",Tp="sanitize_properties is deprecated. Use before_send instead",Ep="Invalid value for property_denylist config: ",Rp=["token","distinct_id",eh],Pp="posthog",Op=!jf&&-1===(null==cs?void 0:cs.indexOf("MSIE"))&&-1===(null==cs?void 0:cs.indexOf("Mozilla")),Fp=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Is(null==os?void 0:os.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Cp,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:as&&Or(null==as?void 0:as.search)&&-1!==as.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==is||null==(e=is.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){ms.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:hh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:tp},error_tracking:{},_onCapture:Cp},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:ho,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},Ap=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],$p=t=>{var e={};for(var r of Ap){var i=r[0],n=r[1];Pr(t[i])||(e[n]=t[i])}var s=ws({},e,t),o=t.__preview_external_dependency_versioned_paths;return Pr(o)||(Pr(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Or(o)&&Pr(t.asset_host)&&(s.asset_host=o)),Ir(t.property_blacklist)&&(Pr(t.property_denylist)?s.property_denylist=t.property_blacklist:Ir(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ms.error(Ep+t.property_denylist)),s};class Lp{constructor(){this.__forceAllowLocalhost=!1}get sn(){return this.__forceAllowLocalhost}set sn(t){ms.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Dp{an(t,e){if(t){var r=this.Ji.indexOf(t);-1!==r&&this.Ji.splice(r,1)}return this.Ji.push(e),null==e.initialize||e.initialize(),e}ln(){return this.config.cookieless_mode===ah||this.config.cookieless_mode===oh&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Lp,this.un=!1,this.version=ps.LIB_VERSION,this.en=new ap,this.Ji=[],this.hn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Fp(),this.SentryIntegration=Zv,this.sentryIntegration=t=>function(t,e){var r=Wv(t,e);return{name:Vv,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.dn=!1,this.cn=null,this.vn=null,this.fn=null,this.scrollManager=new np(this),this.pageViewManager=new Gv(this),this.rateLimiter=new sf(this),this.requestRouter=new pp(this),this.consent=new qv(this),this.externalIntegrations=new yp(this);var e=null!==(t=Dp.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Or(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Or(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>ms.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Pp){var i,n=null!==(i=kp[r])&&void 0!==i?i:new Dp;return n._init(t,e,r),kp[r]=n,kp[Pp][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o,a=Or(t)?t.trim():"";if(!a)return ms.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 a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Fp(e.defaults),e.debug=this.pn(e.debug),this.gn=e,this.mn=[],e.person_profiles?this.vn=e.person_profiles:e.process_person&&(this.vn=e.process_person);var l=Fp(e.defaults),u=$p(e),h=ws({},l,u,{name:i,token:a});Er(l.rageclick)&&Er(u.rageclick)&&(h.rageclick=ws({},l.rageclick,u.rageclick)),Er(l.session_recording)&&Er(u.session_recording)&&(h.session_recording=ws({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&ms.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Cl;var d=this.yn();this.persistence=new rf(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rf(r({},this.config,{persistence:"sessionStorage"}),d,!1);var c=r({},this.persistence.props),v=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.bn=new ep((t=>this._n(t)),this.config.request_queue_config),this.wn=new ip(this),this.__request_queue=[];var f=this.ln();if(f||(this.sessionManager=new up(this),this.sessionPropsManager=new op(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ms.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.xn(f)}),0)):(ms.info("Initializing extensions synchronously"),this.xn(f)),ps.DEBUG=ps.DEBUG||this.config.debug,ps.DEBUG&&ms.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:v}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Zu);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===lh)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===uh)ms.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var y=this.config.get_device_id(xh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(Zu,e.bootstrap.isIdentifiedID?uh:lh),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:th,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(xh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Zu,lh)}return Ts(is,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||xh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Zu,uh)),e()},n=r.user();"then"in n&&Tr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||zv.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()||(zv.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(zv.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,vh),identify:t=>e(t,ph),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.kn())):this.kn(),Tr(this.config._onCapture)&&this.config._onCapture!==Cp&&(ms.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ms.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.config.disableDeviceModel||function(){return dp.apply(this,arguments)}().then((t=>{t&&this.register({[au]:t})})).catch(Cp),this}xn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},Dp.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ji.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.Ji.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ji.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ji.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ji.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.Ji.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.Ji.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ji.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.Ji.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.Ji.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ji.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ji.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ji.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ji.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ji.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ji.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Bv)),d.toolbar&&this.Ji.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ji.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ji.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.Sn){var t=this.Sn;this.Sn=void 0,this.Ji.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Cn(c,h)}Cn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Cn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){ms.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[rh]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ih]:i}),this.config.__preview_deferred_init_extensions&&ms.info("PostHog extensions initialized ("+i+"ms)")}Hr(t){var e;if(!os||!os.body)return ms.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Sn=t),this.tn=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=_r(i.supportedCompression,Cl)?Cl:_r(i.supportedCompression,Ml)?Ml:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.vn?this.vn:hh}),null==(e=this.Mn)||e.handleRemoteConfig(t),this.Ji.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}kn(){try{this.config.loaded(this)}catch(t){ms.critical("`loaded` function failed",t)}if(this.In(),this.config.internal_or_test_user_hostname&&null!=as&&as.hostname){var t=as.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.ln())&&this.Tn()}),1),this.En=new af(this),this.En.load()}In(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.bn)||t.enable())}_dom_loaded(){this.is_capturing()&&bs(this.__request_queue,(t=>this._n(t))),this.__request_queue=[],this.In()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Rn()&&this.capture(fh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.bn)||i.unload(),null==(n=this.wn)||n.unload()):this.Rn()&&this.capture(fh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Op?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Pr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Pr(s.compression)&&s.data&&(s.compression=Ml),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Ir(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Ir(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Yf(s.url,s.method,s.compression,s.timestampMode);var c=Xf.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===Cl&&ds&&"undefined"!=typeof Promise&&!Bf?Gf(s).then((t=>{v(t)})).catch((e=>{if(fr(e))return Bf=!0,void v(r({},s,{compression:void 0,url:Yf(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return fr(t)||e===dr})(e)&&(Bf=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}_n(t){this.wn?this.wn.retriableRequest(t):this._send_request(t)}_execute_array(t){Sp++;try{var e,r=[],i=[],n=[];bs(t,(t=>{if(t)if(Ir(e=t[0]))n.push(t);else if(Tr(t))try{t.call(this)}catch(e){ms.error("Error executing queued PostHog call",t,e)}else Ir(t)&&"alias"===e?r.push(t):Ir(t)&&-1!==e.indexOf("capture")&&Tr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){bs(t,(function(t){try{if(Ir(t[0])){var r=e;_s(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ms.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{Sp--}}push(t){if(Sp>0&&Ir(t)&&Or(t[0])){var e=Dp.prototype[t[0]];Tr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.bn){if(this.is_capturing())if(!Pr(t)&&Or(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){if(this.hn.length>0){var v={};for(var f of this.hn.slice())try{ws(v,f())}catch(t){ms.error("Failed to produce browser extension event properties",t)}e=r({},v,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Or(null==(s=e)?void 0:s.$current_url)&&(ms.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=i&&i.Pn||ms.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==i?void 0:i.timestamp)||g,y=rn(null==i?void 0:i.uuid,xh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===vh&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),c&&(b.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Fu);(null==i?void 0:i.$set)&&!_&&(b.$set=null==i?void 0:i.$set);var w=null==i?void 0:i.$unset;w&&(b.$unset=w);var x=_?void 0:this.On(null==i?void 0:i.$set_once,t!==gh,t===ph);if(x&&(b.$set_once=x),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,l=b,u=t=>Or(t)?t.slice(0,a):t,h=new Set,b=function t(e,r){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var i;if(h.add(e),Ir(e))i=[],bs(e,(e=>{i.push(t(e))}));else{var n={};_s(e,((e,r)=>{h.has(e)||(n[r]=t(e,r))})),i=n}return i}}(l)),b.timestamp=m,Pr(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return nr.forEach(i),e.forEach(i),r}(b.properties,Rp)),t===Ll.DISMISSED||t===Ll.SENT){var k,S,C=null==(k=e)?void 0:k[Dl.SURVEY_ID],M=null==(S=e)?void 0:S[Dl.SURVEY_ITERATION];ru({id:C,current_iteration:M}),b.$set=r({},b.$set,{[Bl({id:C,current_iteration:M},t===Ll.SENT?"responded":"dismissed")]:!0})}else t===Ll.SHOWN&&(b.$set=r({},b.$set,{[Dl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var I,T=null==(I=e)?void 0:I.$product_tour_type;T&&(b.$set=r({},b.$set,{["$product_tour_last_seen_date/"+T]:(new Date).toISOString()}))}var E=r({},b.properties.$set,b.$set);if(Rr(E)||this.setPersonPropertiesForFlags(E),!$r(this.config.before_send)){var R=this.Rt(b);if(!R)return;(b=R).uuid=rn(b.uuid,xh)}this.en.emit("eventCaptured",b);var P=null!==(o=null==i?void 0:i._url)&&void 0!==o?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:P,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._n(O):this.bn.enqueue(O),b}ms.critical("This capture call is ignored due to client rate limiting.")}}else ms.error("No event name provided to posthog.capture")}else ms.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Fn(){var t;return null!==(t=this.Mn)&&void 0!==t?t:this.Mn=new xp(this)}nn(t){this.hn.push(t);var e=!0;return()=>{if(e){e=!1;var r=this.hn.indexOf(t);-1!==r&&this.hn.splice(r,1)}}}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.ln()&&(a[eh]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Or(a.distinct_id)&&!Lr(a.distinct_id)||Fr(a.distinct_id))&&ms.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!cs)return{};var l,u=t?[...Vd,...e||[]]:[],h=function(t){for(var e=0;Yi.length>e;e++){var r=Yi[e],i=r[1],n=r[0].exec(t),s=n&&(Tr(i)?i(n,t):i);if(s)return s}return["",""]}(cs),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Pr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==is||null==(o=is.screen)?void 0:o.width,b=null==is||null==(a=is.screen)?void 0:a.height,_=null==is?void 0:is.devicePixelRatio;Pr(g)||(p.userAgentDataPlatform=g),Pr(m)||(p.maxTouchPoints=m),Pr(y)||(p.screenWidth=y),Pr(b)||(p.screenHeight=b),Pr(_)||(p.devicePixelRatio=_);var w,x=ws(Cs({$os:d,$os_version:c,$browser:Qi(cs,navigator.vendor,v,f),$device:Xi(cs),$device_type:tn(cs,p),$timezone:ic(),$timezone_offset:nc()}),{$current_url:As(i?nn(null==as?void 0:as.href):null==as?void 0:as.href,u,Zd),$host:null==as?void 0:as.host,$pathname:null==as?void 0:as.pathname,$raw_user_agent:cs.length>1e3?cs.substring(0,997)+"...":cs,$browser_version:Ki(cs,navigator.vendor,v,f),$browser_language:Yd(),$browser_language_prefix:(w=Yd(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==is?void 0:is.screen.height,$screen_width:null==is?void 0:is.screen.width,$viewport_height:null==is?void 0:is.innerHeight,$viewport_width:null==is?void 0:is.innerWidth,$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return ps.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=ps.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&ws(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&ws(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.wn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===cp&&(a.$lib_custom_api_host=this.config.api_host),u=t!==vh||s?t!==fh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ws(a,u),t===vh&&os&&(a.title=os.title),!Pr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}cs&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();_s(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(a=ws({},h,p,g,a)).$is_identified=this._isIdentified(),Ir(this.config.property_denylist)?_s(this.config.property_denylist,(function(t){delete a[t]})):ms.error(Ep+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(ms.error(Tp),a=m(a,t));var y=this.An();return a.$process_person_profile=y,y&&!s&&this.$n("_calculate_event_properties"),a}On(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.An())return t;if(this.un&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ws({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(ms.error(Tp),o=a(o,"$set_once")),e&&(this.un=!0),Rr(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)}Ln(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.en.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Ip}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Ip})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ip})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=nu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Ip}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Ip})}Dn(t){return!t||Fr(t)?(ms.critical("Unique user id has not been set in posthog.identify"),!1):t===th?(ms.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ms.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return ms.uninitializedWarning("posthog.identify");if(Lr(t)&&(t=t.toString(),ms.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Dn(t)&&this.$n("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ou)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(lu)&&(this.unregister(lu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Zu)||lh)===lh,o=t!==i,a=!o&&s;if(o&&s)this.persistence.set_property(Zu,uh),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(ph,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.fn=Ch(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i);else if(a){this.persistence.set_property(Zu,uh);var l=e||{},u=r||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.fn=Ch(t,e,r)}else(e||r)&&this.setPersonProperties(e,r);o?(this.reloadFeatureFlags(),this.unregister(Uu)):a&&(e||r)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.$n("posthog.setPersonProperties")){var r=Ch(this.get_distinct_id(),t,e);this.fn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.fn=r):ms.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(Ir(t)?t:[t]).filter((t=>Or(t)&&t.length>0));0!==r.length&&this.$n("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.fn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(gh,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ms.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.$n("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n,s,o,a,l,u,h;if(ms.info("reset"),!this.__loaded)return ms.uninitializedWarning("posthog.reset");var d,c=this.get_property(ou),v=this.get_property(au),f=this.get_property(bu);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),Pr(f)||null==(d=this.persistence)||d.register({[bu]:f}),null==(i=this.surveys)||i.reset(),null==(n=this.En)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(Zu,lh),null==(h=this.sessionManager)||h.resetSessionId(),this.fn=null,this.config.cookieless_mode===ah)this.register_once({distinct_id:th,$device_id:null},"");else{var p=this.config.get_device_id(xh());this.register_once({distinct_id:p,$device_id:t?p:c},""),t||Pr(v)||this.register({[au]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s,o,a;r.__loaded?(null==(t=r.En)||t.stop(),null==(e=r.Mn)||e.dispose(),null==(i=r.logs)||i.flushLogs("sendBeacon"),null==(n=r.metrics)||n.flush("sendBeacon"),null==(s=r.bn)||s.unload(),null==(o=r.wn)||o.unload(),null==(a=r.featureFlags)||a.destroy()):ms.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Nn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.qn()}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 e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(su)?(ms.critical("Attempting to create alias for existing People user - aborting."),-2):this.$n("posthog.alias")?(Pr(e)&&(e=this.get_distinct_id()),t!==e?(this.Ln(lu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ms.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Er(t)){var i,n,s,o,a,l,u,h,d,c,v;ws(this.config,$p(t));var f=this.yn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rf(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.pn(this.config.debug);Nr(p)&&(this.config.debug=p),Nr(this.config.debug)&&(this.config.debug?(ps.DEBUG=!0,Ah.N()&&Ah.A("ph_debug",!0),ms.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ps.DEBUG=!1,Ah.N()&&Ah.D("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.jn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){ps.LIB_NAME=t,ps.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Dp.Hn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Pp;return e!==Pp&&(e=Pp+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Zu))===uh||(null==(e=this.sessionPersistence)?void 0:e.get_property(Zu))===uh}An(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===hh&&!this._isIdentified()&&Rr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[lu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Xu]))}Rn(){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.An()||this.$n("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$n("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$n(t){return"never"===this.config.person_profiles?(ms.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ln(Xu,!0),!0)}yn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==oh)}jn(){var t,e,r,i,n=this.yn();return(null==(t=this.persistence)?void 0:t.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==ah){if(this.ln()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new up(this),this.pageViewManager=new Gv(this),this.persistence&&(this.sessionPropsManager=new op(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Dp.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.an(this.sessionRecording,new l(this)),this.tn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.tn)))}var u,h;this.consent.optInOut(!0),this.jn(),this.In(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==oh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Pr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Tn()}else ms.warn(Mp)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==ah?(this.config.cookieless_mode===oh&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.jn(),this.config.cookieless_mode===oh&&(this.register({distinct_id:th,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Tn(),this.In())):ms.warn(Mp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===ah||(this.config.cookieless_mode===oh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.jn()}_is_bot(){return ss?hp(ss,this.config.custom_blocked_useragents):void 0}Tn(){os&&("visible"===os.visibilityState?this.dn||(this.dn=!0,this.capture(vh,{title:os.title},{send_instantly:!0}),this.cn&&(os.removeEventListener(dh,this.cn),this.cn=null)):this.cn||(this.cn=this.Tn.bind(this),Ts(os,dh,this.cn)))}debug(t){!1===t?(null==is||is.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==is||is.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}))}Ur(){var t=this.gn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ms.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):function(t,e,r,i,n){var s=e in t&&!$r(t[e]),o=r in t&&!$r(t[r]);return s?t[e]:!!o&&(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])}(t,"advanced_disable_flags","advanced_disable_decide",0,ms)}Rt(t){var e;if($r(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Hr),i=Ir(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),$r(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return jr(t.event)?ms.warn(o+". This can cause unexpected behavior."):ms.info(o),null}n.properties&&!Rr(n.properties)||ms.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&$r(n.properties[a]))return ms.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ir)?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)})}pn(t){var e=Nr(t)&&!t,r=Ah.N()&&"true"===Ah.q("ph_debug");return!e&&(!!r||t)}}Dp.__defaultExtensionClasses={},Dp.Hn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Ss(t.prototype[e[r]])}(Dp,["identify"]);var Np=ys("[ExceptionAutocapture]"),qp=ys("[TracingHeaders]"),jp=ys("[Web Vitals]"),Hp=9e5,Bp="disabled",Up="lazy_loading",zp="awaiting_config",Vp="missing_config";ys("[SessionRecording]"),ys("[SessionRecording]");var Wp="[SessionRecording]",Zp=ys(Wp),Gp=ys("[Heatmaps]");function Qp(t){return Er(t)&&"clientX"in t&&"clientY"in t&&Lr(t.clientX)&&Lr(t.clientY)}var Jp=ys("[Product Tours]"),Kp=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(mu))},Yp=["$set_once","$set"],Xp=ys("[SiteApps]"),tg="Error while initializing PostHog app with config id ";function eg(t,e,r){if($r(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 rg{constructor(t){this.Bn=new ap,this.Un=(t,e)=>this.zn(t,e)&&this.Vn(t,e)&&this.Wn(t,e)&&this.Zn(t,e),this.zn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Gn=new Set,this.Qn=new Set}init(){var t,e;Pr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Pr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.Qn)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Gn)||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.Gn.has(t)||this.Gn.has(e.event))&&this.Qn&&(null==(r=this.Qn)?void 0:r.size)>0&&this.Qn.forEach((t=>{this.Jn(e,t)&&this.Bn.emit("actionCaptured",t.name)}))}Kn(t){this.onAction("actionCaptured",(e=>t(e)))}Jn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Un(t,r))return!0;return!1}onAction(t,e){return this.Bn.on(t,e)}Vn(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(!eg(i,e.url,e.url_matching||"contains"))return!1}return!0}Wn(t,e){return!!this.Yn(t,e)&&!!this.Xn(t,e)&&!!this.ts(t,e)}Yn(t,e){var r;if(null==e||!e.href)return!0;var i=this.es(t);if(i.length>0)return i.some((t=>eg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&eg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Xn(t,e){var r;if(null==e||!e.text)return!0;var i=this.es(t);if(i.length>0)return i.some((t=>eg(t.text,e.text,e.text_matching||"exact")||eg(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!$r(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>eg(t,s,o))))}ts(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}es(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Zn(t,e){return null==e||!e.properties||0===e.properties.length||Th(e.properties.reduce(((t,e)=>{var r=Ir(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 ig{constructor(t){var e;this.rs=[],this._instance=t,this.ns=new Map,this.ss=new Map,this.os=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.ls(t)))}us(t,e){return!!t&&Th(t.propertyFilters,null==e?void 0:e.properties)}hs(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}ds(t,e,r){var i=(r===Il?this.ns:this.ss).get(t),n=[];return this.cs((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.us(s,e)}))}register(t){var e;Pr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.vs(t),this.fs(t))}fs(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.ps&&(this.ps=new rg(this._instance),this.ps.init(),this.ps.Kn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.os.get(e.name);r&&r.push(t.id),this.os.set(e.name,r||[t.id])}})))})))}vs(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ns=this.hs(t,Il),this.ss=this.hs(t,Tl))}onEvent(t,e){var r,i,n=this.gs(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ys(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.bs([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),void this._s(s)}if(this.ss.has(t)){var a=this.ds(t,e,Tl);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.bs(a.map((t=>t.id))),a.forEach((t=>this.ws(t.id))))}if(this.ns.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ns.get(t)});var l=this.ds(t,e,Il);this.xs(l.map((t=>t.id)))}}onAction(t){this.os.has(t)&&this.xs(this.os.get(t)||[])}xs(t){0!==t.length&&(this.rs=[...new Set([...this.rs,...t])],this.gs().info("updating activated items",{activatedItems:this.getActivatedIds()}))}_s(t){this.rs=this.rs.filter((e=>e!==t));var e=this.ks();e.includes(t)||(this.Ss([...e,t]),this.Cs())}bs(t){var e=new Set(t);this.rs=this.rs.filter((t=>!e.has(t)));var r=this.Ms(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.Ss(i),0===i.length&&this.Is())}Ms(){var t,e=this.Ts();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}ks(){var t,e,r=this.Ms();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Es()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}Cs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Rs(e)}Is(){this.Ps()}ls(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Es()];r&&r!==t&&(this.Ms().length>0&&this.Ss([]),this.Is())}getActivatedIds(){return[...new Set([...this.ks(),...this.rs])].filter((t=>!this.Os(t)))}reset(){this.rs=[],this.Ms().length>0&&this.Ss([]),this.Is()}getEventToItemsMap(){return this.ns}Fs(){return this.ps}}class ng extends ig{constructor(t){super(t)}Ts(){return ju}Es(){return Hu}As(){return Ll.SHOWN}cs(t){var e;null==(e=this._instance)||e.getSurveys(t)}ws(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}gs(){return Ql}Ss(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ju]:t})}Rs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Hu]:t})}Ps(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(Hu)}Os(){return!1}ys(t,e){var r;return this.cs((t=>{r=t.find((t=>t.id===e))})),!r||Gl(r)?t===Ll.SHOWN?"consume":"ignore":t===Ll.SHOWN?"persist":t===Ll.DISMISSED||t===Ll.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var sg="SDK is not enabled or survey functionality is not yet loaded",og="Disabled. Not loading surveys.",ag=null!=is&&is.location?$s(is.location.hash,"__posthog")||$s(location.hash,"state"):null,lg="_postHogToolbarParams",ug=ys("[Toolbar]"),hg=ys("[FeatureFlags]"),dg=ys("[FeatureFlags]",{debugEnabled:!0}),cg="\" failed. Feature flags didn't load in time.",vg=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},fg=t=>{var e={};for(var r of xs(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},pg="Refusing to render web experiment since the viewer is a likely bot",gg={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Sh(e,t),not_regex:(t,e)=>!Sh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class mg{get Te(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{mg.$s("retrieved web experiments from the server"),e.Ls=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Ls&&(mg.$s("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ls)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Or(i)&&t.variants[i]&&e.Ds(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];mg.Ns(s,e._instance)&&e.Ds(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())mg.$s(pg);else if(!this.Te.disable_web_experiments){if($r(this.Ls))return this.Ls=new Map,this.loadIfEnabled(),void this.previewWebExperiment();mg.$s("applying feature flags",t),t.forEach((t=>{var e;if(this.Ls&&null!=(e=this.Ls)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ls)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ds(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=mg.getWindowLocation();if(null!=t&&t.search){var e=Fs(null==t?void 0:t.search,"__experiment_id"),r=Fs(null==t?void 0:t.search,"__experiment_variant");e&&r&&(mg.$s("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.qs(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Te.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.Te.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}qs(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(mg.$s("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ds(i[0].name,e,i[0].variants[e].transforms))}static Ns(t,e){return!$r(t.conditions)&&mg.js(t,e)&&mg.Hs(t)}static js(t,e){var r;if($r(t.conditions)||$r(null==(r=t.conditions)?void 0:r.url))return!0;var i=mg.getWindowLocation();if(i){var n,s,o,a=Hs(e,i.href);return null==(n=t.conditions)||!n.url||gg[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==is?void 0:is.location}static Hs(t){var e;if($r(t.conditions)||$r(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Qd();if(r.utm_source){var i,n,s,o,a,l,u,h,d=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,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static $s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];ms.info("[WebExperiments] "+t,r)}Ds(t,e,r){this._is_bot()?mg.$s(pg):"control"!==e?r.forEach((r=>{if(r.selector){var i;mg.$s("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)}))}})):mg.$s("Control variants leave the page unmodified.")}_is_bot(){return ss&&this._instance?hp(ss,this.Te.custom_blocked_useragents):void 0}}var yg=ys("[Conversations]"),bg="Conversations not available yet.",_g="console",wg={featureFlags:class{constructor(t){this.Bs=!1,this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.Gs=!1,this.Qs=!1,this.Js=0,this.Ks=()=>{var t=this.Ys();this.Js=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],is&&Ts(is,"online",this.Ks)}destroy(){null==is||is.removeEventListener("online",this.Ks)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Xs(t){return this._instance.get_property(t)}eo(){var t,e;return null!==(t=null==(e=this.mi)?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ro(){return!!this.eo()&&(this.Qs||this.zs||(this.Qs=!0,hg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}io(){var t,e=null!==(t=this.Te.evaluation_contexts)&&void 0!==t?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.Gs||(hg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||hg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}no(){return this.io().length>0}so(){var t=this.Te.flag_keys;if(!Pr(t)){if(Ir(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||hg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));hg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.Xs(Iu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.Xs(Pu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:er(v),variant:rr(v),reason:void 0,metadata:Pr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Us}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Xs(Ru),e=this.Xs(Au),i=this.Xs($u);if(!i&&!e)return t||{};var n=ws({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Pr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Pr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Bs||(hg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Bs=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:er(i),variant:rr(i),payload:tr(e[r])}}))}getFlagVariants(){var t=this.Xs(Iu),e=this.Xs(Au);if(!e)return t||{};for(var r=ws({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Bs||(hg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Bs=!0),r}getFlagPayloads(){var t=this.Xs(Pu),e=this.Xs($u);if(!e)return t||{};for(var r=ws({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Bs||(hg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Bs=!0),r}reloadFeatureFlags(){this.Vs||this.Te.advanced_disable_feature_flags||this.Ys()||this.oo||(this._instance.en.emit("featureFlagsReloading",!0),this.oo=setTimeout((()=>{this.ao()}),5))}lo(){clearTimeout(this.oo),this.oo=void 0}ensureFlagsLoaded(){this.Us||this.zs||this.oo||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Vs=t}ao(t){var e;if(this.lo(),!this._instance.Ur()&&!this.Ys())if(this.zs)this.Ws=!0;else{var i=this.Te.token,n=this.Xs(ou),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.mi)?void 0:e.get_initial_props())||{},this.Xs(Lu)||{},{$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION}),group_properties:this.Xs(Du),timezone:ic()};Ar(n)||Pr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.no()&&(s.evaluation_contexts=this.io());var o=this.so();Pr(o)||(s.flag_keys=o);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.zs=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Te.disable_compression?void 0:Ml,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.uo(t.statusCode),200===t.statusCode&&(this.Ws||(this.$anon_distinct_id=void 0),n=!1),this.zs=!1,!s.disable_flags||this.Ws){this.Zs=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Vu]:o}),u)hg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ws&&(this.Ws=!1,this.ao())}}})}}Ys(){return Ls(this.Js,3)}uo(t){this.Js=Ds(t,this.Js,3,(()=>hg.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else hg.warn('getFeatureFlag for key "'+t+cg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Xs(Ou)||void 0,l=this.Xs(Wu)||void 0,u=this.Xs(Uu)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.Xs(zu);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Uu]:u,[zu]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Ir(u[t])?u[t].push(o):u[t]=[o],null==(v=this.mi)||v.register({[Uu]:u});var S=this.getFeatureFlagDetails(t),C=[...null!==(f=this.Xs(Vu))&&void 0!==f?f:[]];Pr(n)&&C.push("flag_missing");var M={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Te.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.Zs};Pr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(M.$feature_flag_has_experiment=S.metadata.has_experiment),Pr(null==S||null==(y=S.metadata)?void 0:y.version)||(M.$feature_flag_version=S.metadata.version);var I,T=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;T&&(M.$feature_flag_reason=T),null!=S&&null!=(x=S.metadata)&&x.id&&(M.$feature_flag_id=S.metadata.id),Pr(null==S?void 0:S.original_variant)&&Pr(null==S?void 0:S.original_enabled)||(M.$feature_flag_original_response=Pr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(M.$feature_flag_original_payload=null==S||null==(I=S.metadata)?void 0:I.original_payload),C.length&&(M.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",M)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:tr(s)}}}else hg.warn('getFeatureFlagResult for key "'+t+cg)}getRemoteConfigPayload(t,e){var r=this.Te.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:ps.LIB_NAME,$lib_version:ps.LIB_VERSION}};this.no()&&(i.evaluation_contexts=this.io());var n=this.so();Pr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Te.disable_compression?void 0:Ml,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Zs)return e.defaultValue;if(!(this.Us||this.getFlags()&&this.getFlags().length>0))return hg.warn('isFeatureEnabled for key "'+t+cg),e.defaultValue;var r=this.getFeatureFlag(t,e);return Pr(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.mi){this.Us=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(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]})))):t.featureFlags&&hg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(Ir(u)){hg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;e&&e.register({[Tu]:u,[Iu]:v,[Fu]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[Tu]:Object.keys(fg(p)),[Iu]:p||{},[Pu]:g||{},[Ru]:m||{},[Fu]:!0===t.minimalFlagCalledEvents},d?{[Ou]:d}:{},c?{[Wu]:c}:{}))}}}(t,this.mi,n,s,o,i),e||(this.Qs=!1),this.ho(e)}}override(t,e){void 0===e&&(e=!1),hg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return hg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.mi.unregister(Au),this.mi.unregister($u),this.ho(),dg.info("All overrides cleared");if(Ir(t)){var e=vg(t);return this.mi.register({[Au]:e}),this.ho(),dg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Bs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Au),dg.info("Flag overrides cleared");else if(i.flags){if(Ir(i.flags)){var n=vg(i.flags);this.mi.register({[Au]:n})}else this.mi.register({[Au]:i.flags});dg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister($u),dg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[$u]:i.payloads}),dg.info("Payload overrides set",{payloads:i.payloads}))),void this.ho()}if(t&&"object"==typeof t)return this.mi.register({[Au]:t}),this.ho(),dg.info("Flag overrides set",{flags:t});hg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Us){var e=this.do(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){hg.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.Xs(Eu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this.mi)||n.register({[Tu]:Object.keys(fg(l)),[Iu]:l}),this.ho()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.Xs(Eu),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.Te.token+n),method:"GET",timestampMode:"query",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(Eu),null==(i=this.mi)||i.register({[Eu]:n}),t(n)}}})}do(){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)),{})}}ho(t){var e=this.do(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){hg.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Xs(Lu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Lu]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.Xs(Lu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Lu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Lu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Xs(Du)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Du]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Xs(Du)||{};this._instance.register({[Du]:r({},e,{[t]:{}})})}else this._instance.unregister(Du)}reset(){this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.$anon_distinct_id=void 0,this.lo(),this.Bs=!1,this.Js=0}}},xg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!(null==(t=this.co)||!t.isStarted)}get status(){var t,e;return this.vo===zp||this.vo===Vp?this.vo:null!==(t=null==(e=this.co)?void 0:e.status)&&void 0!==t?t:this.vo}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.vo=Bp,this.fo=void 0,this._instance=t,!this._instance.sessionManager)throw Zp.error("started without valid sessionManager"),new Error(Wp+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===ah)throw new Error(Wp+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get po(){var t,e=!(null==(t=this._instance.get_property(bu))||!t.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return is&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.po||null==(e=this.co)||!e.isStarted){var r=!Pr(Object.assign)&&!Pr(Array.from);this.po&&r?(this.mo(t),Zp.info("starting")):(this.vo=Bp,this.stopRecording())}}mo(t){var e,r,i;this.po&&(this.vo!==zp&&this.vo!==Vp&&(this.vo=Up),null!=aa&&null!=(e=aa.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=aa.__PosthogExtensions__)&&r.initSessionRecording?this.yo(t):null==(i=aa.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.bo,(e=>{if(e)return Zp.error("could not load recorder",e);this.yo(t)})))}stopRecording(){var t,e;null==(t=this.fo)||t.call(this),this.fo=void 0,null==(e=this.co)||e.stop()}_o(){var t,e;null==(t=this.fo)||t.call(this),this.fo=void 0,null==(e=this.co)||e.discard()}wo(){var t,e;null==(t=this.mi)||t.unregister(Mu),null==(e=this.mi)||e.unregister(_u)}xo(t,e){if($r(t))return null;var r,i=Lr(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Zp.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}ko(t){if(this.mi){var e,i,n=this.mi,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.xo(null==(e=this.Te.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.xo(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;$r(a)&&this.wo();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[bu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Pr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.fo)||e.call(this),this.fo=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.ko(e),void this._o()):(this.ko(e),void this.startIfEnabledOrStop()):(this.vo===zp&&(this.vo=Vp,Zp.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.co)&&r.log?this.co.log(t,e):Zp.warn("log called before recorder was ready")}get bo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(bu);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}So(){var t,e,r=this._instance.get_property(bu);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Zp.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}yo(t){var e,r;if(null==(e=aa.__PosthogExtensions__)||!e.initSessionRecording)return Zp.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[nh]:!0});if(this.co||(this.co=null==(r=aa.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.co._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.So()){if(this.vo===Vp||this.vo===zp)return;return this.vo=zp,Zp.info("persisted remote config is stale, requesting fresh config before starting"),void new af(this._instance).load()}this.vo=Up,this.co.start(t)}onRRwebEmit(t){var e;null==(e=this.co)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.co||null==(e=this.mi)||e.register({[xu]:!0}),null==(t=this.co)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.co||null==(e=this.mi)||e.register({[wu]:!0}),null==(t=this.co)||t.overrideSampling()}overrideTrigger(t){var e,r;this.co||null==(r=this.mi)||r.register({["url"===t?ku:Su]:!0}),null==(e=this.co)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.co)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.co)||!r.tryAddCustomEvent(t,e))}}},kg={autocapture:class{constructor(t){this.Co=!1,this.Mo=null,this.Io=!1,this.To=!1,this.instance=t,this.rageclicks=new kv(t.config.rageclick),this.Eo=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=Er(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}Ro(){if(this.isBrowserSupported()){if(is&&os){var t=t=>{t=t||(null==is?void 0:is.event);try{this.Po(t)}catch(t){Cv.error("Failed to capture event",t)}};if(Ts(os,"submit",t,{capture:!0}),Ts(os,"change",t,{capture:!0}),Ts(os,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||(null==is?void 0:is.event);try{this.Po(t,Sv)}catch(t){Cv.error("Failed to capture copy/cut event",t)}};Ts(os,"copy",e,{capture:!0}),Ts(os,"cut",e,{capture:!0})}}}else Cv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Co&&(this.Ro(),this.Co=!0)}onRemoteConfig(t){if(this.Io=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);var r=e.autocapture_opt_out;Nr(r)&&(this.instance.persistence&&this.instance.persistence.register({[hu]:r}),this.Mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Eo=t}getElementSelectors(t){var e,r=[];return null==(e=this.Eo)||e.forEach((e=>{var i=null==os?void 0:os.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[hu],i=this.Mo,n=this.instance.Ur()&&!this.Io;if(Ar(i)&&!Nr(r)&&!n)return!1;var s=null!==(e=this.Mo)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}Po(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=no(t);Js(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())&&go(i,this.instance.config.rageclick)&&this.Po(t,"$rageclick");var n=e===Sv;if(i&&function(t,e,r,i,n,s){var o;if(!is||mo(t))return!1;if(null!=r&&r.url_allowlist&&!to(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&to(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((t=>e.type===t)))return!1}var l=yo(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Pr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!oo(h,null==r?void 0:r.css_selector_allowlist))return!1;if(oo(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:lo))return!1;try{var d=is.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){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 u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(so.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=Tv(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===Sv){var l,u=ro(null==is||null==(l=is.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Tr(null==os?void 0:os.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Oo=(null==is||null==(e=is.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ms.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Fo&&this.Fo(),this.Fo=void 0,ms.info("History API monitoring stopped")}monitorHistoryChanges(){is&&is.history&&(this.Ao("pushState"),this.Ao("replaceState"),this.$o())}Ao(t){var e;if(is&&(null==(e=is.history[t])||!e.__posthog_wrapped__)){var r=this;qs(is.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Lo(t)}))}}Lo(t){try{var e,r=null==is||null==(e=is.location)?void 0:e.pathname;if(!r)return;r!==this.Oo&&this.isEnabled&&this._instance.capture(vh,{navigation_type:t}),this.Oo=r}catch(e){ms.error("Error capturing "+t+" pageview",e)}}$o(){if(!this.Fo){var t=()=>{this.Lo("popstate")};Ts(is,"popstate",t),this.Fo=()=>{is&&is.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Do=!1,this.Co=!1,this.No=null,this.instance=t,this.Do=!(null==(e=this.instance.persistence)||!e.props[du]),this.rageclicks=new kv(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Er(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return $r(this.Te.capture_heatmaps)?$r(this.Te.enable_heatmaps)?this.Do:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Co)return;Gp.info("starting..."),this.qo(),this.xe()}else{var t;clearInterval(null!==(t=this.No)&&void 0!==t?t:void 0),this.jo(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[du]:r}),this.Do=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Ho(t){Qp(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}xe(){this.No&&clearInterval(this.No),this.No=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(os)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}qo(){is&&os&&(this.Bo=this.oi.bind(this),Ts(is,ch,this.Bo),this.Uo=t=>this.pe(t||(null==is?void 0:is.event)),Ts(os,"click",this.Uo,{capture:!0}),this.zo=t=>this.Vo(t||(null==is?void 0:is.event)),Ts(os,"mousemove",this.zo,{capture:!0}),this.Wo=new Uv(this.instance,Hv,this.Ho.bind(this)),this.Wo.startIfEnabledOrStop(),this.Zo=this.xe.bind(this),Ts(os,dh,this.Zo),this.Co=!0)}jo(){var t;is&&os&&(this.Bo&&is.removeEventListener(ch,this.Bo),this.Uo&&os.removeEventListener("click",this.Uo,{capture:!0}),this.zo&&os.removeEventListener("mousemove",this.zo,{capture:!0}),this.Zo&&os.removeEventListener(dh,this.Zo),clearTimeout(this.Go),null==(t=this.Wo)||t.stop(),this.Co=!1)}Qo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&Gs(i)&&!Qs(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:is)?void 0:s.getComputedStyle(i).position}catch(t){return!1}if(_r(e,n))return!0;i=ao(i)}return!1}(no(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}pe(t,e){var i;if(void 0===e&&(e="click"),!Zs(t.target)&&Qp(t)){var n=this.Qo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&go(no(t),this.instance.config.rageclick)&&this.Wt(r({},n,{type:"rageclick"})),this.Wt(n)}}Vo(t){!Zs(t.target)&&Qp(t)&&(clearTimeout(this.Go),this.Go=setTimeout((()=>{this.Wt(this.Qo(t,"mousemove"))}),500))}Wt(t){if(is){var e=this.Te.disable_capture_url_hashes?nn(is.location.href):is.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Vd,...r||[]]:[],n=As(e,i,Zd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(t)}}oi(){this.R&&!Rr(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Uv,webVitalsAutocapture:class{constructor(t){var e;this.Do=!1,this.Co=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Jo=()=>{clearTimeout(this.Ko),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.Yo=t=>{var e;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Xo();if(!Pr(i))if($r(null==t?void 0:t.name)||$r(null==t?void 0:t.value))jp.error("Invalid metric received",t);else if(!this.ta||this.ta>t.value){this.R.url!==i&&(this.Jo(),this.Ko=setTimeout(this.Jo,this.flushToCaptureTimeoutMs)),Pr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Pr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});Pr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Jo()}else jp.error("Ignoring metric with value >= "+this.ta,t)},this.ea=()=>{if(!this.Co){var t,e,r,i,n=aa.__PosthogExtensions__;if(!Pr(n)&&!Pr(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;t=s.onLCP,e=s.onCLS,r=s.onFCP,i=s.onINP}t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Yo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Yo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Yo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Yo.bind(this)),this.Co=!0):jp.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Do=!(null==(e=this._instance.persistence)||!e.props[pu]),this.startIfEnabled()}get ra(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Er(this.ra)?null==(t=this.ra)?void 0:t.web_vitals_allowed_metrics:void 0;return $r(r)?(null==(e=this._instance.persistence)?void 0:e.props[yu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Er(this.ra)?this.ra.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Er(this.ra)?this.ra.web_vitals_attribution:void 0;return null!=t&&t}get ta(){var t=Er(this.ra)&&Lr(this.ra.__web_vitals_max_value)?this.ra.__web_vitals_max_value:Hp;return t>0&&6e4>=t?Hp:t}get isEnabled(){var t=null==as?void 0:as.protocol;if("http:"!==t&&"https:"!==t)return jp.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Er(this.ra)?this.ra.web_vitals:Nr(this.ra)?this.ra:void 0;return Nr(e)?e:this.Do}startIfEnabled(){this.isEnabled&&!this.Co&&(jp.info("enabled, starting..."),this.tr(this.ea))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Er(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Er(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[pu]:r}),this._instance.persistence.register({[yu]:i})),this.Do=r,this.startIfEnabled()}}}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?jp.error("failed to load script",e):t()}))}Xo(){var t=is?this._instance.config.disable_capture_url_hashes?nn(is.location.href):is.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Vd,...e||[]]:[];return As(t,r,Zd)}jp.error("Could not determine current URL")}}},Sg={exceptionObserver:class{constructor(t){var e;this.ea=()=>{var t;if(is&&this.isEnabled&&null!=(t=aa.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=aa.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=aa.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=aa.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ia&&this.Te.capture_unhandled_errors&&(this.ia=e(this.captureException.bind(this))),!this.na&&this.Te.capture_unhandled_rejections&&(this.na=r(this.captureException.bind(this))),!this.sa&&this.Te.capture_console_errors&&(this.sa=i(this.captureException.bind(this)))}catch(t){Np.error("failed to start",t),this.oa()}}},this._instance=t,this.aa=!(null==(e=this._instance.persistence)||!e.props[cu]),this.la=new Qr(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,it:Np})),this.Te=this.ua(),this.startIfEnabledOrStop()}ua(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Er(t)?e=r({},e,t):(Pr(t)?this.aa:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Np.info("enabled"),this.oa(),this.tr(this.ea)):this.oa()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Np.error("failed to load script",e);t()}))}oa(){var t,e,r;null==(t=this.ia)||t.call(this),this.ia=void 0,null==(e=this.na)||e.call(this),this.na=void 0,null==(r=this.sa)||r.call(this),this.sa=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.aa=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cu]:this.aa}),this.Te=this.ua(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ua()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.la.consumeRateLimit(n)?Np.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.ha=[],this.da=Tc(),this._instance=t,this.ha=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(vu))&&void 0!==e?e:[],this.ca=ts(this.va()),this.fa=new es(this.ca)}onConfigChange(){this.ca=ts(this.va()),this.fa.setConfig(this.ca)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ha=s,this._instance.persistence&&this._instance.persistence.register({[vu]:this.ha,[fu]:o})}}}get pa(){var t,e=!!this._instance.get_property(fu),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.da.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ca.enabled)try{if(!Or(t)||0===t.trim().length)return void Ic.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>Yn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.ga(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&Ic.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.fa.add(r({[Jn]:t,[Kn]:(new Date).toISOString()},n))}catch(t){Ic.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ma(e)){if(this.ya(e))return this.ba("Exception dropped: matched a suppression rule"),void Ic.info("Skipping exception capture because a suppression rule matched");if(!this.pa&&this._a(e))return this.ba("Exception dropped: thrown by a browser extension"),void Ic.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.wa(e))return this.ba("Exception dropped: thrown by the PostHog SDK"),void Ic.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ca.enabled&&$r(t.$exception_steps)?this.xa(t):t,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(r.$release_id=i);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Pn:!0});return n&&this.fa.clear(),n}catch(t){return Ic.error("Failed to capture exception event. Dropping this exception.",t),void this.fa.clear()}}catch(t){return void Ic.error("Failed to process exception event. Ignoring this exception.",t)}var s}xa(t){try{var e=this.fa.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return Ic.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ba(t){this.ca.enabled&&this.fa.add({[Jn]:t,[Kn]:(new Date).toISOString()})}ga(t){return Er(t)?r({},t):{}}va(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ya(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Or(r)&&r.length>0&&t.$exception_types.push(r),Or(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.ha.some((t=>{var r=t.values.map((t=>{var r=Mh[t.operator],i=e[t.key];if(!r||!i)return!1;var n=Ir(t.value)?t.value:[t.value];return n.length>0&&r(n,i)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}catch(t){return Ic.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}_a(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://")))}wa(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}ma(t){return!$r(t)&&Ir(t)}}},Cg=r({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.ka=null,this.Sa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.mi&&this.mi.register({[mu]:!!e.productTours}),!Kp(this._instance))return!this.ka&&$r(null==(r=this.mi)?void 0:r.props[Bu])||Jp.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.ka)||i.stop(),this.ka=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ka&&Kp(this._instance)&&this.tr((()=>this.Ca()))}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Jp.error("Could not load product tours script",e):t()}))}Ca(){var t;!this.ka&&null!=(t=aa.__PosthogExtensions__)&&t.generateProductTours&&(this.ka=aa.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ir(this.Sa)||e){var r=this.mi;if(r){var i=r.props[Bu];if(Ir(i)&&!e)return this.Sa=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",timestampMode:"query",callback:e=>{if(Kp(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Jp.error(n),void t([],{isLoaded:!1,error:n})}var s=Ir(e.json.product_tours)?e.json.product_tours:[];this.Sa=s,r&&r.register({[Bu]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Sa,{isLoaded:!0})}getActiveProductTours(t){$r(this.ka)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ka.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ka)||e.showTourById(t)}previewTour(t){this.ka?this.ka.previewTour(t):this.tr((()=>{var e;this.Ca(),null==(e=this.ka)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ka)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ka)||t.nextStep()}previousStep(){var t;null==(t=this.ka)||t.previousStep()}clearCache(){var t;this.Sa=null,null==(t=this.mi)||t.unregister(Bu)}resetTour(t){var e;null==(e=this.ka)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ka)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ka)||e.cancelPendingTour(t)}}},wg),Mg={siteApps:class{constructor(t){this.Ma=0,this._instance=t,this.Ia=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ta(t,e){if(e){var r=this.globalsForEvent(e);this.Ia.push(r),this.Ia.length>1e3&&(this.Ia=this.Ia.slice(10))}}get siteAppLoaders(){var t;return null==(t=aa._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ta.bind(this));this.Ea=()=>{t(),this.Ia=[],this.Ea=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=t.$set_once,g=t.$set;return{event:r({},i(t,Yp),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Ra(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Xp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Xp.error("prepare_external_dependency_script returned null"),null):t}Pa(){var t,e,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==os?void 0:os.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Ma++,this.Oa)return this.Fa();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.Ra(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Ar(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.Oa=()=>{h.forEach((t=>t())),this.Oa=void 0},this.Fa()}Fa(){var t=!1;return()=>{var e;t||(t=!0,this.Ma--,0===this.Ma&&(null==(e=this.Oa)||e.call(this)))}}Aa(t,e){void 0===e&&(e=!0);var r=this.Pa();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Ia.length&&(Xp.info("Processing "+this.Ia.length+" events for site app with id "+t.id),this.Ia.forEach((t=>this.Aa((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Ea)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Xp.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Aa((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){Xp.error(tg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Xp.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}$a(){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)}La(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Aa((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){Xp.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.$a(),void this._instance.on("eventCaptured",(t=>this.La(t)))):void Xp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Ea)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;aa["__$$ph_site_app_"+e]=n._instance,null==(t=aa.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return Xp.error(tg+e,t)}))};for(var a of s.siteApps)o()}else Xp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Ig={tracingHeaders:class{constructor(t){this.Da=void 0,this.Na=void 0,this.qa=void 0,this.ea=()=>{var t,e,r=this.ja();r?(Pr(this.Da)&&(this.Da=null==(t=aa.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Pr(this.Na)&&(this.Na=null==(e=aa.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.oa()},this._instance=t}initialize(){this.startIfEnabledOrStop()}tr(t){var e,r;null!=(e=aa.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=aa.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return qp.error("failed to load script",e);t()}))}Ha(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}ja(){var t=this.Ha();return Ir(t)?(Ir(this.qa)?this.qa.splice(0,this.qa.length,...t):this.qa=[...t],t.length>0?this.qa:void 0):(Ir(this.qa)&&this.qa.splice(0),this.qa=t||void 0,this.qa)}oa(){var t,e;null==(t=this.Da)||t.call(this),null==(e=this.Na)||e.call(this),this.Da=void 0,this.Na=void 0}startIfEnabledOrStop(){this.ja()?this.tr(this.ea):this.oa()}}},Tg=r({surveys:class{get Te(){return this._instance.config}constructor(t){this.Ba=void 0,this._surveyManager=null,this.Ua=!1,this.za=[],this.Va=null,this.Wa=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return Ql.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if($r(e))return Ql.warn("Flags not loaded yet. Not loading surveys.");var r=Ir(e);this.Ba=r?e.length>0:e,Ql.info("flags response received, isSurveysEnabled: "+this.Ba),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Yl)||null!=i&&i.startsWith(Xl))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.Ua)Ql.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Ql.info(og);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Ql.info("Not loading surveys in cookieless mode without consent.");else{var t=null==aa?void 0:aa.__PosthogExtensions__;if(t){if(!Pr(this.Ba)||this.Te.advanced_enable_surveys){var e=this.Ba||this.Te.advanced_enable_surveys;this.Ua=!0;try{var r=t.generateSurveys;if(r)return void this.Za(r,e);var i=t.loadExternalDependency;if(!i)return void this.Ga(sh);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Ga("Could not load surveys script",r):this.Za(t.generateSurveys,e)}))}catch(t){throw this.Ga("Error initializing surveys",t),t}finally{this.Ua=!1}}}else Ql.error("PostHog Extensions not found.")}}Za(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new ng(this._instance),Ql.info("Surveys loaded successfully"),this.Qa({isLoaded:!0})}Ga(t,e){Ql.error(t,e),this.Qa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.za.push(t),this._surveyManager&&this.Qa({isLoaded:!0}),()=>{this.za=this.za.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Te.disable_surveys)return Ql.info(og),t([]);var r,i=this._instance.get_property(Nu);if(i&&!e)return t(i,{isLoaded:!0}),void(this.Ja()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Va?this.Va.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.Va=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:e=>{var i;this.Va=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ql.error(s),this.Wa=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.Wa=null;var a,l=e.json.surveys||[],u=l.filter((t=>Jl(t)&&(Zl(t)||Kl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Nu]:l,[qu]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}Ja(){return this.Ka()&&!this.Va&&!this.Ya()}Ka(){var t=this._instance.get_property(qu);return Lr(t)&&Date.now()-t>3e5}Ya(){return Lr(this.Wa)&&3e5>Date.now()-this.Wa}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};ru(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Qa(t){for(var e of this.za)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ql.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!$r(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ql.warn("init was not called")}Xa(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}tl(t){if($r(this._surveyManager))return{eligible:!1,reason:sg};var e="string"==typeof t?this.Xa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}el(t){if($r(this._surveyManager))return{eligible:!1,reason:sg};var e="string"==typeof t?this.Xa(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if($r(this._surveyManager))return Ql.warn("init was not called"),{visible:!1,disabledReason:sg};var e=this.el(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return $r(this._surveyManager)?(Ql.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:sg})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.el(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if($r(this._surveyManager))Ql.warn("init was not called");else{var n="string"==typeof t?this.Xa(t):t;if(null!=n&&n.id)if(iu.includes(n.type)){var s=null==os?void 0:os.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ql.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ql.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Ql.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ql.warn("Survey element not found")}else Ql.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ql.warn("Survey not found")}}displaySurvey(t,e){var i;if($r(this._surveyManager))Ql.warn("init was not called");else{var n=this.Xa(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Nl&&e.initialResponses&&Ql.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.tl(n);if(!o.eligible)return void Ql.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ql.warn("Survey not found")}}cancelPendingSurvey(t){$r(this._surveyManager)?Ql.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},wg),Eg={toolbar:class{constructor(t){this.instance=t}rl(t){aa.ph_toolbar_state=t}il(){var t;return null!==(t=aa.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Es(this.instance.config))return!1;if(!is||!os)return!1;t=null!=t?t:is.location,r=null!=r?r:is.history;try{if(!e){try{is.localStorage.setItem("test","test"),is.localStorage.removeItem("test")}catch(t){return!1}e=null==is?void 0:is.localStorage}var i,n=ag||$s(t.hash,"__posthog")||$s(t.hash,"state"),s=n?ks((()=>JSON.parse(atob(decodeURIComponent(n)))))||ks((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(lg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}nl(t){var e=aa.ph_load_toolbar||aa.ph_load_editor;!$r(e)&&Tr(e)?e(t,this.instance):ug.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==os||!os.getElementById(Us));if(!is||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(is.localStorage.setItem(lg,JSON.stringify(r({},n,{source:void 0}))),2===this.il())this.nl(n);else if(0===this.il()){var s;this.rl(1),null==(s=aa.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return ug.error("[Toolbar] Failed to load",t),void this.rl(0);this.rl(2),this.nl(n)})),Ts(is,"turbolinks:load",(()=>{this.rl(0),this.loadToolbar(n)}))}return!0}sl(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)}}},Rg=r({experiments:mg},wg),Pg={conversations:class{constructor(t){this.ol=void 0,this._conversationsManager=null,this.al=!1,this.ll=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;$r(e)||(Nr(e)?this.ol=e:(this.ol=e.enabled,this.ll=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.ol=void 0,this.ll=null}loadIfEnabled(){if(!(this._conversationsManager||this.al||this._instance.config.disable_conversations||Es(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==aa?void 0:aa.__PosthogExtensions__;if(t&&!Pr(this.ol)&&this.ol)if(this.ll&&this.ll.token){this.al=!0;try{var e=t.initConversations;if(e)return this.ul(e),void(this.al=!1);var r=t.loadExternalDependency;if(!r)return void this.hl(sh);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.hl("Could not load conversations script",e):this.ul(t.initConversations),this.al=!1}))}catch(t){this.hl("Error initializing conversations",t),this.al=!1}}else yg.error("Conversations enabled but missing token in remote config.")}}ul(t){if(this.ll)try{this._conversationsManager=t(this.ll,this._instance),yg.info("Conversations loaded successfully")}catch(t){this.hl("Error completing conversations initialization",t)}else yg.error("Cannot complete initialization: remote config is null")}hl(t,e){yg.error(t,e),this._conversationsManager=null,this.al=!1}show(){this._conversationsManager?this._conversationsManager.show():yg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ol&&!Ar(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):(yg.warn(bg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(yg.warn(bg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(yg.warn(bg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(yg.warn(bg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(yg.warn(bg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(yg.warn(bg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(yg.warn(bg),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}Nn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Og={logs:class{constructor(t){var e;this.dl=!1,this.cl=!1,this.it=ys("[logs]"),this.Gr=[],this.vl=[],this.Js=0,this.fl=()=>{var t,e;this.Js=0,null==(t=this.pl)||t.onReconnect(),null==(e=this.gl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.dl=!0),is&&Ts(is,"online",this.fl)}ml(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Pr(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new gn(this.yl(t,e),s,this.it,(()=>this.bl()),(t=>t()),void 0,i),s]}_l(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.pl||this.wl!==e){var r;null==(r=this.pl)||r.reset(),this.wl=e;var i=this.ml((()=>this.Gr),(t=>{this.Gr=t}));this.pl=i[0],this.xl=i[1]}return this.pl}kl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.gl||this.Sl!==e){var r;null==(r=this.gl)||r.reset(),this.Sl=e;var i=this.ml((()=>this.vl),(t=>{this.vl=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},_g);this.gl=i[0],this.Cl=i[1]}return this.gl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!$r(r)&&r&&(this.dl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],null==(t=this.pl)||t.reset(),this.vl=[],null==(e=this.gl)||e.reset(),this.Js=0}captureLog(t){this._l().captureLog(t)}le(t){this.kl().captureLog(t)}get logger(){return this.Ml||(this.Ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Ml}flushLogs(t){t?this.Il(t):(this.pl&&this.pl.flush().catch((t=>this.it.error("PostHog logs flush failed:",t))),this.gl&&this.gl.flush().catch((t=>this.it.error("PostHog logs flush failed:",t))))}loadIfEnabled(){if(this.dl&&!this.cl){var t=null==aa?void 0:aa.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.it.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.cl=!0)})):this.it.error(sh)}else this.it.error("PostHog Extensions not found.")}}yl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===sr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===sr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},$t:t=>this.$t(t),getLibraryId:()=>ps.LIB_NAME,getLibraryVersion:()=>ps.LIB_VERSION}}$t(t){return new Promise((e=>{if(Ls(this.Js,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Tl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.El(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}El(t){(0!==t||this._instance.__loaded)&&(this.Js=Ds(t,this.Js,3,(()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Il(t){this.Gr.length>0&&this.Rl(t,this.Gr,this.xl,ps.LIB_NAME,(t=>{this.Gr=t})),this.vl.length>0&&this.Rl(t,this.vl,this.Cl,_g,(t=>{this.vl=t}))}Rl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=pn(s,fn(r,ps.LIB_NAME,ps.LIB_VERSION),i,ps.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Tl(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Tl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}bl(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=i,$r(n)||(e.sessionStartTimestamp=n),$r(s)||(e.lastActivityTimestamp=s)}if(null!=aa&&null!=(t=aa.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?nn(aa.location.href):aa.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},Fg={metrics:class{constructor(t){this.it=ys("[metrics]"),this._instance=t}initialize(){}_l(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.pl&&this.wl===r||(null==(e=this.pl)||e.reset(),this.wl=r,this.pl=new _n(this.yl(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.it)),this.pl}count(t,e,r){void 0===e&&(e=1),this._l().count(t,e,r)}gauge(t,e,r){this._l().gauge(t,e,r)}histogram(t,e,r){this._l().histogram(t,e,r)}flush(t){if(!this.pl)return Promise.resolve();if(t){var e=this.pl.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.pl.flush().catch((t=>this.it.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.pl)||t.reset()}yl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>ps.LIB_NAME,getLibraryVersion:()=>ps.LIB_VERSION}}Kt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.Pl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}Pl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Ag=r({},wg,xg,kg,Sg,Cg,Mg,Tg,Ig,Eg,Rg,Pg,Og,Fg);Dp.__defaultExtensionClasses=r({},Ag),function(){ps.SDK_DIST_CHANNEL="cdn";var t=aa.posthog;if(!t||Ir(t._i)){var e=kp[Pp]=new Dp;if(t){var r=[];_s(t._i,(function(i){if(i&&Ir(i)){var n=e.init(i[0],i[1],i[2]),s=t[i[2]]||t;n.__loaded&&-1===r.indexOf(s)&&(r.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}}))}e.__SV=1,aa.posthog=e,function(){function t(){t.done||(t.done=!0,Op=!1,_s(kp,(function(t){t._dom_loaded()})))}null!=os&&os.addEventListener?"complete"===os.readyState?t():Ts(os,"DOMContentLoaded",t,{capture:!1}):is&&ms.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|