posthog-js 1.347.2 → 1.348.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +43 -1
- package/dist/module.full.d.ts +43 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +43 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +43 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.d.ts +2 -0
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/dist/src/extensions/conversations/external/index.d.ts +39 -1
- package/dist/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/dist/src/posthog-product-tours-types.d.ts +42 -0
- package/dist/surveys-preview.d.ts +2 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/lib/src/extensions/conversations/external/components/styles.js +189 -0
- package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/lib/src/extensions/conversations/external/components/utils.js +49 -0
- package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
- package/lib/src/extensions/conversations/external/index.d.ts +39 -1
- package/lib/src/extensions/conversations/external/index.js +253 -31
- package/lib/src/extensions/conversations/external/index.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/lib/src/extensions/product-tours/product-tours.js +78 -71
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/lib/src/posthog-product-tours-types.d.ts +42 -0
- package/lib/src/posthog-product-tours-types.js +43 -1
- package/lib/src/posthog-product-tours-types.js.map +1 -1
- package/lib/src/utils/product-tour-event-receiver.js +2 -1
- package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/react/dist/esm/index.js +25 -1
- package/react/dist/esm/index.js.map +1 -1
- package/react/dist/types/index.d.ts +4 -2
- package/react/dist/umd/index.js +25 -0
- package/react/dist/umd/index.js.map +1 -1
package/dist/module.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,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),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var s=f(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var s=i(V);if(","===s.slice(-1))s=Y(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Y(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var M=I(t.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,s=E in n?n[E]:n;if(new Uint32Array(s.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(u=I(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:R=!0}=e;E||(E=Q(t,o,a,void 0===E));var M,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;M=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:M});if(i.add(t,O),M===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(C(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},st={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ot={};function at(t){if(ot[t])return ot[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in st?st[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 ot[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ot[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var s=at(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ut[n]=o,o.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,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=vt.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=vt.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Mt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),jt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),Zt=(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))(Zt||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&qt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=vt.parentNode(n);if(s&&Pt(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removes,s,this.mirror)&&!this.movedSet.has(vt.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||Ut(this.removes,o,this.mirror)?Wt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=R(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(kt(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||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,s,o,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=jt.Mouse;break;case"touch":u=jt.Touch;break;case"pen":u=jt.Pen}u===jt.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):jt.Pen}else Tt(i)&&(u=jt.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===jt.Touch||l.startsWith("Mouse")&&u===jt.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",Jt(mt(Jt((t=>{var o=Qt(t);if(o&&!kt(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function se(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function oe(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:s,stylesheetManager:o}=t,a=null;a="#document"===e.nodeName?s.getId(e):s.getId(vt.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{o.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),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),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;s||(s=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),o,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),o=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=ne.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ne.set(t,i);var o=n.getId(t);Jt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Jt((t=>mt(Jt((s=>{var o=Qt(s);if(o&&!kt(o,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),s.media||500))),u=[ft("play",a(Zt.Play),o),ft("pause",a(Zt.Pause),o),ft("seeked",a(Zt.Seeked),o),ft("volumechange",a(Zt.VolumeChange),o),ft("ratechange",a(Zt.RateChange),o)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,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:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...se(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...se(e),o]}]}),t.apply(e,s)}))})})),Jt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=l,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,o)=>{var u,[l,h,c]=o;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=oe(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:se(e.parentRule)}),t.apply(e,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,o)=>{var a,[l]=o;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=oe(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:se(e.parentRule)}),t.apply(e,o)}))}),Jt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],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=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{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),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),s(),o(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),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);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=vt.shadowRoot(this);return s&&Pt(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var s=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,s,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,s,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));o.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(l)}};for(var l of a)u(l);return o}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this,a=Ce(r,i,n,!0),u=new Map,l=new Re;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=bt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:$t["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:$t["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Mt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function je(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Vt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var s,o=t;if(o.timestamp=wt(),!(null==(s=Kt[0])?void 0:s.isFrozen())||o.type===Lt.FullSnapshot||o.type===Lt.IncrementalSnapshot&&o.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(o),r);else if(P){var a={type:"rrweb",event:Z(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Lt.FullSnapshot)L=o,j=0;else if(o.type===Lt.IncrementalSnapshot){if(o.data.source===Dt.Mutation&&o.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&o.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Me({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Rt(t,Be)&&z.trackLinkElement(t),Nt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}je.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},je.freezePage=()=>{Kt.forEach((t=>t.freeze()))},je.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},je.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,Ze=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Ue?Ue[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 We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var s=Xe(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Je[n]=o,o.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in sr?sr[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 or?or[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 ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var s=ur(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(lr[n]=o,o.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),u=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,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=vr.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=vr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=vr.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Rr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Mr(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;s<i.children.length;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 Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var 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(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var a in e){var u=e[a];Array.isArray(u)?o[a]=Mr(u.length?u[0]:null):o[a]=u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,s=Nr.parse(i).map((t=>t.toString())),o=[Pr(r,n.stringifyOptions)];t({level:"error",trace:s,payload:o})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var s=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++o<n.lengthThreshold?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),jr=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),$r=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Zr(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var qr=["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"],Hr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return qr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Vr(t,e){return-1!==t.indexOf(e)}var zr=function(t){return t.trim()},Gr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Ur=Object.prototype,Wr=Ur.hasOwnProperty,Xr=Ur.toString,Jr=Yr||function(t){return"[object Array]"===Xr.call(t)},Kr=t=>"function"==typeof t,Qr=t=>Kr(t)&&-1!==t.toString().indexOf("[native code]"),ti=t=>t===Object(t)&&!Jr(t),ei=t=>{if(ti(t)){for(var e in t)if(Wr.call(t,e))return!1;return!0}return!1},ri=t=>void 0===t,ii=t=>"[object String]"==Xr.call(t),ni=t=>ii(t)&&0===t.trim().length,si=t=>null===t,oi=t=>ri(t)||si(t),ai=t=>"[object Number]"==Xr.call(t)&&t==t,ui=t=>ai(t)&&t>0,li=t=>"[object Boolean]"===Xr.call(t),hi=t=>t instanceof FormData,ci=t=>Vr($r,t);function di(t){return null===t||"object"!=typeof t}function vi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fi(t){return!ri(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var pi=[!0,"true",1,"1","yes"],gi=t=>Vr(pi,t),mi=[!1,"false",0,"0","no"];function yi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ai(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),yi(n||r,e,r,i))}class bi{constructor(t){this.C={},this.I=t.I,this.S=yi(t.bucketSize,0,100,t.k),this.A=yi(t.refillRate,0,this.S,t.k),this.T=yi(t.refillInterval,0,864e5,t.k)}R(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.T);if(i>0){var n=i*this.A;t.tokens=Math.min(t.tokens+n,this.S),t.lastAccess=t.lastAccess+i*this.T}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.R(n,r):(n={tokens:this.S,lastAccess:r},this.C[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}var wi="Mobile",_i="iOS",Ci="Android",Ii="Tablet",Si=Ci+" "+Ii,ki="iPad",xi="Apple",Ai=xi+" Watch",Ti="Safari",Ei="BlackBerry",Ri="Samsung",Ni=Ri+"Browser",Mi=Ri+" Internet",Fi="Chrome",Oi=Fi+" OS",Pi=Fi+" "+_i,Li="Internet Explorer",Di=Li+" "+wi,Bi="Opera",ji=Bi+" Mini",$i="Edge",Zi="Microsoft "+$i,qi="Firefox",Hi=qi+" "+_i,Vi="Nintendo",zi="PlayStation",Gi="Xbox",Yi=Ci+" "+wi,Ui=wi+" "+Ti,Wi="Windows",Xi=Wi+" Phone",Ji="Nokia",Ki="Ouya",Qi="Generic",tn=Qi+" "+wi.toLowerCase(),en=Qi+" "+Ii.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+nn),on=new RegExp(Gi,"i"),an=new RegExp(zi+" \\w+","i"),un=new RegExp(Vi+" \\w+","i"),ln=new RegExp(Ei+"|PlayBook|BB10","i"),hn={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var cn,dn,vn,fn=(t,e)=>e&&Vr(e,xi)||function(t){return Vr(t,Ti)&&!Vr(t,Fi)&&!Vr(t,Ci)}(t),pn=function(t,e){return e=e||"",Vr(t," OPR/")&&Vr(t,"Mini")?ji:Vr(t," OPR/")?Bi:ln.test(t)?Ei:Vr(t,"IE"+wi)||Vr(t,"WPDesktop")?Di:Vr(t,Ni)?Mi:Vr(t,$i)||Vr(t,"Edg/")?Zi:Vr(t,"FBIOS")?"Facebook "+wi:Vr(t,"UCWEB")||Vr(t,"UCBrowser")?"UC Browser":Vr(t,"CriOS")?Pi:Vr(t,"CrMo")||Vr(t,Fi)?Fi:Vr(t,Ci)&&Vr(t,Ti)?Yi:Vr(t,"FxiOS")?Hi:Vr(t.toLowerCase(),rn.toLowerCase())?rn:fn(t,e)?Vr(t,wi)?Ui:Ti:Vr(t,qi)?qi:Vr(t,"MSIE")||Vr(t,"Trident/")?Li:Vr(t,"Gecko")?qi:""},gn={[Di]:[new RegExp("rv:"+nn)],[Zi]:[new RegExp($i+"?\\/"+nn)],[Fi]:[new RegExp("("+Fi+"|CrMo)\\/"+nn)],[Pi]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[sn],[Ui]:[sn],[Bi]:[new RegExp("(Opera|OPR)\\/"+nn)],[qi]:[new RegExp(qi+"\\/"+nn)],[Hi]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Ei]:[new RegExp(Ei+" "+nn),sn],[Yi]:[new RegExp("android\\s"+nn,"i")],[Mi]:[new RegExp(Ni+"\\/"+nn)],[Li]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},mn=function(t,e){var r=pn(t,e),i=gn[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},yn=[[new RegExp(Gi+"; "+Gi+" (.*?)[);]","i"),t=>[Gi,t&&t[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp(zi,"i"),[zi,""]],[ln,[Ei,""]],[new RegExp(Wi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Xi,""];if(new RegExp(wi).test(e)&&!/IEMobile\b/.test(e))return[Wi+" "+wi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=hn[i]||"";return/arm/i.test(e)&&(n="RT"),[Wi,n]}return[Wi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[_i,e.join(".")]}return[_i,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ri(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ci+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ci+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ci,e.join(".")]}return[Ci,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Oi,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return un.test(t)?Vi:an.test(t)?zi:on.test(t)?Gi:new RegExp(Ki,"i").test(t)?Ki:new RegExp("("+Xi+"|WPDesktop)","i").test(t)?Xi:/iPad/.test(t)?ki:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ai:ln.test(t)?Ei:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ji,"i").test(t)?Ji:/(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(wi).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)?Ci:Si:new RegExp("(pda|"+wi+")","i").test(t)?tn:new RegExp(Ii,"i").test(t)&&!new RegExp(Ii+" pc","i").test(t)?en:""},wn=function(t){var e=bn(t);return e===ki||e===Si||"Kobo"===e||"Kindle Fire"===e||e===en?Ii:e===Vi||e===Gi||e===zi||e===Ki?"Console":e===Ai?"Wearable":e?wi:"Desktop"},_n=t=>t instanceof Error;function Cn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return vn&&r.length===dn||(dn=r.length,vn=r.reduce(((r,i)=>{cn||(cn={});var n=cn[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],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,cn[i]=[u,l];break}}return r}),{})),vn}}class In{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&&Jr(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(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Sn="?";function kn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Sn:r,in_app:!0};return ri(i)||(s.lineno=i),ri(n)||(s.colno=n),s}var xn=(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]:Sn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},An=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=(t,e)=>{var r=An.exec(t);if(r){var[,i,n,s]=r;return kn(e,i,Sn,+n,+s)}var o=Tn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=En.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=xn(o[1]||Sn,o[2]);return kn(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fn=(t,e)=>{var r=Nn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Sn;return[s,n]=xn(s,n),kn(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Pn=50;function Ln(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;a<o.length;a++){var u=o[a];if(!(u.length>1024)){var l=On.test(u)?u.replace(On,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){s.push(c);break}}if(s.length>=Pn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Pn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Sn});var i}))}(s)}}("web:javascript",Rn,Fn)}class Dn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ii(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 vi(t,"DOMException")}isDOMError(t){return vi(t,"DOMError")}}class Bn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class jn{constructor(){}match(t){return vi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var $n=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Zn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match($n);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Hn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class Vn{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 fi(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: "+Hn(t)}isSeverityLevel(t){return ii(t)&&!ni(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(_n(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 fi(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return di(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 Yn{match(t){return vi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return di(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(di(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Un="undefined"!=typeof window?window:void 0,Wn="undefined"!=typeof globalThis?globalThis:Un;"undefined"==typeof self&&(Wn.self=Wn),"undefined"==typeof File&&(Wn.File=function(){});var Xn=Array.prototype,Jn=Xn.forEach,Kn=Xn.indexOf,Qn=null==Wn?void 0:Wn.navigator,ts=null==Wn?void 0:Wn.document,es=null==Wn?void 0:Wn.location,rs=null==Wn?void 0:Wn.fetch,is=null!=Wn&&Wn.XMLHttpRequest&&"withCredentials"in new Wn.XMLHttpRequest?Wn.XMLHttpRequest:void 0,ns=null==Wn?void 0:Wn.AbortController,ss=null==Qn?void 0:Qn.userAgent,os=null!=Un?Un:{},as=()=>!!Un.Zone,us=t=>t instanceof Document,ls={DEBUG:!1,LIB_VERSION:"1.347.2"},hs=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={N:function(e){if(Un&&(ls.DEBUG||os.POSTHOG_DEBUG||r)&&!ri(Un.console)&&Un.console){for(var i=("__rrweb_original__"in Un.console[e]?Un.console[e].__rrweb_original__:Un.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(t,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>hs(t+" "+e,r)};return i},cs=hs("[PostHog.js]"),ds=cs.createLogger,vs={};function fs(t,e,r){if(Jr(t))if(Jn&&t.forEach===Jn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===vs)return}function ps(t,e,r){if(!oi(t)){if(Jr(t))return fs(t,e,r);if(hi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===vs)return}else for(var n in t)if(Wr.call(t,n)&&e.call(r,t[n],n)===vs)return}}var gs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},ms=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){fs(e,(function(e){t.push(e)}))})),t};function ys(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 bs=function(t){try{return t()}catch(t){return}},ws=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){cs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cs.critical(t)}}},_s=function(t){var e={};return ps(t,(function(t,r){(ii(t)&&t.length>0||ai(t))&&(e[r]=t)})),e};function Cs(t,e){return r=t,i=t=>ii(t)&&!si(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Jr(e)?(s=[],fs(e,(e=>{s.push(t(e))}))):(s={},ps(e,((e,r)=>{n.has(e)||(s[r]=t(e,r))}))),s);var s}(r);var r,i,n}var Is=["herokuapp.com","vercel.app","netlify.app"];function Ss(t){var e=null==t?void 0:t.hostname;if(!ii(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Is)if(r===i)return!1;return!0}function ks(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function xs(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var As=t=>{var e=null==ts?void 0:ts.createElement("a");return ri(e)?null:(e.href=t,e)},Ts=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ps(t,(function(t,e){ri(t)||ri(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)},Es=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Jr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Rs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],u=o[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Jr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=s&&(v+="#"+s),v},Ns=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Ms(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Fs(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Os="$people_distinct_id",Ps="__alias",Ls="__timers",Ds="$autocapture_disabled_server_side",Bs="$heatmaps_enabled_server_side",js="$exception_capture_enabled_server_side",$s="$error_tracking_suppression_rules",Zs="$error_tracking_capture_extension_exceptions",qs="$web_vitals_enabled_server_side",Hs="$dead_clicks_enabled_server_side",Vs="$product_tours_enabled_server_side",zs="$web_vitals_allowed_metrics",Gs="$session_recording_remote_config",Ys="$sesid",Us="$session_is_sampled",Ws="$enabled_feature_flags",Xs="$early_access_features",Js="$feature_flag_details",Ks="$stored_person_properties",Qs="$stored_group_properties",to="$surveys",eo="$flag_call_reported",ro="$feature_flag_errors",io="$user_state",no="$client_session_props",so="$capture_rate_limit",oo="$initial_campaign_params",ao="$initial_referrer_info",uo="$initial_person_info",lo="$epp",ho="__POSTHOG_TOOLBAR__",co="$posthog_cookieless",vo=[Os,Ps,"__cmpns",Ls,"$session_recording_enabled_server_side",Bs,Ys,Ws,$s,io,Xs,Js,Qs,Ks,to,eo,ro,no,so,oo,ao,lo,uo,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function fo(t){return t instanceof Element&&(t.id===ho||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function po(t){return!!t&&1===t.nodeType}function go(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mo(t){return!!t&&3===t.nodeType}function yo(t){return!!t&&11===t.nodeType}function bo(t){return t?zr(t).split(/\s+/):[]}function wo(t){var e=null==Un?void 0:Un.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function _o(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 bo(e)}function Co(t){return oi(t)?null:zr(t).split(/(\s+)/).filter((t=>Ho(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(t){var e="";return Po(t)&&!Lo(t)&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;mo(t)&&t.textContent&&(e+=null!==(r=Co(t.textContent))&&void 0!==r?r:"")})),zr(e)}function So(t){return ri(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ko=["a","button","form","input","select","textarea","label"];function xo(t,e){if(ri(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Ao(t){var e=t.parentNode;return!(!e||!po(e))&&e}var To=["next","previous","prev",">","<"],Eo=10;var Ro=[".ph-no-rageclick",".ph-no-capture"];function No(t,e){if(!Un||Mo(t))return!1;var r,i,n;li(e)?(r=!!e&&Ro,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ro,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Fo(t,!1);return!function(t,e){if(!1===t||ri(t))return!1;var r;if(!0===t)r=To;else{if(!Jr(t))return!1;if(t.length>Eo)return cs.error("[PostHog] content_ignorelist array cannot exceed "+Eo+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,s.map((t=>{var e;return{safeText:Io(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!xo(s,r)}var Mo=t=>!t||go(t,"html")||!po(t),Fo=(t,e)=>{if(!Un||Mo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!go(n,"body");)if(yo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Ao(n);if(!s)break;if(e||ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Un.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Oo(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!Un||Mo(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!wo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&wo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Fo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ri(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!xo(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Un.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ko.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Po(t){for(var e=t;e.parentNode&&!go(e,"body");e=e.parentNode){var r=_o(e);if(Vr(r,"ph-sensitive")||Vr(r,"ph-no-capture"))return!1}if(Vr(_o(t),"ph-include"))return!0;var i=t.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Lo(t){return!!(go(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||go(t,"select")||go(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Do="(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})",Bo=new RegExp("^(?:"+Do+")$"),jo=new RegExp(Do),$o="\\d{3}-?\\d{2}-?\\d{4}",Zo=new RegExp("^("+$o+")$"),qo=new RegExp("("+$o+")");function Ho(t,e){if(void 0===e&&(e=!0),oi(t))return!1;if(ii(t)){if(t=zr(t),(e?Bo:jo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Zo:qo).test(t))return!1}return!0}function Vo(t){var e=Io(t);return Ho(e=(e+" "+zo(t)).trim())?e:""}function zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Io(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+zo(t)).trim())}catch(t){cs.error("[AutoCapture]",t)}})),e}function Go(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var 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 ys(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Yo(e.toString())]=Yo(r.toString())})),n+=":",n+=ys(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Uo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ys(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Yo(t){return t.replace(/"|\\"/g,'\\"')}function Uo(t){var e=t.attr__class;return e?Jr(e)?e:bo(e):void 0}var Wo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xo=ds("[Recorder]"),Jo=t=>"navigation"===t.entryType,Ko=t=>"resource"===t.entryType;function Qo(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>oa({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=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>oa({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()}}function ta(t,e){return!!e&&(li(e)||e[t])}function ea(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(li(r))return!0;if(Jr(r))return s(r);var o=r[e];return li(o)?o:s(o)}function ra(t,e,r,i,n,s){return ia.apply(this,arguments)}function ia(){return ia=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Xo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ko(t)&&t.initiatorType===e&&(ri(i)||t.startTime>=i)&&(ri(n)||t.startTime<=n)));return o||(yield new Promise((t=>setTimeout(t,50*s))),ra(t,e,r,i,n,s+1))})),ia.apply(this,arguments)}function na(t){var{body:e,options:r,url:i}=t;if(oi(e))return null;var{hostname:n,isHostDenied:s}=Fs(i,r);if(s)return n+" is in deny list";if(ii(e))return e;if(us(e))return e.textContent;if(hi(e))return Ts(e);if(ti(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 sa=t=>!si(t)&&("navigation"===t.entryType||"resource"===t.entryType);function oa(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(sa(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var aa=["video/","audio/"];function ua(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function la(){return la=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Fs(i,r);return s?Promise.resolve(n+" is in deny list"):ua(e)})),la.apply(this,arguments)}function ha(){return ha=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=aa.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Fs(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return si(n)?ua(e):Promise.resolve(n)})),ha.apply(this,arguments)}function ca(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ta("request",i.recordHeaders),s=ta("response",i.recordHeaders),o=Ms(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),ea({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return la.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield o(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),ea({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ha.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{ra(r,"fetch",c.url,l,h).then((e=>{var r,i=oa({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}var da=null;function va(t,e,i){if(!("performance"in e))return()=>{};if(da)return Xo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Wo,i):Wo,s=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},o=Qo(s,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ta("request",r.recordHeaders),n=ta("response",r.recordHeaders),s=Ms(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,u,l,h){void 0===u&&(u=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=na({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=na({body:v.response,options:r,url:a})),ra(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=oa({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),u,l,h)}));return()=>{s()}}(s,e,n),u=ca(s,e,n)),da=()=>{o(),a(),u(),da=null}}var fa=t=>({name:"rrweb/network@1",observer:va,options:t});os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:fa},os.__PosthogExtensions__.rrweb={record:je,version:"v2"},os.rrweb={record:je,version:"v2"},os.rrwebConsoleRecord={getRecordConsolePlugin:Br},os.getRecordNetworkPlugin=fa;var pa,ga,ma,ya,ba,wa,_a,Ca,Ia,Sa,ka,xa,Aa={},Ta=[],Ea=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ra=Array.isArray;function Na(t,e){for(var r in e)t[r]=e[r];return t}function Ma(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(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?pa.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 Oa(t,o,i,n,null)}function Oa(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?++ma:n,__i:-1,__u:0};return null==n&&null!=ga.vnode&&ga.vnode(s),s}function Pa(t){return t.children}function La(t,e){this.props=t,this.context=e}function Da(t,e){if(null==e)return t.__?Da(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Da(t):null}function Ba(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ba(t)}}function ja(t){(!t.__d&&(t.__d=!0)&&ya.push(t)&&!$.__r++||ba!=ga.debounceRendering)&&((ba=ga.debounceRendering)||wa)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ya.length;)ya.length>a&&ya.sort(_a),t=ya.shift(),a=ya.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Na({},i)).__v=i.__v+1,ga.vnode&&ga.vnode(r),Ga(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Da(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ua(s,r,o),i.__e=i.__=null,r.__e!=n&&Ba(r)));$.__r=0}function $a(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Ta,b=e.length;for(u=function(t,e,r,i,n){var s,o,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;s<n;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]=Oa(null,o,null,null,null):Ra(o)?o=t.__k[s]=Oa(Pa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Oa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(l=o.__i=qa(o,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<h;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ja(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Aa:y[v.__i]||Aa,v.__i=c,g=Ga(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Za(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Za(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=t,e=Za(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Da(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,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||s<e.length;)if(null!=(l=e[o=n>=0?n--:s++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function Ha(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ea.test(e)?r:r+"px"}function Va(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||Ha(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ha(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ca,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=Ia,t.addEventListener(e,s?ka:Sa,s)):t.removeEventListener(e,s?ka:Sa,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 za(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ia++;else if(e.t<r.u)return;return r(ga.event?ga.event(e):e)}}}function Ga(t,e,r,i,n,s,o,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ga.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new La(m,w),c.constructor=x,c.render=Ka),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Na({},c.__s)),Na(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),$=0;$<c._sb.length;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ga.__r,C=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++C<25);c.state=c.__s,null!=c.getChildContext&&(i=Na(Na({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Pa&&null==h.key&&(S=Wa(h.props.children)),a=$a(t,Ra(S)?S:[S],e,r,i,n,s,o,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=s)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(k=s.length;k--;)Ma(s[k]);Ya(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ya(e);ga.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,u){var l,h,c,d,v,f,p,g=r.props||Aa,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(l=0;l<s.length;l++)if((v=s[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ga.__m&&ga.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&pa.call(t.childNodes),!a&&null!=s)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Va(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Va(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),$a("template"==e.type?t.content:t,Ra(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Da(r,0),a,u),null!=s)for(l=s.length;l--;)Ma(s[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Va(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Va(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ga.diffed)&&h(e),128&e.__u?void 0:a}function Ya(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ya)}function Ua(t,e,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);ga.__c&&ga.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ga.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ra(t)?t.map(Wa):Na({},t)}function Xa(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){ga.__e(t,r)}}function Ja(t,e,r){var i,n;if(ga.unmount&&ga.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ga.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ja(i[n],e,r||"function"!=typeof t.type);r||Ma(t.__e),t.__c=t.__=t.__e=void 0}function Ka(t,e,r){return this.constructor(t,r)}function Qa(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ga.__&&ga.__(t,e),i=!1?null:e.__k,n=[],s=[],Ga(e,t=e.__k=Fa(Pa,null,[t]),i||Aa,Aa,e.namespaceURI,i?null:e.firstChild?pa.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,s),Ua(n,t,s)}function tu(t,e,r){var i,n,s,o,a=Na({},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?pa.call(arguments,2):r),Oa(t.type,a,i||t.key,n||t.ref,null)}pa=Ta.slice,ga={__e:function(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}},ma=0,La.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Na({},this.state),"function"==typeof t&&(t=t(Na({},r),this.props)),t&&Na(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),ja(this))},La.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ja(this))},La.prototype.render=Pa,ya=[],wa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_a=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ca=/(PointerCapture)$|Capture$/i,Ia=0,Sa=za(!1),ka=za(!0),xa=0;var eu,ru,iu,nu,su=0,ou=[],au=ga,uu=au.__b,lu=au.__r,hu=au.diffed,cu=au.__c,du=au.unmount,vu=au.__;function fu(t,e){au.__h&&au.__h(ru,t,su||e),su=0;var r=ru.__H||(ru.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function pu(t){return su=1,function(t,e,r){var i=fu(eu++,2);if(i.t=t,!i.__c&&(i.__=[xu(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=ru,!ru.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};ru.__f=!0;var s=ru.shouldComponentUpdate,o=ru.componentWillUpdate;ru.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)},ru.shouldComponentUpdate=n}return i.__N||i.__}(xu,t)}function gu(t,e){var r=fu(eu++,3);!au.__s&&ku(r.__H,e)&&(r.__=t,r.u=e,ru.__H.__h.push(r))}function mu(t){return su=5,yu((function(){return{current:t}}),[])}function yu(t,e){var r=fu(eu++,7);return ku(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function bu(t){var e=ru.context[t.__c],r=fu(eu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(ru)),e.props.value):t.__}function wu(){for(var t;t=ou.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Iu),t.__H.__h.forEach(Su),t.__H.__h=[]}catch(e){t.__H.__h=[],au.__e(e,t.__v)}}au.__b=function(t){ru=null,uu&&uu(t)},au.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vu&&vu(t,e)},au.__r=function(t){lu&&lu(t),eu=0;var e=(ru=t.__c).__H;e&&(iu===ru?(e.__h=[],ru.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Iu),e.__h.forEach(Su),e.__h=[],eu=0)),iu=ru},au.diffed=function(t){hu&&hu(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==ou.push(e)&&nu===au.requestAnimationFrame||((nu=au.requestAnimationFrame)||Cu)(wu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),iu=ru=null},au.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Iu),t.__h=t.__h.filter((function(t){return!t.__||Su(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],au.__e(r,t.__v)}})),cu&&cu(t,e)},au.unmount=function(t){du&&du(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Iu(t)}catch(t){e=t}})),r.__H=void 0,e&&au.__e(e,r.__v))};var _u="function"==typeof requestAnimationFrame;function Cu(t){var e,r=function(){clearTimeout(i),_u&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);_u&&(e=requestAnimationFrame(r))}function Iu(t){var e=ru,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),ru=e}function Su(t){var e=ru;t.__c=t.__(),ru=e}function ku(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function xu(t,e){return"function"==typeof e?e(t):e}var Au=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Tu=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Eu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Ru=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Nu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Mu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Fu=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Ou=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Pu=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Lu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Du=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Bu=ds("[Surveys]");function ju(t){return!(!t.start_date||t.end_date)}function $u(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Zu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var qu="seenSurvey_",Hu="inProgressSurvey_",Vu=(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},zu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Gu=t=>zu(qu,t),Yu=t=>{localStorage.getItem(Gu(t))||localStorage.setItem(Gu(t),"true")},Uu=[Nu.Popover,Nu.Widget,Nu.API],Wu={ignoreConditions:!1,ignoreDelay:!1,displayType:Du.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ai(t)&&isFinite(t)&&Math.floor(t)===t});var Xu="0123456789abcdef";class Ju{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Ju(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Xu.charAt(this.bytes[e]>>>4)+Xu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Ju(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ku{constructor(){this.M=0,this.F=0,this.O=new el}generate(){var t=this.generateOrAbort();if(ri(t)){this.M=0;var e=this.generateOrAbort();if(ri(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.M)this.M=t,this.D();else{if(!(t+1e4>this.M))return;this.F++,this.F>4398046511103&&(this.M++,this.D())}return Ju.fromFieldsV7(this.M,Math.trunc(this.F/Math.pow(2,30)),this.F&Math.pow(2,30)-1,this.O.nextUint32())}D(){this.F=1024*this.O.nextUint32()+(1023&this.O.nextUint32())}}var Qu,tl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Un&&!ri(Un.crypto)&&crypto.getRandomValues&&(tl=t=>crypto.getRandomValues(t));class el{constructor(){this.B=new Uint32Array(8),this.j=1/0}nextUint32(){return this.j>=this.B.length&&(tl(this.B),this.j=0),this.B[this.j++]}}var rl=()=>il().toString(),il=()=>(Qu||(Qu=new Ku)).generate(),nl=["fatal","error","warning","log","info","debug"],sl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ol=Uint8Array,al=Uint16Array,ul=Uint32Array,ll=new ol([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]),hl=new ol([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]),cl=new ol([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dl=function(t,e){for(var r=new al(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new ul(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},vl=dl(ll,2),fl=vl[0],pl=vl[1];fl[28]=258,pl[258]=28;for(var gl=dl(hl,0)[1],ml=new al(32768),yl=0;yl<32768;++yl){var bl=(43690&yl)>>>1|(21845&yl)<<1;bl=(61680&(bl=(52428&bl)>>>2|(13107&bl)<<2))>>>4|(3855&bl)<<4,ml[yl]=((65280&bl)>>>8|(255&bl)<<8)>>>1}var wl=function(t,e,r){for(var i=t.length,n=0,s=new al(e);n<i;++n)++s[t[n]-1];var o,a=new al(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new al(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[ml[c]>>>u]=l}else for(o=new al(i),n=0;n<i;++n)o[n]=ml[a[t[n]-1]++]>>>15-t[n];return o},_l=new ol(288);for(yl=0;yl<144;++yl)_l[yl]=8;for(yl=144;yl<256;++yl)_l[yl]=9;for(yl=256;yl<280;++yl)_l[yl]=7;for(yl=280;yl<288;++yl)_l[yl]=8;var Cl=new ol(32);for(yl=0;yl<32;++yl)Cl[yl]=5;var Il=wl(_l,9,0),Sl=wl(Cl,5,0),kl=function(t){return(t/8>>0)+(7&t&&1)},xl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof al?al:t instanceof ul?ul:ol)(r-e);return i.set(t.subarray(e,r)),i},Al=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Tl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},El=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new ol(0),0];if(1==n){var o=new ol(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],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;i<n;++i)s[i].s>d&&(d=s[i].s);var v=new al(d+1),f=Rl(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}));i<n;++i){var y=s[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new ol(v),f]},Rl=function(t,e,r){return-1==t.s?Math.max(Rl(t.l,e,r+1),Rl(t.r,e,r+1)):e[t.s]=r},Nl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new al(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;a<=e;++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]},Ml=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Fl=function(t,e,r){var i=r.length,n=kl(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;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Ol=function(t,e,r,i,n,s,o,a,u,l,h){Al(e,h++,r),++n[256];for(var c=El(n,15),d=c[0],v=c[1],f=El(s,15),p=f[0],g=f[1],m=Nl(d),y=m[0],b=m[1],w=Nl(p),_=w[0],C=w[1],I=new al(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=El(I,7),x=k[0],A=k[1],T=19;T>4&&!x[cl[T-1]];--T);var E,R,N,M,F=l+5<<3,O=Ml(n,_l)+Ml(s,Cl)+o,P=Ml(n,d)+Ml(s,p)+o+14+3*T+Ml(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Fl(e,h,t.subarray(u,u+l));if(Al(e,h,1+(P<O)),h+=2,P<O){E=wl(d,v,0),R=d,N=wl(p,g,0),M=p;var L=wl(x,A,0);Al(e,h,b-257),Al(e,h+5,C-1),Al(e,h+10,T-4),h+=14;for(S=0;S<T;++S)Al(e,h+3*S,x[cl[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];Al(e,h,L[Z]),h+=x[Z],Z>15&&(Al(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=Il,R=_l,N=Sl,M=Cl;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;Tl(e,h,E[Z+257]),h+=R[Z+257],Z>7&&(Al(e,h,i[S]>>>23&31),h+=ll[Z]);var q=31&i[S];Tl(e,h,N[q]),h+=M[q],q>3&&(Tl(e,h,i[S]>>>5&8191),h+=hl[q])}else Tl(e,h,E[i[S]]),h+=R[i[S]];return Tl(e,h,E[256]),h+R[256]},Pl=new ul([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ll=function(){for(var t=new ul(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Dl=function(t,e,r,i,n){return function(t,e,r,i,n,s){var o=t.length,a=new ol(i+o+5*(1+Math.floor(o/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c<o?l=Fl(u,l,t.subarray(h,c)):(u[h]=s,l=Fl(u,l,t.subarray(h,o)))}else{for(var d=Pl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new al(32768),m=new al(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new ul(25e3),C=new al(288),I=new al(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<o;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,A<=h){var M=o-h;if((S>7e3||x>24576)&&M>423){l=Ol(t,u,0,_,C,I,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),Z=Math.min(258,M);D<=j&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|pl[O]<<18|gl[P];var Y=31&pl[O],U=31&gl[P];k+=ll[Y]+hl[U],++C[257+Y],++I[U],A=h+O,++S}else _[x++]=t[h],++C[t[h]]}}l=Ol(t,u,s,_,C,I,k,x,T,h-T,l)}return xl(a,0,i+kl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Bl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function jl(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Ll[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Dl(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),s=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Bl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Bl(n,s-8,r.d()),Bl(n,s-4,i),n}var $l=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=t.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),si(a)||(r>e&&(s+=t.substring(e,r)),s+=a,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},Zl=!!is||!!rs,ql="text/plain",Hl=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],l=Ts(a);return l&&u.push(l),s+"?"+u.join("&")},Vl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),zl=t=>{var{data:e,compression:r}=t;if(e){if(r===sl.GZipJS){var i=jl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new ol(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;o<r;++o){if(n+5>i.length){var a=new ol(n+8+(r-o<<1));a.set(i),i=a}var u=t.charCodeAt(o);u<128||e?s(u):u<2048?(s(192|u>>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return xl(i,0,n)}(Vl(e)),{mtime:0}),n=new Blob([i],{type:ql});return{contentType:ql,body:n,estimatedSize:n.size}}if(r===sl.Base64){var s=function(t){var e,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=$l(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,h[u++]=o.charAt(e)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Vl(e)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:Vl(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Vl(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Gl=[];rs&&Gl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=zl(t))&&void 0!==e?e:{},a=new Headers;ps(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(ns){var h=new ns;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}rs(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(o||0)<52428.8,body:s,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){cs.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{cs.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),is&&Gl.push({transport:"XHR",method:t=>{var e,r=new is;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=zl(t))&&void 0!==e?e:{};ps(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&Gl.push({transport:"sendBeacon",method:t=>{var e=Hl(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=zl(t))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(e,s)}catch(t){}}});var Yl=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 Ul(t,e,r){return Vl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Wl={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=>Yl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Yl(e,t))))),icontains:(t,e)=>e.map(Xl).some((e=>t.map(Xl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Xl).every((e=>t.map(Xl).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)))}))},Xl=t=>t.toLowerCase();function Jl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ri(n)||si(n))return!1;var s=[String(n)],o=Wl[i.operator];return!!o&&o(i.values,s)}))}var Kl=ds("[Stylesheet Loader]"),Ql=Un,th=ts;function eh(t){return"$survey_response_"+t}var rh="#020617",ih={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:Eu.Right,widgetType:Tu.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:rh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function nh(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 sh(t){var e;void 0===t&&(t=ih.backgroundColor),"#"===t[0]&&(e=nh(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=nh(r)),!e)return rh;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?rh:"white"}return rh}function oh(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Kl.error("prepare_external_dependency_stylesheet returned null"),null)})(th,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var ah=(t,e,i)=>{var n=Th(t),s=th.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=th.createElement("div");((t,e,i)=>{var n=r({},ih,i),s=t.style,o=![Eu.Center,Eu.Left,Eu.Right].includes(n.position)||e===Nu.Widget&&(null==i?void 0:i.widgetType)===Tu.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)||sh(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",sh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||sh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",sh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),s.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||sh(u);s.setProperty("--ph-survey-input-text-color",l),s.setProperty("--ph-survey-rating-text-color",l),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"}),u=oh(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return th.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},uh=(t,e)=>{if(!e)return null;var r=t[eh(e)];return Jr(r)?[...r]:r},lh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=t;s?(Yu(i),s.capture(Pu.SENT,r({[Lu.SURVEY_NAME]:i.name,[Lu.SURVEY_ID]:i.id,[Lu.SURVEY_ITERATION]:i.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Lu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:uh(e,t.id)}))),[Lu.SURVEY_SUBMISSION_ID]:n,[Lu.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,a,{$set:{[Vu(i,"responded")]:!0}})),o&&(Ql.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Ah(i))):Bu.error("[survey sent] event not captured, PostHog instance not found.")},hh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!oi(t))).length>0,ch=(t,e,i)=>r({[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Lu.SURVEY_PARTIALLY_COMPLETED]:hh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Lu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Lu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:uh((null==e?void 0:e.responses)||{},t.id)})))}),dh=(t,e,i)=>{if(e){if(!i){var n=kh(t);e.capture(Pu.DISMISSED,r({},ch(t,n,e),{$set:{[Vu(t,"dismissed")]:!0}})),Ah(t),Yu(t),Ql.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bu.error("[survey dismissed] event not captured, PostHog instance not found.")},vh=(t,e)=>{if(e){var r=(t=>zu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=kh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Pu.ABANDONED,ch(t,i,e),{transport:"sendBeacon"})}}else Bu.error("[survey abandoned] event not captured, PostHog instance not found.")},fh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),ph=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,gh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?ph(t.questions,fh(t.questions)):t.questions,mh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===Ou.Always||xh(t)},yh=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,ja(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:()=>{},surveySubmissionId:"",properties:void 0}),bh=()=>bu(yh),wh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return tu(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function _h(t){return null!=t?t:"icontains"}function Ch(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Ql||null==(r=Ql.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=_h(null==(i=t.conditions)?void 0:i.urlMatchType);return Wl[o](s,[n])}var Ih=t=>{var e=""+Hu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Hu+t.id+"_"+t.current_iteration),e},Sh=(t,e)=>{try{localStorage.setItem(Ih(t),JSON.stringify(e))}catch(t){Bu.error("Error setting in-progress survey state in localStorage",t)}},kh=t=>{try{var e=localStorage.getItem(Ih(t));if(e)return JSON.parse(e)}catch(t){Bu.error("Error getting in-progress survey state from localStorage",t)}return null},xh=t=>{var e=kh(t);return!oi(null==e?void 0:e.surveySubmissionId)},Ah=t=>{try{localStorage.removeItem(Ih(t))}catch(t){Bu.error("Error clearing in-progress survey state from localStorage",t)}};function Th(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Eh(t,e,r){if(void 0===e&&(e=Eu.Right),t===Nu.ExternalSurvey)return{};switch(e){case Eu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Eu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Eu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Eu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Eu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Eu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Eu.Left:return{left:"30px"};case Eu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Eu.Right:return{right:t===Nu.Widget&&r===Tu.Tab?"60px":"30px"}}}var Rh=0;function Nh(t,e,r,i,n,s){e||(e={});var o,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?o=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return ga.vnode&&ga.vnode(l),l}var Mh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Fh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Oh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Ph=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Lh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Dh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Nh("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"})}),Bh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Nh("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"})}),jh=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Nh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Nh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Nh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]})},$h=Nh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Nh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Nh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Nh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Nh("g",{mask:"url(#mask0_2415_6911)",children:[Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"})]})]}),Nh("defs",{children:Nh("clipPath",{id:"clip0_2415_6911",children:Nh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Zh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Nh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",$h]})}function qh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=bu(yh);return Nh("div",{className:"bottom-section",children:[!a&&Nh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Un||Un.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Nh(Zh,{urlParams:{utm_source:"survey-footer"}})]})}function Hh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Nh("div",{class:"question-header",children:[Nh(e.type===Mu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&wh({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vh(t){var{onClick:e}=t,{isPreviewMode:r}=bu(yh);return Nh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:jh({fill:"black"})})}Nh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Nh("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 zh=Un;function Gh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=bu(yh);return gu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return xs(zh,"keydown",t),()=>{zh.removeEventListener("keydown",t)}}),[o]),Nh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Nh(Vh,{onClick:()=>o()}),Nh("h3",{className:"thank-you-message-header",children:e}),r&&wh({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Nh(qh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Yh=t=>Jr(t)&&t.every((t=>ii(t)));function Uh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=bh(),l=mu(null),[h,c]=pu((()=>ii(a)?a:""));gu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+o,v=yu((()=>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 jr.MinLength:if(void 0!==o.value&&s.length<o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case jr.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Zr(e.validation,jr.MinLength),p=Zr(e.validation,jr.MaxLength),g=yu((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:e,forceDisableHtml:r,htmlFor:d}),Nh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h}),g&&Nh("div",{className:"validation-hint",children:g})]}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:()=>{v||n(h.trim())},onPreviewSubmit:()=>{v||s(h.trim())}})]})}function Wh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Nh(Pa,{children:[Nh("div",{className:"question-container",children:Nh(Hh,{question:e,forceDisableHtml:r})}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Xh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=pu((()=>ai(u)?u:Jr(u)&&u.length>0&&ai(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ai(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=bh(),p=t=>f?a(t):o(t);return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:r,forceDisableHtml:i}),Nh("div",{className:"rating-section",children:[Nh("div",{className:"rating-options",children:["emoji"===r.display&&Nh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=rc[r.scale])?void 0:e.map(((t,e)=>Nh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick:()=>{var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Nh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:ic(r.scale).map(((t,e)=>Nh(Jh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Nh("div",{className:"rating-text",children:[Nh("div",{children:r.lowerBoundLabel}),Nh("div",{children:r.upperBoundLabel})]})]})]}),Nh(qh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:si(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Jh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Nh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Kh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=mu(null),h=yu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=ph(e,fh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=pu((()=>((t,e)=>ii(t)||Yh(t)?t:e===Mu.SingleChoice?null:[])(u,e.type))),[v,f]=pu((()=>((t,e)=>{if(ii(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Yh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=bh(),g=e.type===Mu.SingleChoice,m=e.type===Mu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&Jr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!si(c)||(!(!Jr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Jr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:e,forceDisableHtml:i}),Nh("fieldset",{className:"multiple-choice-options limit-height",children:[Nh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:Jr(c)&&c.includes(t);return Nh("label",{className:i?"choice-option-open":"",children:[Nh("div",{className:"response-choice",children:[Nh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Nh("span",{children:i?t+":":t})]}),i&&Nh("input",{type:"text",ref:l,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:s,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Qh=[1,2,3,4,5],tc=[1,2,3,4,5,6,7],ec=[0,1,2,3,4,5,6,7,8,9,10],rc={2:[Dh,Bh],3:[Oh,Fh,Mh],5:[Ph,Oh,Fh,Mh,Lh]};function ic(t){switch(t){case 5:default:return Qh;case 7:return tc;case 10:return ec}}var nc=ds("[Surveys]");function sc(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?Fu.End:s;if(n.branching.type===Fu.End)return Fu.End;if(n.branching.type===Fu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Fu.ResponseBased){if(n.type===Mu.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 u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Fu.End?Fu.End:s}}else if(n.type===Mu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Fu.End?Fu.End:s}}return s}return nc.warn("Falling back to next question index due to unexpected branching type"),s}var oc=Un,ac=ts,uc="ph:show_survey_widget",lc="PHWidgetSurveyClickListener",hc=250,cc=20,dc=12;function vc(t,e){try{var r=t.getBoundingClientRect(),i=oc.innerHeight,n=oc.innerWidth,s=hc,o=r.left+r.width/2-e/2;o+e>n-cc&&(o=n-e-cc),o<cc&&(o=cc);var a=dc,u=i-r.bottom,l=r.top,h=u<s&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:ih.zIndex}}catch(t){return Bu.warn("Failed to calculate trigger position:",t),null}}class fc{constructor(t){var e=this;this.$=new Map,this.Z=new Map,this.q=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(to);if(t)for(var e of t)xh(e)&&vh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=null!=e&&e.position||null!=e&&e.selector?r({},t,{appearance:r({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.H(a.id);var{properties:u,initialResponses:l}=null!=e?e:{},h=!!(l&&Object.keys(l).length>0)&&this.V(a,l,u);if(!h||null!=(i=a.appearance)&&i.displayThankYouMessage){this.G(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Eu.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var d,v=ac.querySelector(a.appearance.widgetSelector);if(v)c=vc(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||ih.maxWidth))||{}}var f=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:p}=ah(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Y,properties:u,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(f<=0)return Qa(Nh(yc,r({},g)),p);var m=setTimeout((()=>{if(this.$.delete(a.id),!Ch(a))return this.Y(a);Qa(Nh(yc,r({},g,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.$.set(a.id,m)}},this.U=t=>{var{shadow:e,isNewlyCreated:r}=ah(t,this._posthog);r&&Qa(Nh(wc,{posthog:this._posthog,survey:t},t.id),e)},this.W=t=>{this.X(t);var e=this.Z.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(lc),this.Z.delete(t.id),Bu.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=ac.querySelector(e),i=this.Z.get(t.id);if(r){if(this.U(t),i){if(r===i.element)return;Bu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.W(t)}if(!r.hasAttribute(lc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Eu.NextToTrigger?vc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ih.maxWidth)):{};oc.dispatchEvent(new CustomEvent(uc,{detail:{surveyId:t.id,position:n}}))};xs(r,"click",n),r.setAttribute(lc,"true"),this.Z.set(t.id,{element:r,listener:n,survey:t}),Bu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.W(t)},this.renderPopover=t=>{var{shadow:e}=ah(t,this._posthog);Qa(Nh(yc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.K(t),Qa(Nh(yc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.tt(t)&&e.et(t)&&e.rt(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Nu.Popover||t.type===Nu.Widget)),i=e.it(r),n=new Set;i.forEach((t=>{if(t.type===Nu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===Tu.Tab)return void e.U(t);if((null==(i=t.appearance)?void 0:i.widgetType)===Tu.Selector&&null!=(s=t.appearance)&&s.widgetSelector)n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector)}si(e.nt)&&t.type===Nu.Popover&&e.handlePopoverSurvey(t)})),e.Z.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.W(r)}))}),t)},this.G=t=>{si(this.nt)||Bu.error("Survey "+this.nt+" already in focus. Cannot add survey "+t.id+"."),this.nt=t.id},this.Y=t=>{this.nt!==t.id&&Bu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.H(t.id),this.nt=null,this.X(t)},this._posthog=t,this.nt=null}H(t){var e=this.$.get(t);e&&(clearTimeout(e),this.$.delete(t))}cancelSurvey(t){this.$.has(t)&&(Bu.info("Cancelled pending survey "+t),this.H(t),this.nt===t&&(this.nt=null))}it(t){return t.sort(((t,e)=>{var r,i,n=xh(t),s=xh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Ou.Always,a=e.schedule===Ou.Always;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)}))}K(t){if(!this.q.has(t.id)){var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!ri(a)){var u=decodeURIComponent(o),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(oc.location.search);if(0!==Object.keys(e).length){Bu.info("[Survey Prefill] Detected URL prefill parameters");var r=this.st(t,e);if(r){var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;(Object.keys(o).length>0&&t.enable_partial_responses||s)&&lh({responses:s?i:o,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this.q.add(t.id)}}}}V(t,e,r){var i={};for(var[n,s]of Object.entries(e)){i[parseInt(n)]=Jr(s)?s.map(String):[String(s)]}Bu.info("[Survey] Processing initial responses");var o=this.st(t,i);if(!o)return!1;var{responses:a,submissionId:u,isSurveyCompleted:l}=o;return lh({responses:a,survey:t,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}st(t,e){try{var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=eh(t.id);try{switch(t.type){case Mu.SingleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=t.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Mu.MultipleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case Mu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void cs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:cs.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){cs.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return Bu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=rl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;i<t.questions.length&&0<s&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=eh(o.id);ri(r[a])||(n[a]=r[a])}var u=sc(t,i,o.id?r[eh(o.id)]:null);if(u===Fu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=s>=t.questions.length;return Sh(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Bu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(t){return Bu.error("[Survey Prefill] Error handling prefill:",t),null}}ot(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}tt(t){return!t.conditions||Ch(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!ss)return!1;var n=wn(ss);return Wl[_h(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==th||!th.querySelector(t.conditions.selector))}(t)}ut(t){return mh(t)||this.ot(t.internal_targeting_flag_key)||xh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!ju(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Uu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.ot(t.linked_flag_key,n)?this.ot(t.targeting_flag_key)?this.ut(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Gu(t))&&!mh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}et(t){var e;if(!$u(t)&&!Zu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}rt(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ot(r)}))}X(t){try{var e=ac.querySelector(Th(t,!0));null!=e&&e.shadowRoot&&Qa(null,e.shadowRoot),null==e||e.remove()}catch(e){Bu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.nt,surveyTimeouts:this.$,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.it,checkFlags:this.rt.bind(this),isSurveyFeatureFlagEnabled:this.ot.bind(this)}}}function pc(t,e){if(ac&&oc){var r,i=new fc(t);if(t.config.disable_surveys_automatic_display)return Bu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Bu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),xs(ac,"visibilitychange",(()=>{ac.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function gc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;gu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Nu.Widget,s=Ch(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===Tu.Tab&&n;if(!s)return Bu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Bu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};xs(oc,"popstate",s),xs(oc,"hashchange",s);var o=oc.history.pushState,a=oc.history.replaceState;return oc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e),s()},oc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{oc.removeEventListener("popstate",s),oc.removeEventListener("hashchange",s),oc.history.pushState=o,oc.history.replaceState=a}}}),[n,e,r,i])}function mc(t){switch(void 0===t&&(t=Ru.Right),t){case Ru.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ru.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ru.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Ru.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function yc(t){var e,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=mu(null),C=Number.isInteger(d),I=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,r,i,n,s,o,a){var[u,l]=pu(i||0===r||t.type===Nu.ExternalSurvey),[h,c]=pu(!1),d=()=>{var e=()=>{s&&n(t),l(!1)};ac.startViewTransition?ac.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return gu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{Ch(t)&&(l(!0),oc.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Pu.SHOWN,{[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(xs(oc,"PHSurveyClosed",v),xs(oc,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),oc.removeEventListener("PHSurveyClosed",v),oc.removeEventListener("PHSurveySent",n)}}return s(),()=>{oc.removeEventListener("PHSurveyClosed",v),oc.removeEventListener("PHSurveySent",n)}}}else Bu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),gc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:u,isSurveySent:h,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(u,h,I,C,v,f,_,w),A=k||d===u.questions.length||!0===b,T=yu((()=>{var t=kh(u);return{isPreviewMode:C,previewPageIndex:d,onPopupSurveyDismissed:()=>{dh(u,h,C),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||rl(),onPreviewSubmit:p,posthog:h,properties:y}}),[C,d,f,h,u,g,p,y]);return S?Nh(yh.Provider,{value:T,children:Nh("div",{className:"ph-survey",style:r({},Eh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:_,children:A?Nh(Gh,{header:(null==(s=u.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||ih,onClose:()=>{x(),m()}}):Nh(bc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function bc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=pu((()=>{var t=kh(i);return null!=t&&t.responses&&Bu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=bu(yh),[p,g]=pu((()=>{var t=kh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=yu((()=>gh(i)),[i]);gu((()=>{v&&!ri(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Nh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Nh(Vh,{onClick:()=>{l()}}),Nh("div",{className:"survey-box",children:_c({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||ih,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=eh(u),h=r({},o,{[l]:e});a(h);var c=sc(i,n,e),v=c===Fu.End;v||(g(c),Sh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&lh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f})}else Bu.error("onNextButtonClick called without a questionId.");else Bu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?o[eh(y.id)]:void 0})})]}):null}function wc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=pu(!0),[f,p]=pu(!1),[g,m]=pu({}),y=()=>{p(!f)};if(gu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Bu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return xs(oc,uc,e),()=>{oc.removeEventListener(uc,e)}}}else Bu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),gc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Ou.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Nh(Pa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Nh("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===Ru.Top?"widget-tab-top":""),onClick:y,disabled:c,style:mc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Nh(yc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var _c=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:s,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{o(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Mu.Open:return Fa(Uh,r({},l,{question:e,key:e.id}));case Mu.Link:return Fa(Wh,r({},l,{question:e,key:e.id}));case Mu.Rating:return Fa(Xh,r({},l,{question:e,key:e.id}));case Mu.SingleChoice:case Mu.MultipleChoice:return Fa(Kh,r({},l,{question:e,key:e.id}));default:return Bu.error("Unsupported question type: "+e.type),null}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.generateSurveys=pc,os.extendPostHogWithSurveys=pc;class Cc{emit(t){}}var Ic=new Cc;var Sc=new class{getLogger(t,e,r){return new Cc}};class kc{constructor(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}emit(t){this.ct().emit(t)}ct(){if(this.dt)return this.dt;var t=this.ht.vt(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ic}}class xc{getLogger(t,e,r){var i;return null!==(i=this.vt(t,e,r))&&void 0!==i?i:new kc(this,t,e,r)}ft(){var t;return null!==(t=this.dt)&&void 0!==t?t:Sc}yt(t){this.dt=t}vt(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getLogger(t,e,r)}}var Ac="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Tc=Symbol.for("io.opentelemetry.js.api.logs"),Ec=Ac;class Rc{constructor(){this.bt=new xc}static getInstance(){return this._instance||(this._instance=new Rc),this._instance}setGlobalLoggerProvider(t){return Ec[Tc]?this.getLoggerProvider():(Ec[Tc]=(e=1,r=t,i=Sc,t=>t===e?r:i),this.bt.yt(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=Ec[Tc])||void 0===t?void 0:t.call(Ec,1))&&void 0!==e?e:this.bt}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Ec[Tc],this.bt=new xc}}var Nc=Rc.getInstance();class Mc{constructor(t){this.dt=void 0,this.dt=t}export(t,e){this.dt.export(t,e)}forceFlush(){return this.dt.forceFlush()}shutdown(){return this.dt.shutdown()}}class Fc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Oc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Pc{constructor(t){this.wt=void 0,this._t=[],this.wt=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._t.push(t);var e=()=>{var e=this._t.indexOf(t);this._t.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this._t.length>=this.wt}awaitAll(){var t=this;return e((function*(){yield Promise.all(t._t)}))()}}function Lc(t){return new Pc(t.concurrencyLimit)}var Dc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Bc="1.9.0",jc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var $c=function(t){var e=new Set([t]),r=new Set,i=t.match(jc);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(jc);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?s===h&&o<=c?u(t):a(t):s<=h?u(t):a(t)}}(Bc),Zc=Bc.split(".")[0],qc=Symbol.for("opentelemetry.js.api."+Zc),Hc=Dc;function Vc(t,e,r,i){var n;void 0===i&&(i=!1);var s=Hc[qc]=null!==(n=Hc[qc])&&void 0!==n?n:{version:Bc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}if(s.version!==Bc){o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Bc);return r.error(o.stack||o.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Bc+"."),!0}function zc(t){var e,r,i=null===(e=Hc[qc])||void 0===e?void 0:e.version;if(i&&$c(i))return null===(r=Hc[qc])||void 0===r?void 0:r[t]}function Gc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Bc+".");var r=Hc[qc];r&&delete r[t]}var Yc,Uc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Wc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Xc=function(){function t(t){this.Ct=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("debug",this.Ct,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("error",this.Ct,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("info",this.Ct,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("warn",this.Ct,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("verbose",this.Ct,t)},t}();function Jc(t,e,r){var i=zc("diag");if(i)return r.unshift(e),i[t].apply(i,Wc([],Uc(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Yc||(Yc={}));var Kc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Qc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},td=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=zc("diag");if(i)return i[t].apply(i,Qc([],Kc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:Yc.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=zc("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Yc.NONE?t=Yc.NONE:t>Yc.ALL&&(t=Yc.ALL),e=e||{},{error:r("error",Yc.ERROR),warn:r("warn",Yc.WARN),info:r("info",Yc.INFO),debug:r("debug",Yc.DEBUG),verbose:r("verbose",Yc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Yc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Vc("diag",u,e,!0)},e.disable=function(){Gc("diag",e)},e.createComponentLogger=function(t){return new Xc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function ed(t){return Symbol.for(t)}var rd,id=function t(e){var r=this;r.It=e?new Map(e):new Map,r.getValue=function(t){return r.It.get(t)},r.setValue=function(e,i){var n=new t(r.It);return n.It.set(e,i),n},r.deleteValue=function(e){var i=new t(r.It);return i.It.delete(e),i}},nd=new id,sd=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},od=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},ad=function(){function t(){}return t.prototype.active=function(){return nd},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,od([r],sd(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),ud=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},ld=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},hd="context",cd=new ad,dd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Vc(hd,t,td.instance())},t.prototype.active=function(){return this.St().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return(i=this.St()).with.apply(i,ld([t,e,r],ud(n),!1))},t.prototype.bind=function(t,e){return this.St().bind(t,e)},t.prototype.St=function(){return zc(hd)||cd},t.prototype.disable=function(){this.St().disable(),Gc(hd,td.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(rd||(rd={}));var vd="0000000000000000",fd="00000000000000000000000000000000",pd={traceId:fd,spanId:vd,traceFlags:rd.NONE},gd=function(){function t(t){void 0===t&&(t=pd),this.kt=t}return t.prototype.spanContext=function(){return this.kt},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),md=ed("OpenTelemetry Context Key SPAN");function yd(t){return t.getValue(md)||void 0}function bd(){return yd(dd.getInstance().active())}function wd(t,e){return t.setValue(md,e)}function _d(t){return t.deleteValue(md)}function Cd(t,e){return wd(t,new gd(e))}function Id(t){var e;return null===(e=yd(t))||void 0===e?void 0:e.spanContext()}var Sd=/^([0-9a-f]{32})$/i,kd=/^[0-9a-f]{16}$/i;function xd(t){return r=t.traceId,Sd.test(r)&&r!==fd&&(e=t.spanId,kd.test(e)&&e!==vd);var e,r}function Ad(t){return new gd(t)}var Td=dd.getInstance(),Ed=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Td.active()),Boolean(null==e?void 0:e.root))return new gd;var i,n=r&&Id(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&xd(n)?new gd(n):new gd},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(!(arguments.length<2)){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:Td.active(),u=this.startSpan(t,n,a),l=wd(a,u);return Td.with(l,o,void 0,u)}},t}();var Rd=new Ed,Nd=function(){function t(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.xt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.xt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.xt=function(){if(this.dt)return this.dt;var t=this.ht.getDelegateTracer(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Rd},t}(),Md=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Ed},t}()),Fd=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new Nd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.dt)&&void 0!==t?t:Md},t.prototype.setDelegate=function(t){this.dt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Od=dd.getInstance(),Pd=td.instance(),Ld="trace",Dd=function(){function t(){this.At=new Fd,this.wrapSpanContext=Ad,this.isSpanContextValid=xd,this.deleteSpan=_d,this.getSpan=yd,this.getActiveSpan=bd,this.getSpanContext=Id,this.setSpan=wd,this.setSpanContext=Cd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Vc(Ld,this.At,td.instance());return e&&this.At.setDelegate(t),e},t.prototype.getTracerProvider=function(){return zc(Ld)||this.At},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){Gc(Ld,td.instance()),this.At=new Fd},t}(),Bd=Dd.getInstance(),jd=ed("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function $d(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if(Zd(i)){e=i;continue}return!1}return!1}}return!0}(t):Zd(typeof t))}function Zd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var qd=t=>{Pd.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))};function Hd(t){try{qd(t)}catch(t){}}var Vd,zd=performance,Gd="telemetry.sdk.language",Yd="telemetry.sdk.name",Ud="telemetry.sdk.version",Wd={[Yd]:"opentelemetry","process.runtime.name":"browser",[Gd]:"webjs",[Ud]:"2.2.0"},Xd=Math.pow(10,6),Jd=Math.pow(10,9);function Kd(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Xd)]}function Qd(){var t=zd.timeOrigin;if("number"!=typeof t){var e=zd;t=e.timing&&e.timing.fetchStart}return t}function tv(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Jd&&(r[1]-=Jd,r[0]+=1);return r}(Kd(Qd()),Kd("number"==typeof t?t:zd.now()))}function ev(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Qd()?tv(t):Kd(t);if(t instanceof Date)return Kd(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Vd||(Vd={}));var rv="[object Object]",iv="[object Null]",nv="[object Undefined]",sv=Function.prototype.toString,ov=sv.call(Object),av=Object.getPrototypeOf,uv=Object.prototype,lv=uv.hasOwnProperty,hv=Symbol?Symbol.toStringTag:void 0,cv=uv.toString;function dv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?nv:iv;return hv&&hv in Object(t)?function(t){var e=lv.call(t,hv),r=t[hv],i=!1;try{t[hv]=void 0,i=!0}catch(t){}var n=cv.call(t);i&&(e?t[hv]=r:delete t[hv]);return n}(t):function(t){return cv.call(t)}(t)}(t)!==rv)return!1;var e=av(t);if(null===e)return!0;var r=lv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&sv.call(r)===ov}var vv=20;function fv(t){return mv(t)?t.slice():t}function pv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>vv)){if(r++,wv(t)||wv(e)||yv(e))n=fv(e);else if(mv(t)){if(n=t.slice(),mv(e))for(var s=0,o=e.length;s<o;s++)n.push(fv(e[s]));else if(bv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=fv(e[h])}}else if(bv(t))if(bv(e)){if(!function(t,e){if(!dv(t)||!dv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(wv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(gv(t,f,i)||gv(e,f,i))delete n[f];else{if(bv(g)&&bv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=pv(n[f],p,r,i)}}}}else n=e;return n}}function gv(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;n<s;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function mv(t){return Array.isArray(t)}function yv(t){return"function"==typeof t}function bv(t){return!wv(t)&&!mv(t)&&!yv(t)&&"object"==typeof t}function wv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class _v extends Error{constructor(t){super(t),Object.setPrototypeOf(this,_v.prototype)}}function Cv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new _v("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Iv{constructor(){this.Tt=void 0,this.Et=void 0,this.Rt=void 0,this.Tt=new Promise(((t,e)=>{this.Et=t,this.Rt=e}))}get promise(){return this.Tt}resolve(t){this.Et(t)}reject(t){this.Rt(t)}}class Sv{constructor(t,e){this.Nt=void 0,this.Mt=void 0,this.Ft=!1,this.Ot=new Iv,this.Nt=t,this.Mt=e}get isCalled(){return this.Ft}get promise(){return this.Ot.promise}call(){if(!this.Ft){this.Ft=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.Nt.call(this.Mt,...e)).then((t=>this.Ot.resolve(t)),(t=>this.Ot.reject(t)))}catch(t){this.Ot.reject(t)}}return this.Ot.promise}}var kv={Pt:function(t,e){return new Promise((r=>{Od.with(function(t){return t.setValue(jd,!0)}(Od.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function xv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Pd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Av{constructor(t,e,r,i,n){this.Lt=void 0,this.Dt=void 0,this.Bt=void 0,this.jt=void 0,this.$t=void 0,this.Zt=void 0,this.Lt=t,this.Dt=e,this.Bt=r,this.jt=i,this.$t=n,this.Zt=Pd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Zt.debug("items to be sent",t),this.jt.hasReachedLimit())e({code:Vd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Dt.serializeRequest(t);null!=r?this.jt.pushPromise(this.Lt.send(r,this.$t).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Vd.FAILED,error:t.error}):"retryable"===t.status?e({code:Vd.FAILED,error:new Fc("Export failed with retryable status")}):e({code:Vd.FAILED,error:new Fc("Export failed with unknown error")});else{if(null!=t.data)try{this.Bt.handleResponse(this.Dt.deserializeResponse(t.data))}catch(e){this.Zt.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Vd.SUCCESS})}}),(t=>e({code:Vd.FAILED,error:t})))):e({code:Vd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.jt.awaitAll()}shutdown(){var t=this;return e((function*(){t.Zt.debug("shutdown started"),yield t.forceFlush(),t.Lt.shutdown()}))()}}function Tv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Lc(t)},n={timeout:t.timeoutMillis},new Av(i.transport,i.serializer,xv(),i.promiseHandler,n.timeout);var i,n}function Ev(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Rv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=Ev(t.charCodeAt(i)),s=Ev(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Nv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Mv(t){var e,r=Nv(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Fv="undefined"!=typeof BigInt?function(t){return Nv(t).toString()}:function(t){return t[0]*Jd+t[1]};function Ov(t){return t}function Pv(t){if(void 0!==t)return Rv(t)}var Lv={encodeHrTime:Mv,encodeSpanContext:Rv,encodeOptionalSpanContext:Pv};function Dv(t,e){return{key:t,value:Bv(e)}}function Bv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Bv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Dv(e,r)}))}}:{}}function jv(t,e){var r=function(t){var e,r;if(void 0===t)return Lv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Mv:Fv,encodeSpanContext:n?Ov:Rv,encodeOptionalSpanContext:n?Ov:Pv}}(e);return{resourceLogs:$v(t,r)}}function $v(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+s+":"+o,l=a.get(u);l||(l=[],a.set(u,l)),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Dv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Bv(t.body),eventName:t.eventName,attributes:Zv(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function Zv(t){return Object.keys(t).map((e=>Dv(e,t[e])))}var qv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Hv{static FromAttributeList(t,e){var r=new Hv({},e);return r.qt=zv(t),r.Ht=t.filter((t=>{var[e,r]=t;return qv(r)})).length>0,r}constructor(t,e){var r;this.qt=void 0,this.Ht=!1,this.Vt=void 0,this.zt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.qt=Object.entries(i).map((t=>{var[e,r]=t;return qv(r)&&(this.Ht=!0),[e,r]})),this.qt=zv(this.qt),this.Vt=function(t){if("string"==typeof t||void 0===t)return t;return void Pd.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Ht}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.qt.length;e++){var[r,i]=t.qt[e];t.qt[e]=[r,qv(i)?yield i:i]}t.Ht=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Pd.error("Accessing resource attributes before async attributes settled"),this.zt)return this.zt;var t={};for(var[e,r]of this.qt){var i;if(qv(r))Pd.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Ht||(this.zt=t),t}getRawAttributes(){return this.qt}get schemaUrl(){return this.Vt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,s=void 0===i||""===i;if(n)return i;if(s)return r;if(r===i)return r;return void Pd.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return Hv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Vv(t,e){return Hv.FromAttributeList(Object.entries(t),e)}function zv(t){return t.map((t=>{var[e,r]=t;return qv(r)?[e,r.catch((t=>{Pd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var Gv={serializeRequest:t=>{var e=jv(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Yv{constructor(t){this.Lt=void 0,this.Lt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Lt.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Lt.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Lt.shutdown()}}function Uv(t){return new Yv(t.transport)}function Wv(t){return[429,502,503,504].includes(t)}function Xv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}}class Jv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Gt.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Gt.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{s.status>=200&&s.status<=299?(Pd.debug("XHR success"),n({status:"success"})):s.status&&Wv(s.status)?n({status:"retryable",retryInMillis:Xv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Kv{constructor(t){this.Yt=void 0,this.Yt=t}send(t){var r=this;return e((function*(){var e=(yield r.Yt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Yt.url,new Blob([t],{type:e}))?(Pd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Qv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Gt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Gt.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Pd.debug("response success"),{status:"success"}):Wv(u.status)?{status:"retryable",retryInMillis:Xv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function tf(t,e){return Tv(t,e,Uv({transport:(r=t,new Jv(r))}));var r}function ef(t,e){return Tv(t,e,Uv({transport:(r=t,new Qv(r))}));var r}function rf(t,e){return Tv(t,e,Uv({transport:(r={url:t.url,headers:t.headers},new Kv(r))}));var r}function nf(t,i,n){return e((function*(){var e=r({},yield n()),s={};return null!=i&&Object.assign(s,yield i()),null!=t&&Object.assign(s,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Pd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(s,e)}))}function sf(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function of(t,e,i){var n,s;return r({},function(t,e,r){var i,n,s,o,a,u;return{timeoutMillis:Oc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:nf(t.headers,e.headers,i.headers),url:null!==(n=null!==(s=sf(t.url))&&void 0!==s?s:e.url)&&void 0!==n?n:i.url})}function af(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function uf(t,i,n){return of({url:t.url,timeoutMillis:t.timeoutMillis,headers:af(t),concurrencyLimit:t.concurrencyLimit},{},function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function lf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?ef:tf:rf)(uf(t,r,i),e)}class hf extends Mc{constructor(t){void 0===t&&(t={}),super(lf(t,Gv,"v1/logs",{"Content-Type":"application/json"}))}}class cf{set severityText(t){this.Ut()||(this.Wt=t)}get severityText(){return this.Wt}set severityNumber(t){this.Ut()||(this.Xt=t)}get severityNumber(){return this.Xt}set body(t){this.Ut()||(this.Jt=t)}get body(){return this.Jt}get eventName(){return this.Kt}set eventName(t){this.Ut()||(this.Kt=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Wt=void 0,this.Xt=void 0,this.Jt=void 0,this.Kt=void 0,this.totalAttributesCount=0,this.Qt=!1,this.te=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=ev(null!=i?i:c),this.hrTimeObserved=ev(null!=n?n:c),h){var d=Bd.getSpanContext(h);d&&xd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.te=t.logRecordLimits,this.Kt=s,this.setAttributes(l)}setAttribute(t,e){return this.Ut()||null===e?this:0===t.length?(Pd.warn("Invalid attribute key: "+t),this):$d(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.te.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Pd.warn("Dropping extra attributes."),this):($d(e)?this.attributes[t]=this.ee(e):this.attributes[t]=e,this)):(Pd.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}re(){this.Qt=!0}ee(t){var e=this.te.attributeValueLengthLimit;return e<=0?(Pd.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.ie(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.ie(t,e):t)):t}ie(t,e){return t.length<=e?t:t.substring(0,e)}Ut(){return this.Qt&&Pd.warn("Can not execute the operation on emitted log record"),this.Qt}}class df{constructor(t,e){this.instrumentationScope=void 0,this.ne=void 0,this.instrumentationScope=t,this.ne=e}emit(t){var e=t.context||Od.active(),i=new cf(this.ne,this.instrumentationScope,r({context:e},t));this.ne.activeProcessor.onEmit(i,e),i.re()}}class vf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class ff{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>Cv(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class pf{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new ff(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new vf}}class gf{constructor(t){var e,r,i;void 0===t&&(t={}),this.se=void 0,this.ne=void 0;var n,s,o,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=pv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Vv({"service.name":"unknown_service",[Gd]:Wd[Gd],[Yd]:Wd[Yd],[Ud]:Wd[Ud]});this.ne=new pf(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(s=null!==(o=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.se=new Sv(this.oe,this)}getLogger(t,e,r){if(this.se.isCalled)return Pd.warn("A shutdown LoggerProvider cannot provide a Logger"),Ic;t||Pd.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.ne.loggers.has(n)||this.ne.loggers.set(n,new df({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.ne)),this.ne.loggers.get(n)}forceFlush(){return this.se.isCalled?(Pd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.se.promise):this.ne.activeProcessor.forceFlush()}shutdown(){return this.se.isCalled?(Pd.warn("shutdown may only be called once per LoggerProvider"),this.se.promise):this.se.call()}oe(){return this.ne.activeProcessor.shutdown()}}class mf{constructor(t,e){var r,i,n,s,o,a,u,l;this.ae=void 0,this.ue=void 0,this.le=void 0,this.he=void 0,this.ce=void 0,this.de=!1,this.ve=[],this.fe=void 0,this.se=void 0,this.ae=t,this.ue=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.le=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.he=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.ce=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.se=new Sv(this.oe,this),this.ue>this.le&&(Pd.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.ue=this.le)}onEmit(t){this.se.isCalled||this.pe(t)}forceFlush(){return this.se.isCalled?this.se.promise:this.ge()}shutdown(){return this.se.call()}oe(){var t=this;return e((function*(){t.onShutdown(),yield t.ge(),yield t.ae.shutdown()}))()}pe(t){this.ve.length>=this.le||(this.ve.push(t),this.me())}ge(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ve.length/this.ue),n=0;n<i;n++)r.push(this.ye());Promise.all(r).then((()=>{t()})).catch(e)}))}ye(){return this.be(),0===this.ve.length?Promise.resolve():new Promise(((t,e)=>{Cv(this.Pt(this.ve.splice(0,this.ue)),this.ce).then((()=>t())).catch(e)}))}me(){if(!this.de){var t=()=>{this.de=!0,this.ye().then((()=>{this.de=!1,this.ve.length>0&&(this.be(),this.me())})).catch((t=>{this.de=!1,Hd(t)}))};if(this.ve.length>=this.ue)return t();void 0===this.fe&&(this.fe=setTimeout((()=>t()),this.he),"number"!=typeof this.fe&&this.fe.unref())}}be(){void 0!==this.fe&&(clearTimeout(this.fe),this.fe=void 0)}Pt(t){var e=()=>kv.Pt(this.ae,t).then((t=>{var e;t.code!==Vd.SUCCESS&&Hd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Hd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,Hd)}}class yf extends mf{constructor(t,e){super(t,e),this.we=void 0,this._e=void 0,this.Ce(e)}onShutdown(){"undefined"!=typeof document&&(this.we&&document.removeEventListener("visibilitychange",this.we),this._e&&document.removeEventListener("pagehide",this._e))}Ce(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.we=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._e=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.we),document.addEventListener("pagehide",this._e))}}var bf=1e4,wf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=bf),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;for(var o in s.add(t),t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o],u=e?e+"."+o:o;if(ti(a))wf(a,u,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=u.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[u]=a}}return r},_f={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:os.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Nc.setGlobalLoggerProvider(new gf({resource:Vv(e),processors:[new yf(new hf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Nc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s=os.console[n];os.console[n]=(s=>function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];if(a.length>0){var l=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!si(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>bf&&(l=l.slice(0,bf)+"...",i.body_truncated="true"),e.emit({severityText:_f[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":os.location.href},i,ti(a[0])?wf(a[0]):{})}),s.apply(os.console,a)}})(s)};for(var a of["debug","log","warn","error","info"])o(a)}};var Cf=ds("[Error tracking]");function If(){return new In([new Dn,new Yn,new jn,new Bn,new zn,new Vn,new Zn,new Gn],Ln())}class Sf{constructor(t){var e,r;this.Ie=[],this.Se=If(),this._instance=t,this.Ie=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property($s))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.Ie=n,this._instance.persistence&&this._instance.persistence.register({[$s]:this.Ie,[Zs]:s})}get ke(){var t,e=!!this._instance.get_property(Zs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Se.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.xe(e)){if(this.Ae(e))return void Cf.info("Skipping exception capture because a suppression rule matched");if(!this.ke&&this.Te(e))return void Cf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ee(e))return void Cf.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Ae(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ii(r)&&r.length>0&&t.$exception_types.push(r),ii(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ie.some((t=>{var r=t.values.map((t=>{var r,i=Wl[t.operator],n=Jr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Te(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://")))}Ee(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}xe(t){return!oi(t)&&Jr(t)}}var kf=ds("[ExceptionAutocapture]"),xf=If(),Af={wrapOnError:t=>{var e=Un;e||kf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],u=xf.buildFromUnknown(o||a,{mechanism:{handled:!1}});return t(u),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Un;e||kf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,s=xf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(s),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||kf.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;s<i;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=xf.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.errorWrappingFunctions=Af,os.posthogErrorWrappingFunctions=Af;var Tf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Jr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==co&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};os.__PosthogExtensions__=os.__PosthogExtensions__||{};var Ef={_patchFetch:(t,r,i)=>Ms(Un,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Tf(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Ms(Un.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=new Request(s);return Tf(t,e,r,l),i.call(this,n,l.url,o,a,u)}))};os.__PosthogExtensions__.tracingHeadersPatchFns=Ef,os.postHogTracingHeadersPatchFns=Ef;var Rf=-1,Nf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Rf=e.timeStamp,t(e))}),!0)},Mf=(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)))}},Ff=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Of=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Pf=()=>{var t,e=Of();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},Lf=function(t,e){void 0===e&&(e=-1);var r=Of(),i="navigate";return Rf>=0?i="back-forward-cache":r&&(document.prerendering||Pf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Df=new WeakMap;function Bf(t,e){return Df.get(t)||Df.set(t,new e),Df.get(t)}class jf{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&&t.startTime-i.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var $f,Zf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},qf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Hf=-1,Vf=new Set,zf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Gf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Vf)e();isFinite(Hf)||(Hf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Gf,!0))}},Yf=()=>{if(Hf<0){var t,e=Pf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;Hf=null!=r?r:zf(),addEventListener("visibilitychange",Gf,!0),addEventListener("prerenderingchange",Gf,!0),Nf((()=>{setTimeout((()=>{Hf=zf()}))}))}return{get firstHiddenTime(){return Hf},onHidden(t){Vf.add(t)}}},Uf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Wf=[1800,3e3],Xf=function(t,e){void 0===e&&(e={}),Uf((()=>{var r,i=Yf(),n=Lf("FCP"),s=Zf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Pf(),0),n.entries.push(e),r(!0)))}));s&&(r=Mf(t,n,Wf,e.reportAllChanges),Nf((i=>{n=Lf("FCP"),r=Mf(t,n,Wf,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Jf=[.1,.25],Kf=0,Qf=1/0,tp=0,ep=t=>{for(var e of t)e.interactionId&&(Qf=Math.min(Qf,e.interactionId),tp=Math.max(tp,e.interactionId),Kf=tp?(tp-Qf)/7+1:0)},rp=()=>{var t;return $f?Kf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ip=0;class np{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){ip=rp(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((rp()-ip)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var sp=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=qf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},op=[200,500];class ap{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var up=[2500,4e3],lp={onLCP:function(t,e){void 0===e&&(e={}),Uf((()=>{var r,i=Yf(),n=Lf("LCP"),s=Bf(e,ap),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),o.startTime<i.firstHiddenTime&&(n.value=Math.max(o.startTime-Pf(),0),n.entries=[o],r())},a=Zf("largest-contentful-paint",o);if(a){r=Mf(t,n,up,e.reportAllChanges);var u=qf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(sp(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Nf((i=>{n=Lf("LCP"),r=Mf(t,n,up,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(t,e){void 0===e&&(e={});var r=Yf();Xf(qf((()=>{var i,n=Lf("CLS",0),s=Bf(e,jf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Zf("layout-shift",o);a&&(i=Mf(t,n,Jf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Nf((()=>{s.i=0,n=Lf("CLS",0),i=Mf(t,n,Jf,e.reportAllChanges),Ff((()=>i()))})),setTimeout(i))})))},onFCP:Xf,onINP:function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Yf();Uf((()=>{var i;"interactionCount"in performance||$f||($f=Zf("event",ep,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Lf("INP"),o=Bf(e,np),a=t=>{sp((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},u=Zf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Mf(t,s,op,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Nf((()=>{o.v(),s=Lf("INP"),n=Mf(t,s,op,e.reportAllChanges)})))}))}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.postHogWebVitalsCallbacks=lp,os.postHogWebVitalsCallbacks=lp,os.__PosthogExtensions__.loadWebVitalsCallbacks=()=>lp;class hp{constructor(t){this.disabled=!1===t;var e=ti(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var cp="$copy_autocapture",dp=ds("[AutoCapture]");function vp(t,e){return e.length>t?e.slice(0,t)+"...":e}function fp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!po(e));return e}function pp(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};ko.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=vp(1024,Vo(t)):s.$el_text=vp(1024,Io(t)));var o=_o(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),ps(t.attributes,(function(r){var n;if((!Lo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Ho(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=bo(o).join(" ")),s["attr__"+r.name]=vp(1024,o)}}));for(var a=1,u=1,l=t;l=fp(l);)a++,l.tagName===t.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}function gp(t,e){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!go(h,"body");)yo(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(ps(l,(t=>{var e=Po(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Ho(f)&&f),Vr(_o(t),"ph-no-capture")&&(p=!0),d.push(pp(t,s,o,a));var r=function(t){if(!Po(t))return{};var e={};return ps(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&&Ho(i)&&(e[r]=i)}})),e}(t);gs(v,r)})),p)return{props:{},explicitNoCapture:p};if(o||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Vo(t):d[0].$el_text=Io(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=As(f))?void 0:g.host,b=null==Un||null==(m=Un.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:gs({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Go(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class mp{constructor(t){this.Re=!1,this.Ne=null,this.Me=!1,this.instance=t,this.rageclicks=new hp(t.config.rageclick),this.Fe=null}get Oe(){var t,e,r=ti(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}Pe(){if(this.isBrowserSupported()){if(Un&&ts){var t=t=>{t=t||(null==Un?void 0:Un.event);try{this.Le(t)}catch(t){dp.error("Failed to capture event",t)}};if(xs(ts,"submit",t,{capture:!0}),xs(ts,"change",t,{capture:!0}),xs(ts,"click",t,{capture:!0}),this.Oe.capture_copied_text){var e=t=>{t=t||(null==Un?void 0:Un.event),this.Le(t,cp)};xs(ts,"copy",e,{capture:!0}),xs(ts,"cut",e,{capture:!0})}}}else dp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Re&&(this.Pe(),this.Re=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Me=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ds]:!!t.autocapture_opt_out}),this.Ne=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fe=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fe)||e.forEach((e=>{var i=null==ts?void 0:ts.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[Ds],i=this.Ne;if(si(i)&&!li(r)&&!this.instance.De())return!1;var n=null!==(e=this.Ne)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Le(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=So(t);if(mo(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())&&No(i,this.instance.config.rageclick)&&this.Le(t,"$rageclick");var n=e===cp;if(i&&Oo(i,t,this.Oe,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=gp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:this.Me});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===cp){var u,l=Co(null==Un||null==(u=Un.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Kr(null==ts?void 0:ts.querySelectorAll)}}var yp={};function bp(t){return function(t,e){var r=yp[t];if(r)return r;var i=e[t];if(Qr(i)&&!as())return yp[t]=i.bind(e);var n=e.document;if(n&&Kr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[t]&&(i=o[t]),n.head.removeChild(s)}catch(e){cs.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Kr(i)?yp[t]=i.bind(e):i}("MutationObserver",t)}function wp(t,e){return ai(t)&&t>=e}class _p{Be(t){var e,r,i,n,s,o=this.je((null==t?void 0:t.__onCapture)||this.$e.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.Ze=[],this.je=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.qe=t=>{var e=function(t){var e=So(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);si(e)||this.He(e)||this.Ze.push(e),this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))},this.Ge=()=>{var t=Date.now();t%50==0&&this.Ze.forEach((e=>{ri(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ye=()=>{this.Ue=Date.now()},this.instance=t,this.Oe=this.Be(e),this._onCapture=this.Oe.__onCapture}start(t){this.We(),this.Xe(),this.Je(),this.Ke(t)}Ke(t){if(!this.Qe){var e=bp(os);this.Qe=new e((t=>{this.tr(t)})),this.Qe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qe)||t.disconnect(),this.Qe=void 0,os.removeEventListener("click",this.qe),os.removeEventListener("scroll",this.Ge,{capture:!0}),os.removeEventListener("selectionchange",this.Ye)}tr(t){this.er=Date.now()}We(){xs(os,"click",this.qe)}Xe(){xs(os,"scroll",this.Ge,{capture:!0})}Je(){xs(os,"selectionchange",this.Ye)}He(t){if(!t)return!0;if(!this.Oe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(fo(t.node))return!0;var r=this.Ze.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!go(t.node,"html")&&po(t.node)&&!ko.includes(t.node.tagName.toLowerCase()))}ze(){if(this.Ze.length){clearTimeout(this.Ve),this.Ve=void 0;var t=this.Ze;for(var e of(this.Ze=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.er&&e.timestamp<=this.er?this.er-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ue&&e.timestamp<=this.Ue?this.Ue-e.timestamp:void 0;var i=wp(e.scrollDelayMs,this.Oe.scroll_threshold_ms),n=wp(e.selectionChangedDelayMs,this.Oe.selection_change_threshold_ms),s=wp(e.mutationDelayMs,this.Oe.mutation_threshold_ms),o=wp(e.absoluteDelayMs,1.1*this.Oe.mutation_threshold_ms),a=ai(e.scrollDelayMs)&&e.scrollDelayMs<this.Oe.scroll_threshold_ms,u=ai(e.mutationDelayMs)&&e.mutationDelayMs<this.Oe.mutation_threshold_ms,l=ai(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.Oe.selection_change_threshold_ms;a||u||l||(i||s||o||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.er,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.Oe.mutation_threshold_ms&&this.Ze.push(e))}this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))}}$e(t,e){this.instance.capture("$dead_click",r({},e,gp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new _p(t,e);var Cp=ds("[ExternalScriptsLoader]"),Ip=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Cp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==ts?void 0:ts.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;o<i.length;o++)if(n=s())return n.v;var a=()=>{if(!ts)return r("document not found");var i=ts.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)ts.head.appendChild(i);else{var n,s=ts.querySelectorAll("body > script");if(s.length>0)null==(n=s[0].parentNode)||n.insertBefore(i,s[0]);else ts.body.appendChild(i)}};null!=ts&&ts.body?a():null==ts||ts.addEventListener("DOMContentLoaded",a)};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",i);Ip(t,s,r)},os.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Ip(t,i,r)};var Sp="";var kp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xp(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=ts),Sp)return Sp;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_"+rl();!Sp&&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",Sp=s)}return Sp}(t);if(!r){var i=(t=>{var e=t.match(kp);return e?e[0]:""})(t);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ap={rr:()=>!!ts,ir:function(t){cs.error("cookieStore error: "+t)},nr:function(t){if(ts){try{for(var e=t+"=",r=ts.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},sr:function(t){var e;try{e=JSON.parse(Ap.nr(t))||{}}catch(t){}return e},ar:function(t,e,r,i,n){if(ts)try{var s="",o="",a=xp(ts.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),s="; expires="+u.toUTCString()}n&&(o="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+l.length),ts.cookie=l,l}catch(t){return}},ur:function(t,e){if(null!=ts&&ts.cookie)try{Ap.ar(t,"",-1,e)}catch(t){return}}},Tp=null,Ep={rr:function(){if(!si(Tp))return Tp;var t=!0;if(ri(Un))t=!1;else try{var e="__mplssupport__";Ep.ar(e,"xyz"),'"xyz"'!==Ep.nr(e)&&(t=!1),Ep.ur(e)}catch(e){t=!1}return t||cs.error("localStorage unsupported; falling back to cookie store"),Tp=t,t},ir:function(t){cs.error("localStorage error: "+t)},nr:function(t){try{return null==Un?void 0:Un.localStorage.getItem(t)}catch(t){Ep.ir(t)}return null},sr:function(t){try{return JSON.parse(Ep.nr(t))||{}}catch(t){}return null},ar:function(t,e){try{null==Un||Un.localStorage.setItem(t,JSON.stringify(e))}catch(t){Ep.ir(t)}},ur:function(t){try{null==Un||Un.localStorage.removeItem(t)}catch(t){Ep.ir(t)}}},Rp=["$device_id","distinct_id",Ys,Us,lo,uo],Np={},Mp={rr:function(){return!0},ir:function(t){cs.error("memoryStorage error: "+t)},nr:function(t){return Np[t]||null},sr:function(t){return Np[t]||null},ar:function(t,e){Np[t]=e},ur:function(t){delete Np[t]}},Fp=null,Op={rr:function(){if(!si(Fp))return Fp;if(Fp=!0,ri(Un))Fp=!1;else try{var t="__support__";Op.ar(t,"xyz"),'"xyz"'!==Op.nr(t)&&(Fp=!1),Op.ur(t)}catch(t){Fp=!1}return Fp},ir:function(t){cs.error("sessionStorage error: ",t)},nr:function(t){try{return null==Un?void 0:Un.sessionStorage.getItem(t)}catch(t){Op.ir(t)}return null},sr:function(t){try{return JSON.parse(Op.nr(t))||null}catch(t){}return null},ar:function(t,e){try{null==Un||Un.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Op.ir(t)}},ur:function(t){try{null==Un||Un.sessionStorage.removeItem(t)}catch(t){Op.ir(t)}}},Pp=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Lp{constructor(t){this._instance=t}get Oe(){return this._instance.config}get consent(){return this.lr()?Pp.DENIED:this.hr}isOptedOut(){return"always"===this.Oe.cookieless_mode||(this.consent===Pp.DENIED||this.consent===Pp.PENDING&&(this.Oe.opt_out_capturing_by_default||"on_reject"===this.Oe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Pp.DENIED}optInOut(t){this.cr.ar(this.dr,t?1:0,this.Oe.cookie_expiration,this.Oe.cross_subdomain_cookie,this.Oe.secure_cookie)}reset(){this.cr.ur(this.dr,this.Oe.cross_subdomain_cookie)}get dr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get hr(){var t=this.cr.nr(this.dr);return gi(t)?Pp.GRANTED:Vr(mi,t)?Pp.DENIED:Pp.PENDING}get cr(){if(!this.vr){var t=this.Oe.opt_out_capturing_persistence_type;this.vr="localStorage"===t?Ep:Ap;var e="localStorage"===t?Ap:Ep;e.nr(this.dr)&&(this.vr.nr(this.dr)||this.optInOut(gi(e.nr(this.dr))),e.ur(this.dr,this.Oe.cross_subdomain_cookie))}return this.vr}lr(){return!!this.Oe.respect_dnt&&!!ks([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,os.doNotTrack],(t=>gi(t)))}}var Dp=ds("[Dead Clicks]"),Bp=()=>!0,jp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Hs)),i=t.instance.config.capture_dead_clicks;return li(i)?i:!!ti(i)||r};class $p{get lazyLoadedDeadClicksAutocapture(){return this.pr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[Hs]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this.gr((()=>{this.mr()})):this.stop()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Dp.error("failed to load script",e):t()}))}mr(){var t;if(ts){if(!this.pr&&null!=(t=os.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=ti(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.pr=os.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.pr.start(ts),Dp.info("starting...")}}else Dp.error("`document` not found. Cannot start.")}stop(){this.pr&&(this.pr.stop(),this.pr=void 0,Dp.info("stopping..."))}}var Zp=ds("[ExceptionAutocapture]");class qp{constructor(t){var e,r,i;this.yr=()=>{var t;if(Un&&this.isEnabled&&null!=(t=os.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=os.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=os.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=os.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.br&&this.Oe.capture_unhandled_errors&&(this.br=e(this.captureException.bind(this))),!this.wr&&this.Oe.capture_unhandled_rejections&&(this.wr=r(this.captureException.bind(this))),!this._r&&this.Oe.capture_console_errors&&(this._r=i(this.captureException.bind(this)))}catch(t){Zp.error("failed to start",t),this.Cr()}}},this._instance=t,this.Ir=!(null==(e=this._instance.persistence)||!e.props[js]),this.Sr=new bi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,k:Zp}),this.Oe=this.kr(),this.startIfEnabledOrStop()}kr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(t)?e=r({},e,t):(ri(t)?this.Ir:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Oe.capture_console_errors||this.Oe.capture_unhandled_errors||this.Oe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Zp.info("enabled"),this.Cr(),this.gr(this.yr)):this.Cr()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Zp.error("failed to load script",e);t()}))}Cr(){var t,e,r;null==(t=this.br)||t.call(this),this.br=void 0,null==(e=this.wr)||e.call(this),this.wr=void 0,null==(r=this._r)||r.call(this),this._r=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.Ir=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[js]:this.Ir}),this.Oe=this.kr(),this.startIfEnabledOrStop()}onConfigChange(){this.Oe=this.kr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Sr.consumeRateLimit(i)?Zp.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Hp{constructor(t){var e;this._instance=t,this.Ar=(null==Un||null==(e=Un.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Tr&&this.Tr(),this.Tr=void 0,cs.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Un&&Un.history){var r=this;null!=(t=Un.history.pushState)&&t.__posthog_wrapped__||Ms(Un.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("pushState")})),null!=(e=Un.history.replaceState)&&e.__posthog_wrapped__||Ms(Un.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("replaceState")})),this.Rr()}}Er(t){try{var e,r=null==Un||null==(e=Un.location)?void 0:e.pathname;if(!r)return;r!==this.Ar&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Ar=r}catch(e){cs.error("Error capturing "+t+" pageview",e)}}Rr(){if(!this.Tr){var t=()=>{this.Er("popstate")};xs(Un,"popstate",t),this.Tr=()=>{Un&&Un.removeEventListener("popstate",t)}}}}var Vp=ds("[SegmentIntegration]");function zp(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()||rl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(io,"identified")),e()},n=r.user();"then"in n&&Kr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Vp.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()||(Vp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Vp.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var Gp="posthog-js";function Yp(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Up{constructor(t,e,r,i,n,s){this.name=Gp,this.setupOnce=function(o){o(Yp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var Wp=null!=Un&&Un.location?Ns(Un.location.hash,"__posthog")||Ns(location.hash,"state"):null,Xp="_postHogToolbarParams",Jp=ds("[Toolbar]"),Kp=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Kp||{});class Qp{constructor(t){this.instance=t}Nr(t){os.ph_toolbar_state=t}Mr(){var t;return null!==(t=os.ph_toolbar_state)&&void 0!==t?t:Kp.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Un||!ts)return!1;t=null!=t?t:Un.location,r=null!=r?r:Un.history;try{if(!e){try{Un.localStorage.setItem("test","test"),Un.localStorage.removeItem("test")}catch(t){return!1}e=null==Un?void 0:Un.localStorage}var i,n=Wp||Ns(t.hash,"__posthog")||Ns(t.hash,"state"),s=n?bs((()=>JSON.parse(atob(decodeURIComponent(n)))))||bs((()=>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(Xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Fr(t){var e=os.ph_load_toolbar||os.ph_load_editor;!oi(e)&&Kr(e)?e(t,this.instance):Jp.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==ts||!ts.getElementById(ho));if(!Un||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(Un.localStorage.setItem(Xp,JSON.stringify(r({},n,{source:void 0}))),this.Mr()===Kp.LOADED)this.Fr(n);else if(this.Mr()===Kp.UNINITIALIZED){var s;this.Nr(Kp.LOADING),null==(s=os.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Jp.error("[Toolbar] Failed to load",t),void this.Nr(Kp.UNINITIALIZED);this.Nr(Kp.LOADED),this.Fr(n)})),xs(Un,"turbolinks:load",(()=>{this.Nr(Kp.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Or(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var tg=ds("[TracingHeaders]");class eg{constructor(t){this.Pr=void 0,this.Lr=void 0,this.yr=()=>{var t,e;ri(this.Pr)&&(null==(t=os.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this.Lr)&&(null==(e=os.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return tg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.gr(this.yr):(null==(t=this.Pr)||t.call(this),null==(e=this.Lr)||e.call(this),this.Pr=void 0,this.Lr=void 0)}}var rg="https?://(.*)",ig=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ng=ms(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ig),sg="<masked>",og=["li_fat_id"];function ag(t,e,r){if(!ts)return{};var i,n=e?ms([],ig,r||[]):[],s=ug(Rs(ts.URL,n,sg),t),o=(i={},ps(og,(function(t){var e=Ap.nr(t);i[t]=e||null})),i);return gs(o,s)}function ug(t,e){var r=ng.concat(e||[]),i={};return ps(r,(function(e){var r=Es(t,e);i[e]=r||null})),i}function lg(t){var e=function(t){return t?0===t.search(rg+"google.([^/?]*)")?"google":0===t.search(rg+"bing.com")?"bing":0===t.search(rg+"yahoo.com")?"yahoo":0===t.search(rg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!si(e)){i.$search_engine=e;var n=ts?Es(ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function hg(){return navigator.language||navigator.userLanguage}function cg(){return(null==ts?void 0:ts.referrer)||"$direct"}function dg(t,e){var r=t?ms([],ig,e||[]):[],i=null==es?void 0:es.href.substring(0,1e3);return{r:cg().substring(0,1e3),u:i?Rs(i,r,sg):void 0}}function vg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=As(r))?void 0:e.host};if(i){n.$current_url=i;var s=As(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=ug(i);gs(n,o)}if(r){var a=lg(r);gs(n,a)}return n}function fg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function pg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function gg(t,e){if(!ss)return{};var r,i=t?ms([],ig,e||[]):[],[n,s]=function(t){for(var e=0;e<yn.length;e++){var[r,i]=yn[e],n=r.exec(t),s=n&&(Kr(i)?i(n,t):i);if(s)return s}return["",""]}(ss);return gs(_s({$os:n,$os_version:s,$browser:pn(ss,navigator.vendor),$device:bn(ss),$device_type:wn(ss),$timezone:fg(),$timezone_offset:pg()}),{$current_url:Rs(null==es?void 0:es.href,i,sg),$host:null==es?void 0:es.host,$pathname:null==es?void 0:es.pathname,$raw_user_agent:ss.length>1e3?ss.substring(0,997)+"...":ss,$browser_version:mn(ss,navigator.vendor),$browser_language:hg(),$browser_language_prefix:(r=hg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Un?void 0:Un.screen.height,$screen_width:null==Un?void 0:Un.screen.width,$viewport_height:null==Un?void 0:Un.innerHeight,$viewport_width:null==Un?void 0:Un.innerWidth,$lib:"web",$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var mg=ds("[Web Vitals]"),yg=9e5;class bg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Br=()=>{clearTimeout(this.jr),0!==this.B.metrics.length&&(this._instance.capture("$web_vitals",this.B.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.pe=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ri(i))mg.error("Could not read session ID. Dropping metrics!");else{this.B=this.B||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.$r();if(!ri(n))if(oi(null==t?void 0:t.name)||oi(null==t?void 0:t.value))mg.error("Invalid metric received",t);else if(this.Zr&&t.value>=this.Zr)mg.error("Ignoring metric with value >= "+this.Zr,t);else this.B.url!==n&&(this.Br(),this.jr=setTimeout(this.Br,this.flushToCaptureTimeoutMs)),ri(this.B.url)&&(this.B.url=n),this.B.firstMetricTimestamp=ri(this.B.firstMetricTimestamp)?Date.now():this.B.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.B.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.B.metrics.length===this.allowedMetrics.length&&this.Br()}},this.yr=()=>{if(!this.Re){var t,e,r,i,n=os.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.pe.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.pe.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.pe.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.pe.bind(this)),this.Re=!0):mg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Dr=!(null==(e=this._instance.persistence)||!e.props[qs]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=ti(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return oi(r)?(null==(e=this._instance.persistence)?void 0:e.props[zs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=t&&t}get Zr(){var t=ti(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:yg;return 0<t&&t<=6e4?yg:t}get isEnabled(){var t=null==es?void 0:es.protocol;if("http:"!==t&&"https:"!==t)return mg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:li(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return li(e)?e:this.Dr}startIfEnabled(){this.isEnabled&&!this.Re&&(mg.info("enabled, starting..."),this.gr(this.yr))}onRemoteConfig(t){var e=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qs]:e}),this._instance.persistence.register({[zs]:r})),this.Dr=e,this.startIfEnabled()}gr(t){var e,r;if(null!=(e=os.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks)t();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(e=>{e?mg.error("failed to load script",e):t()}))}}$r(){var t=Un?Un.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?ms([],ig,r||[]):[];return Rs(t,i,sg)}mg.error("Could not determine current URL")}}var wg=ds("[Heatmaps]");function _g(t){return ti(t)&&"clientX"in t&&"clientY"in t&&ai(t.clientX)&&ai(t.clientY)}class Cg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.qr=null,this.instance=t,this.Dr=!(null==(e=this.instance.persistence)||!e.props[Bs]),this.rageclicks=new hp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return ti(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return oi(this.instance.config.capture_heatmaps)?oi(this.instance.config.enable_heatmaps)?this.Dr:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Re)return;wg.info("starting..."),this.Hr(),this.Vr()}else{var t;clearInterval(null!==(t=this.qr)&&void 0!==t?t:void 0),this.zr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bs]:e}),this.Dr=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.B;return this.B=void 0,t}Gr(t){this.qe(t.originalEvent,"deadclick")}Vr(){this.qr&&clearInterval(this.qr),this.qr=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(ts)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Hr(){Un&&ts&&(this.Ur=this.Yr.bind(this),xs(Un,"beforeunload",this.Ur),this.Wr=t=>this.qe(t||(null==Un?void 0:Un.event)),xs(ts,"click",this.Wr,{capture:!0}),this.Xr=t=>this.Jr(t||(null==Un?void 0:Un.event)),xs(ts,"mousemove",this.Xr,{capture:!0}),this.Kr=new $p(this.instance,Bp,this.Gr.bind(this)),this.Kr.startIfEnabledOrStop(),this.Qr=this.Vr.bind(this),xs(ts,"visibilitychange",this.Qr),this.Re=!0)}zr(){var t;Un&&ts&&(this.Ur&&Un.removeEventListener("beforeunload",this.Ur),this.Wr&&ts.removeEventListener("click",this.Wr,{capture:!0}),this.Xr&&ts.removeEventListener("mousemove",this.Xr,{capture:!0}),this.Qr&&ts.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.ti),null==(t=this.Kr)||t.stop(),this.Re=!1)}ei(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&&po(i)&&!go(i,"body");){if(i===r)return!1;if(Vr(e,null==Un?void 0:Un.getComputedStyle(i).position))return!0;i=Ao(i)}return!1}(So(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}qe(t,e){var i;if(void 0===e&&(e="click"),!fo(t.target)&&_g(t)){var n=this.ei(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.ri(r({},n,{type:"rageclick"})),this.ri(n)}}Jr(t){!fo(t.target)&&_g(t)&&(clearTimeout(this.ti),this.ti=setTimeout((()=>{this.ri(this.ei(t,"mousemove"))}),500))}ri(t){if(Un){var e=Un.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?ms([],ig,i||[]):[],s=Rs(e,n,sg);this.B=this.B||{},this.B[s]||(this.B[s]=[]),this.B[s].push(t)}}Yr(){this.B&&!ei(this.B)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ig{constructor(t){this.ii=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ni=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.si()}si(){var t;this.oi=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ii)}destroy(){var t;null==(t=this.oi)||t.call(this),this.oi=void 0}doPageView(t,e){var r,i=this.ai(t,e);return this.ni={pathname:null!==(r=null==Un?void 0:Un.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ai(t,null==(e=this.ni)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ni)?void 0:t.pageViewId}}ai(t,e){var r=this.ni;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ri(s)||ri(o)||ri(a)||ri(u)||ri(l)||ri(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=s<=1?1:yi(o/s,0,1,cs),d=s<=1?1:yi(a/s,0,1,cs),v=u<=1?1:yi(l/u,0,1,cs),f=u<=1?1:yi(h/u,0,1,cs);i=gs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Sg=ds("[FeatureFlags]"),kg=ds("[FeatureFlags]",{debugEnabled:!0}),xg="errors_while_computing_flags",Ag="flag_missing",Tg="quota_limited",Eg="timeout",Rg="connection_error",Ng="unknown_error",Mg=t=>"api_error_"+t,Fg="$active_feature_flags",Og="$override_feature_flags",Pg="$feature_flag_payloads",Lg="$override_feature_flag_payloads",Dg="$feature_flag_request_id",Bg="$feature_flag_evaluated_at",jg=t=>{var e={};for(var[r,i]of ys(t||{}))i&&(e[r]=i);return e},$g=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]})))):Sg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Zg=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class qg{constructor(t){this.ui=!1,this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.pi=!1,this._instance=t,this.featureFlagEventHandlers=[]}gi(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.pi||(Sg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.pi=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Sg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}mi(){return this.gi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.vi=!0;else{var t=!this.yi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.bi({disableFlags:t})}}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Js),e=this._instance.get_property(Og),i=this._instance.get_property(Lg);if(!i&&!e)return t||{};var n=gs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,u,l=n[o],h=null==e?void 0:e[o],c=ri(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ri(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[o]=f}return this.ui||(Sg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ui=!0),n}getFlagVariants(){var t=this._instance.get_property(Ws),e=this._instance.get_property(Og);if(!e)return t||{};for(var r=gs({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Sg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ui=!0),r}getFlagPayloads(){var t=this._instance.get_property(Pg),e=this._instance.get_property(Lg);if(!e)return t||{};for(var r=gs({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Sg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ui=!0),r}reloadFeatureFlags(){this.ci||this._instance.config.advanced_disable_feature_flags||this.yi||(this._instance.wi.emit("featureFlagsReloading",!0),this.yi=setTimeout((()=>{this.bi()}),5))}Ci(){clearTimeout(this.yi),this.yi=void 0}ensureFlagsLoaded(){this.li||this.hi||this.yi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ci=t}bi(t){var e;if(this.Ci(),!this._instance.De())if(this.hi)this.di=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),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._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Ks)||{}),group_properties:this._instance.get_property(Qs)};si(n)||ri(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.mi()&&(s.evaluation_contexts=this.gi());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);o&&(s.timezone=fg()),this.hi=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this._instance.config.disable_compression?void 0:sl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n,o=!0;(200===t.statusCode&&(this.di||(this.$anon_distinct_id=void 0),o=!1),this.hi=!1,this.vi)||(this.vi=!0,this._instance.Ii(null!==(n=t.json)&&void 0!==n?n:{}));if(!s.disable_flags||this.di){this.fi=!o;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?Eg:Rg):a.push(Ng):200!==t.statusCode&&a.push(Mg(t.statusCode)),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push(xg);var u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes(Zg.FeatureFlags));if(u&&a.push(Tg),null==(i=this._instance.persistence)||i.register({[ro]:a}),u)Sg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var l;if(!s.disable_flags)this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},o);this.di&&(this.di=!1,this.bi())}}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){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}Sg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}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={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this._instance.get_property(Dg)||void 0,u=this._instance.get_property(Bg)||void 0,l=this._instance.get_property(eo)||{};if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(o))){var h,c,d,v,f,p,g,m,y,b;Jr(l[t])?l[t].push(o):l[t]=[o],null==(h=this._instance.persistence)||h.register({[eo]:l});var w=this.getFeatureFlagDetails(t),_=[...null!==(c=this._instance.get_property(ro))&&void 0!==c?c:[]];ri(n)&&_.push(Ag);var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(d=this._instance.config.bootstrap)||null==(d=d.featureFlags)?void 0:d[t])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[t])||null,$used_bootstrap_value:!this.fi};ri(null==w||null==(f=w.metadata)?void 0:f.version)||(C.$feature_flag_version=w.metadata.version);var I,S=null!==(p=null==w||null==(g=w.reason)?void 0:g.description)&&void 0!==p?p:null==w||null==(m=w.reason)?void 0:m.code;if(S&&(C.$feature_flag_reason=S),null!=w&&null!=(y=w.metadata)&&y.id&&(C.$feature_flag_id=w.metadata.id),ri(null==w?void 0:w.original_variant)&&ri(null==w?void 0:w.original_enabled)||(C.$feature_flag_original_response=ri(w.original_variant)?w.original_enabled:w.original_variant),null!=w&&null!=(b=w.metadata)&&b.original_payload)C.$feature_flag_original_payload=null==w||null==(I=w.metadata)?void 0:I.original_payload;_.length&&(C.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",C)}if(i){var k=s;if(!ri(s))try{k=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else Sg.warn('getFeatureFlagResult for key "'+t+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.mi()&&(i.evaluation_contexts=this.gi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:sl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ri(r)?void 0:!!r}Sg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=$g(t),a=o.flags,u=o.featureFlags,l=o.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Jr(u)){Sg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[Fg]:u,[Ws]:d})}else{var f=u,p=l,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=r({},i,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=r({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=r({},s,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=r({},i,f),p=r({},n,p),g=r({},s,g);e&&e.register(r({[Fg]:Object.keys(jg(f)),[Ws]:f||{},[Pg]:p||{},[Js]:g||{}},h?{[Dg]:h}:{},c?{[Bg]:c}:{}))}}}(t,this._instance.persistence,i,n,s),this.Si(e)}}override(t,e){void 0===e&&(e=!1),Sg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Sg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Og),this._instance.persistence.unregister(Lg),this.Si(),kg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ui=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Og),kg.info("Flag overrides cleared");else if(r.flags){if(Jr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Og]:i})}else this._instance.persistence.register({[Og]:r.flags});kg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Lg),kg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lg]:r.payloads}),kg.info("Payload overrides set",{payloads:r.payloads}))),void this.Si()}this.Si()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.li){var{flags:e,flagVariants:r}=this.ki();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this._instance.get_property(Xs)||[]).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 u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Fg]:Object.keys(jg(u)),[Ws]:u}),this.Si()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Xs),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Xs),null==(i=this._instance.persistence)||i.register({[Xs]:n}),t(n)}}})}ki(){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)),{})}}Si(t){var{flags:e,flagVariants:r}=this.ki();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Ks)||{};this._instance.register({[Ks]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ks)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Qs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Qs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Qs)||{};this._instance.register({[Qs]:r({},e,{[t]:{}})})}else this._instance.unregister(Qs)}reset(){this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.$anon_distinct_id=void 0,this.Ci(),this.ui=!1}}var Hg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vg{constructor(t,e){this.Oe=t,this.props={},this.xi=!1,this.Ai=(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.cr=this.Ti(t),this.load(),t.debug&&cs.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Ei}Ti(t){-1===Hg.indexOf(t.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Rp,...t];return r({},Ep,{sr:function(t){try{var e={};try{e=Ap.sr(t)||{}}catch(t){}var r=gs(e,JSON.parse(Ep.nr(t)||"{}"));return Ep.ar(t,r),r}catch(t){}return null},ar:function(t,r,i,n,s,o){try{Ep.ar(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Ap.ar(t,a,i,n,s,o)}catch(t){Ep.ir(t)}},ur:function(t,e){try{null==Un||Un.localStorage.removeItem(t),Ap.ur(t,e)}catch(t){Ep.ir(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Ep.rr()?Ep:"localstorage+cookie"===i&&e.rr()?e:"sessionstorage"===i&&Op.rr()?Op:"memory"===i?Mp:"cookie"===i?Ap:e.rr()?e:Ap}properties(){var t={};return ps(this.props,(function(e,r){if(r===Ws&&ti(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else o=r,a=!1,(si(s=vo)?a:Kn&&s.indexOf===Kn?-1!=s.indexOf(o):(ps(s,(function(t){if(a||(a=t===o))return vs})),a))||(t[r]=e);var s,o,a})),t}load(){if(!this.Ei){var t=this.cr.sr(this.Ai);t&&(this.props=gs({},t))}}save(){this.Ei||this.cr.ar(this.Ai,this.props,this.Ri,this.Ni,this.Mi,this.Oe.debug)}remove(){this.cr.ur(this.Ai,!1),this.cr.ur(this.Ai,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(ti(t)){ri(e)&&(e="None"),this.Ri=ri(r)?this.Fi:r;var i=!1;if(ps(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(ti(t)){this.Ri=ri(e)?this.Fi:e;var r=!1;if(ps(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.xi){var t=ag(this.Oe.custom_campaign_params,this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties);ei(_s(t))||this.register(t),this.xi=!0}}update_search_keyword(){var t;this.register((t=null==ts?void 0:ts.referrer)?lg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:cg(),$referring_domain:null!=ts&&ts.referrer&&(null==(t=As(ts.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[ao]||this.register_once({[uo]:dg(this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ps([ao,oo],(e=>{var r=this.props[e];r&&ps(r,(function(e,r){t["$initial_"+Gr(r)]=e}))}));var e,r,i=this.props[uo];if(i){var n=(e=vg(i),r={},ps(e,(function(t,e){r["$initial_"+Gr(e)]=t})),r);gs(t,n)}return t}safe_merge(t){return ps(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Fi=this.Ri=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.Ti(t),n=this.props;this.clear(),this.cr=i,this.props=n,this.save()}}set_disabled(t){this.Ei=t,this.Ei?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ni&&(this.Ni=t,this.remove(),this.save())}set_secure(t){t!==this.Mi&&(this.Mi=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Ls]||{};r[t]=e,this.props[Ls]=r,this.save()}remove_event_timer(t){var e=(this.props[Ls]||{})[t];return ri(e)||(delete this.props[Ls][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var zg=ds("[Product Tours]"),Gg="ph_product_tours";class Yg{constructor(t){this.Oi=null,this.Pi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Vs]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.Oi||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Vs))||this.gr((()=>this.Li()))}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?zg.error("Could not load product tours script",e):t()}))}Li(){var t;!this.Oi&&null!=(t=os.__PosthogExtensions__)&&t.generateProductTours&&(this.Oi=os.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Jr(this.Pi)||e){var r=this._instance.persistence;if(r){var i=r.props[Gg];if(Jr(i)&&!e)return this.Pi=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return zg.error(n),void t([],{isLoaded:!1,error:n})}var s=Jr(e.json.product_tours)?e.json.product_tours:[];this.Pi=s,r&&r.register({[Gg]:s}),t(s,{isLoaded:!0})}})}else t(this.Pi,{isLoaded:!0})}getActiveProductTours(t){oi(this.Oi)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Oi.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Oi)||e.showTourById(t)}previewTour(t){this.Oi?this.Oi.previewTour(t):this.gr((()=>{var e;this.Li(),null==(e=this.Oi)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Oi)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Oi)||t.nextStep()}previousStep(){var t;null==(t=this.Oi)||t.previousStep()}clearCache(){var t;this.Pi=null,null==(t=this._instance.persistence)||t.unregister(Gg)}resetTour(t){var e;null==(e=this.Oi)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Oi)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Oi)||e.cancelPendingTour(t)}}class Ug{constructor(){this.Di={},this.Di={}}on(t,e){return this.Di[t]||(this.Di[t]=[]),this.Di[t].push(e),()=>{this.Di[t]=this.Di[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Di[t]||[])r(e);for(var i of this.Di["*"]||[])i(t,e)}}function Wg(t,e,r){if(oi(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 Xg{constructor(t){this.Bi=new Ug,this.ji=(t,e)=>this.$i(t,e)&&this.Zi(t,e)&&this.qi(t,e)&&this.Hi(t,e),this.$i=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Vi=new Set,this.zi=new Set}init(){var t;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)){var e;null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zi)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Vi)||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.Vi.has(t)||this.Vi.has(null==e?void 0:e.event))&&this.zi&&(null==(r=this.zi)?void 0:r.size)>0&&this.zi.forEach((t=>{this.Gi(e,t)&&this.Bi.emit("actionCaptured",t.name)}))}Yi(t){this.onAction("actionCaptured",(e=>t(e)))}Gi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.ji(t,r))return!0;return!1}onAction(t,e){return this.Bi.on(t,e)}Zi(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(!Wg(i,e.url,e.url_matching||"contains"))return!1}return!0}qi(t,e){return!!this.Ui(t,e)&&(!!this.Wi(t,e)&&!!this.Xi(t,e))}Ui(t,e){var r;if(null==e||!e.href)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Wg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Wg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Wi(t,e){var r;if(null==e||!e.text)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Wg(t.text,e.text,e.text_matching||"exact")||Wg(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;!oi(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=>Wg(t,s,o))))}Xi(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}Ji(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Hi(t,e){return null==e||!e.properties||0===e.properties.length||Jl(e.properties.reduce(((t,e)=>{var r=Jr(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 Jg{constructor(t){this._instance=t,this.Ki=new Map,this.Qi=new Map,this.tn=new Map}en(t,e){return!!t&&Jl(t.propertyFilters,null==e?void 0:e.properties)}rn(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}nn(t,e,r){var i=(r===Au.Activation?this.Ki:this.Qi).get(t),n=[];return this.sn((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.en(s,e)}))}register(t){var e;ri(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.an(t),this.un(t))}un(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.ln){this.ln=new Xg(this._instance),this.ln.init();this.ln.Yi((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.ln)||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.tn.get(e.name);r&&r.push(t.id),this.tn.set(e.name,r||[t.id])}})))}))}}an(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Ki=this.rn(t,Au.Activation),this.Qi=this.rn(t,Au.Cancellation)}}onEvent(t,e){var r,i=this.ct(),n=this.hn(),s=this.cn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=o.indexOf(l);h>=0&&(o.splice(h,1),this.dn(o))}}else{if(this.Qi.has(t)){var c=this.nn(t,e,Au.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);e>=0&&o.splice(e,1),this.vn(t.id)})),this.dn(o))}if(this.Ki.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Ki.get(t)});var d=this.nn(t,e,Au.Activation);this.dn(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.hn(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.tn.has(t)&&this.dn(i.concat(this.tn.get(t)||[]))}dn(t){var e,r=this.ct(),i=this.hn(),n=[...new Set(t)].filter((t=>!this.fn(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.hn(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Ki}pn(){return this.ln}}class Kg extends Jg{constructor(t){super(t)}hn(){return"$surveys_activated"}cn(){return Pu.SHOWN}sn(t){var e;null==(e=this._instance)||e.getSurveys(t)}vn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ct(){return Bu}fn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Qg{constructor(t){this.gn=void 0,this._surveyManager=null,this.mn=!1,this.yn=[],this.bn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(oi(e))return Bu.warn("Flags not loaded yet. Not loading surveys.");var r=Jr(e);this.gn=r?e.length>0:e,Bu.info("flags response received, isSurveysEnabled: "+this.gn),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(qu)||null!=r&&r.startsWith(Hu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.mn)Bu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Bu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==os?void 0:os.__PosthogExtensions__;if(t){if(!ri(this.gn)||this._instance.config.advanced_enable_surveys){var e=this.gn||this._instance.config.advanced_enable_surveys;this.mn=!0;try{var r=t.generateSurveys;if(r)return void this.wn(r,e);var i=t.loadExternalDependency;if(!i)return void this._n("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this._n("Could not load surveys script",r):this.wn(t.generateSurveys,e)}))}catch(t){throw this._n("Error initializing surveys",t),t}finally{this.mn=!1}}}else Bu.error("PostHog Extensions not found.")}}wn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Kg(this._instance),Bu.info("Surveys loaded successfully"),this.Cn({isLoaded:!0})}_n(t,e){Bu.error(t,e),this.Cn({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.yn.push(t),this._surveyManager&&this.Cn({isLoaded:!0}),()=>{this.yn=this.yn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(to);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.bn?this.bn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.bn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.bn=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Bu.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,u=e.json.surveys||[],l=u.filter((t=>ju(t)&&($u(t)||Zu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[to]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Cn(t){for(var e of this.yn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!oi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bu.warn("init was not called")}In(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}Sn(t){if(oi(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.In(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(oi(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Sn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return oi(this._surveyManager)?(Bu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.Sn(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n="string"==typeof t?this.In(t):t;if(null!=n&&n.id)if(Uu.includes(n.type)){var s=null==ts?void 0:ts.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Bu.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),Bu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Bu.warn("Survey element not found")}else Bu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bu.warn("Survey not found")}}displaySurvey(t,e){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n=this.In(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!==Du.Popover&&e.initialResponses&&Bu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Bu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Du.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Bu.warn("Survey not found")}}cancelPendingSurvey(t){oi(this._surveyManager)?Bu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var tm=ds("[Conversations]");class em{constructor(t){this.kn=void 0,this._conversationsManager=null,this.xn=!1,this.An=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;oi(e)||(li(e)?this.kn=e:(this.kn=e.enabled,this.An=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.kn=void 0,this.An=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==os?void 0:os.__PosthogExtensions__;if(t&&!ri(this.kn)&&this.kn)if(this.An&&this.An.token){this.xn=!0;try{var e=t.initConversations;if(e)return this.Tn(e),void(this.xn=!1);var r=t.loadExternalDependency;if(!r)return void this.En("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.En("Could not load conversations script",e):this.Tn(t.initConversations),this.xn=!1}))}catch(t){this.En("Error initializing conversations",t),this.xn=!1}}else tm.error("Conversations enabled but missing token in remote config.")}}Tn(t){if(this.An)try{this._conversationsManager=t(this.An,this._instance),tm.info("Conversations loaded successfully")}catch(t){this.En("Error completing conversations initialization",t)}else tm.error("Cannot complete initialization: remote config is null")}En(t,e){tm.error(t,e),this._conversationsManager=null,this.xn=!1}show(){this._conversationsManager?this._conversationsManager.show():tm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.kn&&!si(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):(tm.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(tm.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(tm.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(tm.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class rm{constructor(t){var e;this.Rn=!1,this.Nn=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Rn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!oi(r)&&r&&(this.Rn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Rn&&!this.Nn){var t=ds("[logs]"),e=null==os?void 0:os.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=e.logs)||!i.initializeLogs?t.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.Nn=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var im=ds("[RateLimiter]");class nm{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=>{im.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void im.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(so))&&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 u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(so,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var sm=ds("[RemoteConfig]");class om{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mn(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(sm.error("PostHog Extensions not found. Cannot load remote config."),t())}Fn(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 sm.info("Using preloaded remote config",this.remoteConfig),void this.Ii(this.remoteConfig);if(this._instance.De())return void sm.warn("Remote config is disabled. Falling back to local config.");this.Mn((t=>{if(!t)return sm.info("No config found after loading remote JS config. Falling back to JSON."),void this.Fn((t=>{this.Ii(t)}));this.Ii(t)}))}catch(t){sm.error("Error loading remote config",t)}}Ii(t){t?this._instance.config.__preview_remote_config?(this._instance.Ii(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):sm.info("__preview_remote_config is disabled. Logging config instead",t):sm.error("Failed to fetch remote config from PostHog.")}}var am=3e3;class um{constructor(t,e){this.On=!0,this.Pn=[],this.Ln=yi((null==e?void 0:e.flush_interval_ms)||am,250,5e3,cs.createLogger("flush interval"),am),this.Dn=t}enqueue(t){this.Pn.push(t),this.Bn||this.jn()}unload(){this.$n();var t=this.Pn.length>0?this.Zn():{},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.Dn(r({},t,{transport:"sendBeacon"}))}))}enable(){this.On=!1,this.jn()}jn(){var t=this;this.On||(this.Bn=setTimeout((()=>{if(this.$n(),this.Pn.length>0){var e=this.Zn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Jr(r.data)&&ps(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dn(r)};for(var i in e)r()}}),this.Ln))}$n(){clearTimeout(this.Bn),this.Bn=void 0}Zn(){var t={};return ps(this.Pn,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;ri(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Pn=[],t}}var lm=["retriesPerformedSoFar"];class hm{constructor(t){this.qn=!1,this.Hn=3e3,this.Pn=[],this._instance=t,this.Pn=[],this.Vn=!0,!ri(Un)&&"onLine"in Un.navigator&&(this.Vn=Un.navigator.onLine,this.zn=()=>{this.Vn=!0,this.Yr()},this.Gn=()=>{this.Vn=!1},xs(Un,"online",this.zn),xs(Un,"offline",this.Gn))}get length(){return this.Pn.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,lm);ui(e)&&(n.url=Hl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Yn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Yn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Pn.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cs.warn(n),this.qn||(this.qn=!0,this.Un())}Un(){if(this.Wn&&clearTimeout(this.Wn),0===this.Pn.length)return this.qn=!1,void(this.Wn=void 0);this.Wn=setTimeout((()=>{this.Vn&&this.Pn.length>0&&this.Yr(),this.Un()}),this.Hn)}Yr(){var t=Date.now(),e=[],r=this.Pn.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Pn=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Wn&&(clearTimeout(this.Wn),this.Wn=void 0),this.qn=!1,ri(Un)||(this.zn&&(Un.removeEventListener("online",this.zn),this.zn=void 0),this.Gn&&(Un.removeEventListener("offline",this.Gn),this.Gn=void 0)),this.Pn))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){cs.error(t)}this.Pn=[]}}class cm{constructor(t){this.Xn=()=>{var t,e,r,i;this.Jn||(this.Jn={});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),u=(null==n?void 0:n.scrollHeight)||0;this.Jn.lastScrollY=Math.ceil(s),this.Jn.maxScrollY=Math.max(s,null!==(t=this.Jn.maxScrollY)&&void 0!==t?t:0),this.Jn.maxScrollHeight=Math.max(o,null!==(e=this.Jn.maxScrollHeight)&&void 0!==e?e:0),this.Jn.lastContentY=a,this.Jn.maxContentY=Math.max(a,null!==(r=this.Jn.maxContentY)&&void 0!==r?r:0),this.Jn.maxContentHeight=Math.max(u,null!==(i=this.Jn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Jn}resetContext(){var t=this.Jn;return setTimeout(this.Xn,0),t}startMeasuringScrollPosition(){xs(Un,"scroll",this.Xn,{capture:!0}),xs(Un,"scrollend",this.Xn,{capture:!0}),xs(Un,"resize",this.Xn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Un?void 0:Un.document.documentElement;var t=Jr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Un?void 0:Un.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Un&&(Un.scrollY||Un.pageYOffset||Un.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Un&&(Un.scrollX||Un.pageXOffset||Un.document.documentElement.scrollLeft)||0}}var dm=t=>dg(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class vm{constructor(t,e,r,i){this.Kn=t=>{var e=this.Qn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ts(this._instance)};this.es.register({[no]:r})}},this._instance=t,this.rs=e,this.es=r,this.ts=i||dm,this.rs.onSessionId(this.Kn)}Qn(){return this.es.props[no]}getSetOnceProps(){var t,e=null==(t=this.Qn())?void 0:t.props;return e?"r"in e?vg(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ps(_s(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Gr(r)]=e})),t}}var fm=ds("[SessionId]");class pm{on(t,e){return this.ns.on(t,e)}constructor(t,e,r){var i;if(this.ss=[],this.os=void 0,this.ns=new Ug,this.us=(t,e)=>!(!ui(t)||!ui(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oe=t.config,this.es=t.persistence,this.ls=void 0,this.hs=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.cs=e||rl,this.ds=r||rl;var n=this.Oe.persistence_name||this.Oe.token,s=this.Oe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yi(s,60,36e3,fm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vs(),this.fs="ph_"+n+"_window_id",this.ps="ph_"+n+"_primary_window_exists",this.gs()){var o=Op.sr(this.fs),a=Op.sr(this.ps);o&&!a?this.ls=o:Op.ur(this.fs),Op.ar(this.ps,!0)}if(null!=(i=this.Oe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.Oe.bootstrap.sessionID);this.ys(this.Oe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){fm.error("Invalid sessionID in bootstrap",t)}this.bs()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ri(this.ss)&&(this.ss=[]),this.ss.push(t),this.hs&&t(this.hs,this.ls),()=>{this.ss=this.ss.filter((e=>e!==t))}}gs(){return"memory"!==this.Oe.persistence&&!this.es.Ei&&Op.rr()}ws(t){t!==this.ls&&(this.ls=t,this.gs()&&Op.ar(this.fs,t))}_s(){return this.ls?this.ls:this.gs()?Op.sr(this.fs):null}ys(t,e,r){t===this.hs&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.hs=t,this.es.register({[Ys]:[e,t,r]}))}Cs(){var t=this.es.props[Ys];return Jr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ys(null,null,null)}destroy(){clearTimeout(this.Is),this.Is=void 0,this.os&&Un&&(Un.removeEventListener("beforeunload",this.os,{capture:!1}),this.os=void 0),this.ss=[]}bs(){this.os=()=>{this.gs()&&Op.ur(this.ps)},xs(Un,"beforeunload",this.os,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.Oe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.Cs(),o=this._s(),a=ui(s)&&Math.abs(r-s)>864e5,u=!1,l=!n,h=!l&&!t&&this.us(r,i);l||h||a?(n=this.cs(),o=this.ds(),fm.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,u=!0):o||(o=this.ds(),u=!0);var c=!!ui(i)&&t&&!a?i:r,d=!ui(s)?(new Date).getTime():s;return this.ws(o),this.ys(n,c,d),t||this.vs(),u&&this.ss.forEach((t=>t(n,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}vs(){clearTimeout(this.Is),this.Is=setTimeout((()=>{var[t]=this.Cs();if(this.us((new Date).getTime(),t)){var e=this.hs;this.resetSessionId(),this.ns.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var gm=["$set_once","$set"],mm=ds("[SiteApps]");class ym{constructor(t){this._instance=t,this.Ss=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ks(t,e){if(e){var r=this.globalsForEvent(e);this.Ss.push(r),this.Ss.length>1e3&&(this.Ss=this.Ss.slice(10))}}get siteAppLoaders(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ks.bind(this));this.xs=()=>{t(),this.Ss=[],this.xs=void 0}}}globalsForEvent(t){var e,n,s,o,a,u,l;if(!t)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,gm),{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==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Ss.length&&(mm.info("Processing "+this.Ss.length+" events for site app with id "+t.id),this.Ss.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.xs)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,mm.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback:t=>{n(t)}});s&&(e.processEvent=s),i=!0}catch(e){mm.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){mm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}As(){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)}Ts(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){mm.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.As(),void this._instance.on("eventCaptured",(t=>this.Ts(t)))):void mm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.xs)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;os["__$$ph_site_app_"+t]=n._instance,null==(e=os.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return mm.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else mm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var bm=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Hr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Hr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},wm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),_m="i.posthog.com";class Cm{constructor(t){this.Es={},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("."+_m,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Es[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=wm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=wm.EU:this.Es[this.apiHost]=wm.CUSTOM),this.Es[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===wm.CUSTOM)return this.apiHost+e;var r=_m+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Im={icontains:(t,e)=>!!Un&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Un&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Un&&Yl(e.href,t),not_regex:(t,e)=>!!Un&&!Yl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Sm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Sm.Rs("retrieved web experiments from the server"),e.Ns=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Ns)Sm.Rs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ns)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&e.Ms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Sm.Fs(s)&&e.Ms(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Sm.Rs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(oi(this.Ns))return this.Ns=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Sm.Rs("applying feature flags",t),t.forEach((t=>{var e;if(this.Ns&&null!=(e=this.Ns)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ns)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Sm.getWindowLocation();if(null!=t&&t.search){var e=Es(null==t?void 0:t.search,"__experiment_id"),r=Es(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Sm.Rs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Os(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Os(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Sm.Rs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ms(i[0].name,e,i[0].variants[e].transforms))}static Fs(t){return!oi(t.conditions)&&(Sm.Ps(t)&&Sm.Ls(t))}static Ps(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Sm.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Im[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Un?void 0:Un.location}static Ls(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.utm))return!0;var r=ag();if(r.utm_source){var i,n,s,o,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(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==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Rs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+t,r)}Ms(t,e,r){this._is_bot()?Sm.Rs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Sm.Rs("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)}))}})):Sm.Rs("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?bm(Qn,this._instance.config.custom_blocked_useragents):void 0}}var km=ds("[PostHog ExternalIntegrations]"),xm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Am{constructor(t){this._instance=t}gr(t,e){var r;null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return km.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;(!i||null!=(r=os.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.gr(xm[e],(()=>{var r;null==(r=os.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=os.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(s=os.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}ds("[SessionRecording]");var Tm="[SessionRecording]",Em=ds(Tm);class Rm{get started(){var t;return!(null==(t=this.Ds)||!t.isStarted)}get status(){return this.Ds?this.Ds.status:this.Bs&&!this.js?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Bs=!1,this.$s=!1,this.Zs=void 0,this._instance=t,!this._instance.sessionManager)throw Em.error("started without valid sessionManager"),new Error(Tm+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Tm+' cannot be used with cookieless_mode="always"')}get js(){var t,e=!(null==(t=this._instance.get_property(Gs))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Un&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.js||null==(e=this.Ds)||!e.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this.js&&r?(this.qs(t),Em.info("starting")):this.stopRecording()}}qs(t){var e,r,i;this.js&&(null!=os&&null!=(e=os.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=os.__PosthogExtensions__)&&r.initSessionRecording?this.Hs(t):null==(i=os.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Vs,(e=>{if(e)return Em.error("could not load recorder",e);this.Hs(t)})))}stopRecording(){var t,e;null==(t=this.Zs)||t.call(this),this.Zs=void 0,null==(e=this.Ds)||e.stop()}zs(){var t;null==(t=this._instance.persistence)||t.unregister(Us)}Gs(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,s=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,s=oi(i)?null:parseFloat(i);oi(s)&&this.zs();var o=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Gs]:r({cache_timestamp:Date.now(),enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ri(o)?null:o,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};s(),null==(e=this.Zs)||e.call(this),this.Zs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.$s=!1,this.Gs(t),this.Bs=!0,this.startIfEnabledOrStop()):this.Bs=!0:Em.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Ds)&&r.log?this.Ds.log(t,e):Em.warn("log called before recorder was ready")}get Vs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Gs);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ys(){var t,e=this._instance.get_property(Gs);if(!e)return!1;var r=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return Date.now()-r<=3e5}Hs(t){var e,r;if(null==(e=os.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Ds||(this.Ds=null==(r=os.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Ds._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Ys()?this.Ds.start(t):this.$s||(this.$s=!0,Em.info("persisted remote config is stale, requesting fresh config before starting"),new om(this._instance).load())}onRRwebEmit(t){var e;null==(e=this.Ds)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.Ds)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.Ds)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Ds||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.Ds)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ds)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Ds)||!r.tryAddCustomEvent(t,e))}}var Nm={},Mm=()=>{},Fm="posthog",Om=!Zl&&-1===(null==ss?void 0:ss.indexOf("MSIE"))&&-1===(null==ss?void 0:ss.indexOf("Mozilla")),Pm=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ss(null==ts?void 0:ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Mm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:es&&ii(null==es?void 0:es.search)&&-1!==es.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Un||null==(e=Un.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;cs.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:am},error_tracking:{},_onCapture:Mm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Lm=t=>{var e={};ri(t.process_person)||(e.person_profiles=t.process_person),ri(t.xhr_headers)||(e.request_headers=t.xhr_headers),ri(t.cookie_name)||(e.persistence_name=t.cookie_name),ri(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ri(t.store_google)||(e.save_campaign_params=t.store_google),ri(t.verbose)||(e.debug=t.verbose);var r=gs({},e,t);return Jr(t.property_blacklist)&&(ri(t.property_denylist)?r.property_denylist=t.property_blacklist:Jr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:cs.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Dm{constructor(){this.__forceAllowLocalhost=!1}get Us(){return this.__forceAllowLocalhost}set Us(t){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Dm,this.Ws=!1,this.version=ls.LIB_VERSION,this.wi=new Ug,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Pm(),this.SentryIntegration=Up,this.sentryIntegration=t=>function(t,e){var r=Yp(t,e);return{name:Gp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Xs=!1,this.Js=null,this.Ks=null,this.Qs=null,this.featureFlags=new qg(this),this.toolbar=new Qp(this),this.scrollManager=new cm(this),this.pageViewManager=new Ig(this),this.surveys=new Qg(this),this.conversations=new em(this),this.logs=new rm(this),this.experiments=new Sm(this),this.exceptions=new Sf(this),this.rateLimiter=new nm(this),this.requestRouter=new Cm(this),this.consent=new Lp(this),this.externalIntegrations=new Am(this),this.people={set:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>cs.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Fm){var i,n=null!==(i=Nm[r])&&void 0!==i?i:new Bm;return n._init(t,e,r),Nm[r]=n,Nm[Fm][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ri(t)||ni(t))return cs.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.eo(e.debug),this.ro=e,this.io=[],e.person_profiles&&(this.Ks=e.person_profiles),this.set_config(gs({},Pm(e.defaults),Lm(e),{name:i,token:t})),this.config.on_xhr_error&&cs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:sl.GZipJS;var s=this.no();this.persistence=new Vg(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vg(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.so=new um((t=>this.oo(t)),this.config.request_queue_config),this.ao=new hm(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new pm(this),this.sessionPropsManager=new vm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.uo(u)}),0)):(cs.info("Initializing extensions synchronously"),this.uo(u)),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&cs.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(rl()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(io,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.lo()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:co,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(rl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(io,"anonymous")}return xs(Un,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?zp(this,(()=>this.ho())):this.ho(),Kr(this.config._onCapture)&&this.config._onCapture!==Mm&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&cs.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}uo(t){var e=performance.now();this.historyAutocapture=new Hp(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new eg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new ym(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Rm(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new mp(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Yg(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Cg(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new bg(this)})),r.push((()=>{this.exceptionObserver=new qp(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new $p(this,jp),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this.co){var t=this.co;this.co=void 0,this.Ii(t)}})),this.do(r,e)}do(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.do(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){cs.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Ii(t){var e,r,i,n,s,o,a,u,l;if(!ts||!ts.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ii(t)}),500);this.config.__preview_deferred_init_extensions&&(this.co=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(t.supportedCompression,sl.GZipJS)?sl.GZipJS:Vr(t.supportedCompression,sl.Base64)?sl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ks?this.Ks:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(s=this.heatmaps)||s.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(o=this.productTours)||o.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}ho(){try{this.config.loaded(this)}catch(t){cs.critical("`loaded` function failed",t)}if(this.vo(),this.config.internal_or_test_user_hostname&&null!=es&&es.hostname){var t=es.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()||"always"===this.config.cookieless_mode)&&this.fo()}),1),new om(this).load(),this.featureFlags.flags()}vo(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.so)||t.enable()))}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(t=>this.oo(t))),this.__request_queue=[],this.vo()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.po()&&this.capture("$pageleave"),null==(t=this.so)||t.unload(),null==(e=this.ao)||e.unload()):this.po()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Om?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Hl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4,s.url=Hl(s.url,{_:(new Date).getTime().toString(),ver:ls.LIB_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Gl.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),u=null!==(i=null==(n=ks(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(s)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}oo(t){this.ao?this.ao.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];fs(t,(t=>{t&&(e=t[0],Jr(e)?n.push(t):Kr(t)?t.call(this):Jr(t)&&"alias"===e?r.push(t):Jr(t)&&-1!==e.indexOf("capture")&&Kr(this[e])?n.push(t):i.push(t))}));var s=function(t,e){fs(t,(function(t){if(Jr(t[0])){var r=e;ps(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};s(r,this),s(i,this),s(n,this)}lo(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.so){if(this.is_capturing())if(!ri(t)&&ii(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!ii(null==e?void 0:e.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(null==i?void 0:i.timestamp)||a,l=rl(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.mo(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=Cs(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ri(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Pu.DISMISSED||t===Pu.SENT){var v=null==e?void 0:e[Lu.SURVEY_ID],f=null==e?void 0:e[Lu.SURVEY_ITERATION];Yu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Vu({id:v,current_iteration:f},t===Pu.SENT?"responded":"dismissed")]:!0})}else t===Pu.SHOWN&&(h.$set=r({},h.$set,{[Lu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(ei(p)||this.setPersonPropertiesForFlags(p),!oi(this.config.before_send)){var g=this.yo(h);if(!g)return;h=g}this.wi.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.oo(m):this.so.enqueue(m),h}cs.critical("This capture call is ignored due to client rate limiting.")}}else cs.error("No event name provided to posthog.capture")}else cs.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&cs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=gg(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&gs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.ao)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===wm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,l),"$pageview"===t&&ts&&(a.title=ts.title),!ri(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}ss&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=gs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Jr(this.config.property_denylist)?ps(this.config.property_denylist,(function(t){delete a[t]})):cs.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.bo();return a.$process_person_profile=g,g&&!s&&this.wo("_calculate_event_properties"),a}mo(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.bo())return t;if(this.Ws)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=gs({},i,n||{},t||{}),o=this.config.sanitize_properties;return o&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),e&&(this.Ws=!0),ei(s)?void 0:s}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)}_o(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){return this.featureFlags.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ri(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.wi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Wu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if(ai(t)&&(t=t.toString(),cs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==co){if(this.wo("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==n&&t!==this.get_property(Ps)&&(this.unregister(Ps),this.register({distinct_id:t}));var o="anonymous"===(this.persistence.get_property(io)||"anonymous");t!==n&&o?(this.persistence.set_property(io,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Qs=Ul(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(eo))}}else cs.critical('The string "'+co+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else cs.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.wo("posthog.setPersonProperties")){var i=Ul(this.get_distinct_id(),t,e);this.Qs!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Qs=i):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else cs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.wo("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(cs.info("reset"),!this.__loaded)return cs.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(io,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Qs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:co,$device_id:null},"");else{var o=this.config.get_device_id(rl());this.register_once({distinct_id:o,$device_id:t?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,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(Os)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.wo("posthog.alias")?(ri(e)&&(e=this.get_distinct_id()),t!==e?(this._o(Ps,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(ti(t)){var i,n,s,o,a,u,l,h;gs(this.config,Lm(t));var c=this.no();null==(i=this.persistence)||i.update_config(this.config,e,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vg(r({},this.config,{persistence:"sessionStorage"}),c);var d=this.eo(this.config.debug);li(d)&&(this.config.debug=d),li(this.config.debug)&&(this.config.debug?(ls.DEBUG=!0,Ep.rr()&&Ep.ar("ph_debug","true"),cs.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ls.DEBUG=!1,Ep.rr()&&Ep.ur("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Co(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Fm;return e!==Fm&&(e=Fm+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(io))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(io))}bo(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ei(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Ps])&&(null==(e=this.persistence)||null==(e=e.props)||!e[lo]))}po(){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.bo()||this.wo("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wo("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wo(t){return"never"===this.config.person_profiles?(cs.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._o(lo,!0),!0)}no(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Co(){var t,e,r,i,n=this.no();(null==(t=this.persistence)?void 0:t.Ei)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Ei)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new pm(this),this.pageViewManager=new Ig(this),this.persistence&&(this.sessionPropsManager=new vm(this,this.sessionManager,this.persistence)),this.sessionRecording=new Rm(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Co(),this.vo(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.fo()}else cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Co(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:co,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.fo())):cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Pp.GRANTED?"granted":t===Pp.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Co()}_is_bot(){return Qn?bm(Qn,this.config.custom_blocked_useragents):void 0}fo(){ts&&("visible"===ts.visibilityState?this.Xs||(this.Xs=!0,this.capture("$pageview",{title:ts.title},{send_instantly:!0}),this.Js&&(ts.removeEventListener("visibilitychange",this.Js),this.Js=null)):this.Js||(this.Js=this.fo.bind(this),xs(ts,"visibilitychange",this.Js)))}debug(t){!1===t?(null==Un||Un.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Un||Un.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}))}De(){var t,e,r,i,n,s,o,a=this.ro||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=cs,s=(e="advanced_disable_flags")in(t=a)&&!oi(t[e]),o=r in t&&!oi(t[r]),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]):i)}yo(t){if(oi(this.config.before_send))return t;var e=Jr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),oi(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return ci(t.event)?cs.warn(n+". This can cause unexpected behavior."):cs.info(n),null}r.properties&&!ei(r.properties)||cs.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.ni)?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)})}eo(t){var e=li(t)&&!t,r=Ep.rr()&&"true"===Ep.nr("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=ws(t.prototype[e[r]])}(Bm,["identify"]);var jm,$m={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Zm=(jm=Nm[Fm]=new Bm,function(){function t(){t.done||(t.done=!0,Om=!1,ps(Nm,(function(t){t._dom_loaded()})))}null!=ts&&ts.addEventListener?"complete"===ts.readyState?t():xs(ts,"DOMContentLoaded",t,{capture:!1}):Un&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),jm);export{sl as Compression,$m as DEFAULT_PRODUCT_TOUR_APPEARANCE,Du as DisplaySurveyType,Bm as PostHog,Pu as SurveyEventName,Lu as SurveyEventProperties,Au as SurveyEventType,Eu as SurveyPosition,Fu as SurveyQuestionBranchingType,Mu as SurveyQuestionType,Ou as SurveySchedule,Ru as SurveyTabPosition,Nu as SurveyType,Tu as SurveyWidgetType,Zm as default,Zm as posthog,nl as severityLevels};
|
|
1
|
+
function t(t,e,r,i,n,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,u,"next",e)}function u(e){t(s,n,o,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,r,i,n,o,s)=>{var a,u=i||o||s,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var o=i(V);if(","===o.slice(-1))o=Y(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=Y(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var M=I(t.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=E in n?n[E]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:R=!0}=e;E||(E=Q(t,s,a,void 0===E));var M,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;M=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:M});if(i.add(t,O),M===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(C(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?st[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ut[n]=s,s.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Mt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),$t=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))($t||{}),jt=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(jt||{}),Zt=(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))(Zt||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&qt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ut(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Wt(this.droppedSet,s)||Ut(this.removes,s,this.mirror)?Wt(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=R(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===h?l:[l,h]:s._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=$t.Mouse;break;case"touch":u=$t.Touch;break;case"pen":u=$t.Pen}u===$t.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):$t.Pen}else Tt(i)&&(u=$t.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===$t.Touch||l.startsWith("Mouse")&&u===$t.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),o.media||500))),u=[ft("play",a(Zt.Play),s),ft("pause",a(Zt.Pause),s),ft("seeked",a(Zt.Seeked),s),ft("volumechange",a(Zt.VolumeChange),s),ft("ratechange",a(Zt.RateChange),s)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=o.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=o.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=o.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var u,[l,h,c]=s;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=se(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:oe(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,s)=>{var a,[l]=s;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,o,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));s.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),u=new Map,l=new Re;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:jt["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:o.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:jt["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:jt["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,jt.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,jt.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Mt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function $e(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Vt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=wt(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(s),r);else if(P){var a={type:"rrweb",event:Z(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Lt.FullSnapshot)L=s,j=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&s.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Me({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Rt(t,Be)&&z.trackLinkElement(t),Nt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}$e.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},$e.freezePage=()=>{Kt.forEach((t=>t.freeze()))},$e.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},$e.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var je,Ze=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Ue?Ue[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var o=ur(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lr[n]=s,s.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(s in e){var h=e[s];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==(je=xr.contentWindow)?void 0:je.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Rr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Mr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Mr(u.length?u[0]:null):s[a]=u}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:h,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),$r=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),jr=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Zr(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var qr=["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"],Hr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return qr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Vr(t,e){return-1!==t.indexOf(e)}var zr=function(t){return t.trim()},Gr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Ur=Object.prototype,Wr=Ur.hasOwnProperty,Xr=Ur.toString,Jr=Yr||function(t){return"[object Array]"===Xr.call(t)},Kr=t=>"function"==typeof t,Qr=t=>Kr(t)&&-1!==t.toString().indexOf("[native code]"),ti=t=>t===Object(t)&&!Jr(t),ei=t=>{if(ti(t)){for(var e in t)if(Wr.call(t,e))return!1;return!0}return!1},ri=t=>void 0===t,ii=t=>"[object String]"==Xr.call(t),ni=t=>ii(t)&&0===t.trim().length,oi=t=>null===t,si=t=>ri(t)||oi(t),ai=t=>"[object Number]"==Xr.call(t)&&t==t,ui=t=>ai(t)&&t>0,li=t=>"[object Boolean]"===Xr.call(t),hi=t=>t instanceof FormData,ci=t=>Vr(jr,t);function di(t){return null===t||"object"!=typeof t}function vi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fi(t){return!ri(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var pi=[!0,"true",1,"1","yes"],gi=t=>Vr(pi,t),mi=[!1,"false",0,"0","no"];function yi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ai(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),yi(n||r,e,r,i))}class bi{constructor(t){this.C={},this.I=t.I,this.S=yi(t.bucketSize,0,100,t.k),this.A=yi(t.refillRate,0,this.S,t.k),this.T=yi(t.refillInterval,0,864e5,t.k)}R(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.T);if(i>0){var n=i*this.A;t.tokens=Math.min(t.tokens+n,this.S),t.lastAccess=t.lastAccess+i*this.T}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.R(n,r):(n={tokens:this.S,lastAccess:r},this.C[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}var wi="Mobile",_i="iOS",Ci="Android",Ii="Tablet",Si=Ci+" "+Ii,ki="iPad",xi="Apple",Ai=xi+" Watch",Ti="Safari",Ei="BlackBerry",Ri="Samsung",Ni=Ri+"Browser",Mi=Ri+" Internet",Fi="Chrome",Oi=Fi+" OS",Pi=Fi+" "+_i,Li="Internet Explorer",Di=Li+" "+wi,Bi="Opera",$i=Bi+" Mini",ji="Edge",Zi="Microsoft "+ji,qi="Firefox",Hi=qi+" "+_i,Vi="Nintendo",zi="PlayStation",Gi="Xbox",Yi=Ci+" "+wi,Ui=wi+" "+Ti,Wi="Windows",Xi=Wi+" Phone",Ji="Nokia",Ki="Ouya",Qi="Generic",tn=Qi+" "+wi.toLowerCase(),en=Qi+" "+Ii.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",on=new RegExp("Version/"+nn),sn=new RegExp(Gi,"i"),an=new RegExp(zi+" \\w+","i"),un=new RegExp(Vi+" \\w+","i"),ln=new RegExp(Ei+"|PlayBook|BB10","i"),hn={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var cn,dn,vn,fn=(t,e)=>e&&Vr(e,xi)||function(t){return Vr(t,Ti)&&!Vr(t,Fi)&&!Vr(t,Ci)}(t),pn=function(t,e){return e=e||"",Vr(t," OPR/")&&Vr(t,"Mini")?$i:Vr(t," OPR/")?Bi:ln.test(t)?Ei:Vr(t,"IE"+wi)||Vr(t,"WPDesktop")?Di:Vr(t,Ni)?Mi:Vr(t,ji)||Vr(t,"Edg/")?Zi:Vr(t,"FBIOS")?"Facebook "+wi:Vr(t,"UCWEB")||Vr(t,"UCBrowser")?"UC Browser":Vr(t,"CriOS")?Pi:Vr(t,"CrMo")||Vr(t,Fi)?Fi:Vr(t,Ci)&&Vr(t,Ti)?Yi:Vr(t,"FxiOS")?Hi:Vr(t.toLowerCase(),rn.toLowerCase())?rn:fn(t,e)?Vr(t,wi)?Ui:Ti:Vr(t,qi)?qi:Vr(t,"MSIE")||Vr(t,"Trident/")?Li:Vr(t,"Gecko")?qi:""},gn={[Di]:[new RegExp("rv:"+nn)],[Zi]:[new RegExp(ji+"?\\/"+nn)],[Fi]:[new RegExp("("+Fi+"|CrMo)\\/"+nn)],[Pi]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[on],[Ui]:[on],[Bi]:[new RegExp("(Opera|OPR)\\/"+nn)],[qi]:[new RegExp(qi+"\\/"+nn)],[Hi]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Ei]:[new RegExp(Ei+" "+nn),on],[Yi]:[new RegExp("android\\s"+nn,"i")],[Mi]:[new RegExp(Ni+"\\/"+nn)],[Li]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},mn=function(t,e){var r=pn(t,e),i=gn[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},yn=[[new RegExp(Gi+"; "+Gi+" (.*?)[);]","i"),t=>[Gi,t&&t[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp(zi,"i"),[zi,""]],[ln,[Ei,""]],[new RegExp(Wi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Xi,""];if(new RegExp(wi).test(e)&&!/IEMobile\b/.test(e))return[Wi+" "+wi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=hn[i]||"";return/arm/i.test(e)&&(n="RT"),[Wi,n]}return[Wi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[_i,e.join(".")]}return[_i,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ri(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ci+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ci+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ci,e.join(".")]}return[Ci,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Oi,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return un.test(t)?Vi:an.test(t)?zi:sn.test(t)?Gi:new RegExp(Ki,"i").test(t)?Ki:new RegExp("("+Xi+"|WPDesktop)","i").test(t)?Xi:/iPad/.test(t)?ki:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ai:ln.test(t)?Ei:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ji,"i").test(t)?Ji:/(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(wi).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)?Ci:Si:new RegExp("(pda|"+wi+")","i").test(t)?tn:new RegExp(Ii,"i").test(t)&&!new RegExp(Ii+" pc","i").test(t)?en:""},wn=function(t){var e=bn(t);return e===ki||e===Si||"Kobo"===e||"Kindle Fire"===e||e===en?Ii:e===Vi||e===Gi||e===zi||e===Ki?"Console":e===Ai?"Wearable":e?wi:"Desktop"},_n=t=>t instanceof Error;function Cn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return vn&&r.length===dn||(dn=r.length,vn=r.reduce(((r,i)=>{cn||(cn={});var n=cn[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,cn[i]=[u,l];break}}return r}),{})),vn}}class In{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),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Jr(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,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(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(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Sn="?";function kn(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?Sn:r,in_app:!0};return ri(i)||(o.lineno=i),ri(n)||(o.colno=n),o}var xn=(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]:Sn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},An=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=(t,e)=>{var r=An.exec(t);if(r){var[,i,n,o]=r;return kn(e,i,Sn,+n,+o)}var s=Tn.exec(t);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=En.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[u,l]=xn(s[1]||Sn,s[2]);return kn(e,l,u,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fn=(t,e)=>{var r=Nn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||Sn;return[o,n]=xn(o,n),kn(e,n,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Pn=50;function Ln(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var o=[],s=e.split("\n"),a=n;a<s.length;a++){var u=s[a];if(!(u.length>1024)){var l=On.test(u)?u.replace(On,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){o.push(c);break}}if(o.length>=Pn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Pn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Sn});var i}))}(o)}}("web:javascript",Rn,Fn)}class Dn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ii(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 vi(t,"DOMException")}isDOMError(t){return vi(t,"DOMError")}}class Bn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class $n{constructor(){}match(t){return vi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var jn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Zn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(jn);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Hn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class Vn{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 fi(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: "+Hn(t)}isSeverityLevel(t){return ii(t)&&!ni(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(_n(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 fi(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return di(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 Yn{match(t){return vi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return di(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(di(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Un="undefined"!=typeof window?window:void 0,Wn="undefined"!=typeof globalThis?globalThis:Un;"undefined"==typeof self&&(Wn.self=Wn),"undefined"==typeof File&&(Wn.File=function(){});var Xn=Array.prototype,Jn=Xn.forEach,Kn=Xn.indexOf,Qn=null==Wn?void 0:Wn.navigator,to=null==Wn?void 0:Wn.document,eo=null==Wn?void 0:Wn.location,ro=null==Wn?void 0:Wn.fetch,io=null!=Wn&&Wn.XMLHttpRequest&&"withCredentials"in new Wn.XMLHttpRequest?Wn.XMLHttpRequest:void 0,no=null==Wn?void 0:Wn.AbortController,oo=null==Qn?void 0:Qn.userAgent,so=null!=Un?Un:{},ao=()=>!!Un.Zone,uo=t=>t instanceof Document,lo={DEBUG:!1,LIB_VERSION:"1.348.0"},ho=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={N:function(e){if(Un&&(lo.DEBUG||so.POSTHOG_DEBUG||r)&&!ri(Un.console)&&Un.console){for(var i=("__rrweb_original__"in Un.console[e]?Un.console[e].__rrweb_original__:Un.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];i(t,...o)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>ho(t+" "+e,r)};return i},co=ho("[PostHog.js]"),vo=co.createLogger,fo={};function po(t,e,r){if(Jr(t))if(Jn&&t.forEach===Jn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===fo)return}function go(t,e,r){if(!si(t)){if(Jr(t))return po(t,e,r);if(hi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===fo)return}else for(var n in t)if(Wr.call(t,n)&&e.call(r,t[n],n)===fo)return}}var mo=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return po(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},yo=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return po(r,(function(e){po(e,(function(e){t.push(e)}))})),t};function bo(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 wo=function(t){try{return t()}catch(t){return}},_o=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){co.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),co.critical(t)}}},Co=function(t){var e={};return go(t,(function(t,r){(ii(t)&&t.length>0||ai(t))&&(e[r]=t)})),e};function Io(t,e){return r=t,i=t=>ii(t)&&!oi(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Jr(e)?(o=[],po(e,(e=>{o.push(t(e))}))):(o={},go(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var So=["herokuapp.com","vercel.app","netlify.app"];function ko(t){var e=null==t?void 0:t.hostname;if(!ii(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of So)if(r===i)return!1;return!0}function xo(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function Ao(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var To=t=>{var e=null==to?void 0:to.createElement("a");return ri(e)?null:(e.href=t,e)},Eo=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return go(t,(function(t,e){ri(t)||ri(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)},Ro=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Jr(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){co.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},No=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Jr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=o&&(v+="#"+o),v},Mo=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Fo(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Oo(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Po="$people_distinct_id",Lo="__alias",Do="__timers",Bo="$autocapture_disabled_server_side",$o="$heatmaps_enabled_server_side",jo="$exception_capture_enabled_server_side",Zo="$error_tracking_suppression_rules",qo="$error_tracking_capture_extension_exceptions",Ho="$web_vitals_enabled_server_side",Vo="$dead_clicks_enabled_server_side",zo="$product_tours_enabled_server_side",Go="$web_vitals_allowed_metrics",Yo="$session_recording_remote_config",Uo="$sesid",Wo="$session_is_sampled",Xo="$enabled_feature_flags",Jo="$early_access_features",Ko="$feature_flag_details",Qo="$stored_person_properties",ts="$stored_group_properties",es="$surveys",rs="$flag_call_reported",is="$feature_flag_errors",ns="$user_state",os="$client_session_props",ss="$capture_rate_limit",as="$initial_campaign_params",us="$initial_referrer_info",ls="$initial_person_info",hs="$epp",cs="__POSTHOG_TOOLBAR__",ds="$posthog_cookieless",vs=[Po,Lo,"__cmpns",Do,"$session_recording_enabled_server_side",$o,Uo,Xo,Zo,ns,Jo,Ko,ts,Qo,es,rs,is,os,ss,as,us,hs,ls,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function fs(t){return t instanceof Element&&(t.id===cs||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ps(t){return!!t&&1===t.nodeType}function gs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ms(t){return!!t&&3===t.nodeType}function ys(t){return!!t&&11===t.nodeType}function bs(t){return t?zr(t).split(/\s+/):[]}function ws(t){var e=null==Un?void 0:Un.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function _s(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 bs(e)}function Cs(t){return si(t)?null:zr(t).split(/(\s+)/).filter((t=>Hs(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Is(t){var e="";return Ps(t)&&!Ls(t)&&t.childNodes&&t.childNodes.length&&go(t.childNodes,(function(t){var r;ms(t)&&t.textContent&&(e+=null!==(r=Cs(t.textContent))&&void 0!==r?r:"")})),zr(e)}function Ss(t){return ri(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ks=["a","button","form","input","select","textarea","label"];function xs(t,e){if(ri(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function As(t){var e=t.parentNode;return!(!e||!ps(e))&&e}var Ts=["next","previous","prev",">","<"],Es=10;var Rs=[".ph-no-rageclick",".ph-no-capture"];function Ns(t,e){if(!Un||Ms(t))return!1;var r,i,n;li(e)?(r=!!e&&Rs,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Rs,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Fs(t,!1);return!function(t,e){if(!1===t||ri(t))return!1;var r;if(!0===t)r=Ts;else{if(!Jr(t))return!1;if(t.length>Es)return co.error("[PostHog] content_ignorelist array cannot exceed "+Es+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,o.map((t=>{var e;return{safeText:Is(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!xs(o,r)}var Ms=t=>!t||gs(t,"html")||!ps(t),Fs=(t,e)=>{if(!Un||Ms(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!gs(n,"body");)if(ys(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=As(n);if(!o)break;if(e||ks.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Un.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function Os(t,e,r,i,n){var o,s,a,u;if(void 0===r&&(r=void 0),!Un||Ms(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!ws(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&ws(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Fs(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ri(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(c,r))return!1;if(!xs(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Un.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ks.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ps(t){for(var e=t;e.parentNode&&!gs(e,"body");e=e.parentNode){var r=_s(e);if(Vr(r,"ph-sensitive")||Vr(r,"ph-no-capture"))return!1}if(Vr(_s(t),"ph-include"))return!0;var i=t.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ls(t){return!!(gs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||gs(t,"select")||gs(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ds="(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})",Bs=new RegExp("^(?:"+Ds+")$"),$s=new RegExp(Ds),js="\\d{3}-?\\d{2}-?\\d{4}",Zs=new RegExp("^("+js+")$"),qs=new RegExp("("+js+")");function Hs(t,e){if(void 0===e&&(e=!0),si(t))return!1;if(ii(t)){if(t=zr(t),(e?Bs:$s).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Zs:qs).test(t))return!1}return!0}function Vs(t){var e=Is(t);return Hs(e=(e+" "+zs(t)).trim())?e:""}function zs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&go(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Is(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+zs(t)).trim())}catch(t){co.error("[AutoCapture]",t)}})),e}function Gs(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return bo(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Ys(e.toString())]=Ys(r.toString())})),n+=":",n+=bo(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Us(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return bo(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Ys(t){return t.replace(/"|\\"/g,'\\"')}function Us(t){var e=t.attr__class;return e?Jr(e)?e:bs(e):void 0}var Ws={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xs=vo("[Recorder]"),Js=t=>"navigation"===t.entryType,Ks=t=>"resource"===t.entryType;function Qs(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Js(t)||Ks(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>sa({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=>Js(t)||Ks(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>sa({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function ta(t,e){return!!e&&(li(e)||e[t])}function ea(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(li(r))return!0;if(Jr(r))return o(r);var s=r[e];return li(s)?s:o(s)}function ra(t,e,r,i,n,o){return ia.apply(this,arguments)}function ia(){return ia=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return Xs.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ks(t)&&t.initiatorType===e&&(ri(i)||t.startTime>=i)&&(ri(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),ra(t,e,r,i,n,o+1))})),ia.apply(this,arguments)}function na(t){var{body:e,options:r,url:i}=t;if(si(e))return null;var{hostname:n,isHostDenied:o}=Oo(i,r);if(o)return n+" is in deny list";if(ii(e))return e;if(uo(e))return e.textContent;if(hi(e))return Eo(e);if(ti(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 oa=t=>!oi(t)&&("navigation"===t.entryType||"resource"===t.entryType);function sa(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(oa(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var aa=["video/","audio/"];function ua(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function la(){return la=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=Oo(i,r);return o?Promise.resolve(n+" is in deny list"):ua(e)})),la.apply(this,arguments)}function ha(){return ha=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=aa.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=Oo(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return oi(n)?ua(e):Promise.resolve(n)})),ha.apply(this,arguments)}function ca(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ta("request",i.recordHeaders),o=ta("response",i.recordHeaders),s=Fo(r,"fetch",(s=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),ea({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return la.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield s(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),ea({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ha.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{ra(r,"fetch",c.url,l,h).then((e=>{var r,i=sa({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var da=null;function va(t,e,i){if(!("performance"in e))return()=>{};if(da)return Xs.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Ws,i):Ws,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Qs(o,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ta("request",r.recordHeaders),n=ta("response",r.recordHeaders),o=Fo(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,h){void 0===u&&(u=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=na({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=na({body:v.response,options:r,url:a})),ra(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=sa({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,s,a.toString(),u,l,h)}));return()=>{o()}}(o,e,n),u=ca(o,e,n)),da=()=>{s(),a(),u(),da=null}}var fa=t=>({name:"rrweb/network@1",observer:va,options:t});so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:fa},so.__PosthogExtensions__.rrweb={record:$e,version:"v2"},so.rrweb={record:$e,version:"v2"},so.rrwebConsoleRecord={getRecordConsolePlugin:Br},so.getRecordNetworkPlugin=fa;var pa,ga,ma,ya,ba,wa,_a,Ca,Ia,Sa,ka,xa,Aa={},Ta=[],Ea=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ra=Array.isArray;function Na(t,e){for(var r in e)t[r]=e[r];return t}function Ma(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?pa.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Oa(t,s,i,n,null)}function Oa(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ma:n,__i:-1,__u:0};return null==n&&null!=ga.vnode&&ga.vnode(o),o}function Pa(t){return t.children}function La(t,e){this.props=t,this.context=e}function Da(t,e){if(null==e)return t.__?Da(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Da(t):null}function Ba(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ba(t)}}function $a(t){(!t.__d&&(t.__d=!0)&&ya.push(t)&&!$.__r++||ba!=ga.debounceRendering)&&((ba=ga.debounceRendering)||wa)($)}function $(){for(var t,e,r,i,n,o,s,a=1;ya.length;)ya.length>a&&ya.sort(_a),t=ya.shift(),a=ya.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,o=[],s=[],e.__P&&((r=Na({},i)).__v=i.__v+1,ga.vnode&&ga.vnode(r),Ga(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,o,null==n?Da(i):n,!!(32&i.__u),s),r.__v=i.__v,r.__.__k[r.__i]=r,Ua(o,r,s),i.__e=i.__=null,r.__e!=n&&Ba(r)));$.__r=0}function ja(t,e,r,i,n,o,s,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Ta,b=e.length;for(u=function(t,e,r,i,n){var o,s,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),o=0;o<n;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=Oa(null,s,null,null,null):Ra(s)?s=t.__k[o]=Oa(Pa,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Oa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,u=o+d,s.__=t,s.__b=t.__b+1,a=null,-1!=(l=s.__i=qa(s,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,s.__u|=4))):t.__k[o]=null;if(c)for(o=0;o<h;o++)null!=(a=r[o])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ja(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Aa:y[v.__i]||Aa,v.__i=c,g=Ga(t,v,d,n,o,s,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Za(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Za(t,e,r,i){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Za(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Da(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,o,s,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,o=r+1;n>=0||o<e.length;)if(null!=(l=e[s=n>=0?n--:o++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function Ha(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ea.test(e)?r:r+"px"}function Va(t,e,r,i,n){var o,s;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Ha(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ha(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Ca,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=Ia,t.addEventListener(e,o?ka:Sa,o)):t.removeEventListener(e,o?ka:Sa,o);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function za(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ia++;else if(e.t<r.u)return;return r(ga.event?ga.event(e):e)}}}function Ga(t,e,r,i,n,o,s,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,C,I,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[a=e.__e=r.__e]),(h=ga.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new La(m,w),c.constructor=x,c.render=Ka),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Na({},c.__s)),Na(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),$=0;$<c._sb.length;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&s.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ga.__r,C=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++C<25);c.state=c.__s,null!=c.getChildContext&&(i=Na(Na({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Pa&&null==h.key&&(S=Wa(h.props.children)),a=ja(t,Ra(S)?S:[S],e,r,i,n,o,s,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=o)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else{for(k=o.length;k--;)Ma(o[k]);Ya(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ya(e);ga.__e(t,e,r)}else null==o&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,o,s,a,u){var l,h,c,d,v,f,p,g=r.props||Aa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,o[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ga.__m&&ga.__m(e,o),a=!1),o=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(o=o&&pa.call(t.childNodes),!a&&null!=o)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Va(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Va(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),ja("template"==e.type?t.content:t,Ra(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:r.__k&&Da(r,0),a,u),null!=o)for(l=o.length;l--;)Ma(o[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Va(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Va(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,o,s,u,l);return(h=ga.diffed)&&h(e),128&e.__u?void 0:a}function Ya(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ya)}function Ua(t,e,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);ga.__c&&ga.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ga.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ra(t)?t.map(Wa):Na({},t)}function Xa(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){ga.__e(t,r)}}function Ja(t,e,r){var i,n;if(ga.unmount&&ga.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ga.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ja(i[n],e,r||"function"!=typeof t.type);r||Ma(t.__e),t.__c=t.__=t.__e=void 0}function Ka(t,e,r){return this.constructor(t,r)}function Qa(t,e,r){var i,n,o;e==document&&(e=document.documentElement),ga.__&&ga.__(t,e),i=!1?null:e.__k,n=[],o=[],Ga(e,t=e.__k=Fa(Pa,null,[t]),i||Aa,Aa,e.namespaceURI,i?null:e.firstChild?pa.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),Ua(n,t,o)}function tu(t,e,r){var i,n,o,s,a=Na({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?pa.call(arguments,2):r),Oa(t.type,a,i||t.key,n||t.ref,null)}pa=Ta.slice,ga={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},ma=0,La.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Na({},this.state),"function"==typeof t&&(t=t(Na({},r),this.props)),t&&Na(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),$a(this))},La.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$a(this))},La.prototype.render=Pa,ya=[],wa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_a=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ca=/(PointerCapture)$|Capture$/i,Ia=0,Sa=za(!1),ka=za(!0),xa=0;var eu,ru,iu,nu,ou=0,su=[],au=ga,uu=au.__b,lu=au.__r,hu=au.diffed,cu=au.__c,du=au.unmount,vu=au.__;function fu(t,e){au.__h&&au.__h(ru,t,ou||e),ou=0;var r=ru.__H||(ru.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function pu(t){return ou=1,function(t,e,r){var i=fu(eu++,2);if(i.t=t,!i.__c&&(i.__=[xu(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=ru,!ru.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),o&&o.call(this,t,e,r)||s};ru.__f=!0;var o=ru.shouldComponentUpdate,s=ru.componentWillUpdate;ru.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},ru.shouldComponentUpdate=n}return i.__N||i.__}(xu,t)}function gu(t,e){var r=fu(eu++,3);!au.__s&&ku(r.__H,e)&&(r.__=t,r.u=e,ru.__H.__h.push(r))}function mu(t){return ou=5,yu((function(){return{current:t}}),[])}function yu(t,e){var r=fu(eu++,7);return ku(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function bu(t){var e=ru.context[t.__c],r=fu(eu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(ru)),e.props.value):t.__}function wu(){for(var t;t=su.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Iu),t.__H.__h.forEach(Su),t.__H.__h=[]}catch(e){t.__H.__h=[],au.__e(e,t.__v)}}au.__b=function(t){ru=null,uu&&uu(t)},au.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vu&&vu(t,e)},au.__r=function(t){lu&&lu(t),eu=0;var e=(ru=t.__c).__H;e&&(iu===ru?(e.__h=[],ru.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Iu),e.__h.forEach(Su),e.__h=[],eu=0)),iu=ru},au.diffed=function(t){hu&&hu(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==su.push(e)&&nu===au.requestAnimationFrame||((nu=au.requestAnimationFrame)||Cu)(wu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),iu=ru=null},au.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Iu),t.__h=t.__h.filter((function(t){return!t.__||Su(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],au.__e(r,t.__v)}})),cu&&cu(t,e)},au.unmount=function(t){du&&du(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Iu(t)}catch(t){e=t}})),r.__H=void 0,e&&au.__e(e,r.__v))};var _u="function"==typeof requestAnimationFrame;function Cu(t){var e,r=function(){clearTimeout(i),_u&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);_u&&(e=requestAnimationFrame(r))}function Iu(t){var e=ru,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),ru=e}function Su(t){var e=ru;t.__c=t.__(),ru=e}function ku(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function xu(t,e){return"function"==typeof e?e(t):e}var Au=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Tu=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Eu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Ru=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Nu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Mu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Fu=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Ou=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Pu=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Lu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Du=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Bu=vo("[Surveys]");function $u(t){return!(!t.start_date||t.end_date)}function ju(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Zu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var qu="seenSurvey_",Hu="inProgressSurvey_",Vu=(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},zu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Gu=t=>zu(qu,t),Yu=t=>{localStorage.getItem(Gu(t))||localStorage.setItem(Gu(t),"true")},Uu=[Nu.Popover,Nu.Widget,Nu.API],Wu={ignoreConditions:!1,ignoreDelay:!1,displayType:Du.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ai(t)&&isFinite(t)&&Math.floor(t)===t});var Xu="0123456789abcdef";class Ju{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Ju(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Xu.charAt(this.bytes[e]>>>4)+Xu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Ju(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ku{constructor(){this.M=0,this.F=0,this.O=new el}generate(){var t=this.generateOrAbort();if(ri(t)){this.M=0;var e=this.generateOrAbort();if(ri(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.M)this.M=t,this.D();else{if(!(t+1e4>this.M))return;this.F++,this.F>4398046511103&&(this.M++,this.D())}return Ju.fromFieldsV7(this.M,Math.trunc(this.F/Math.pow(2,30)),this.F&Math.pow(2,30)-1,this.O.nextUint32())}D(){this.F=1024*this.O.nextUint32()+(1023&this.O.nextUint32())}}var Qu,tl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Un&&!ri(Un.crypto)&&crypto.getRandomValues&&(tl=t=>crypto.getRandomValues(t));class el{constructor(){this.B=new Uint32Array(8),this.$=1/0}nextUint32(){return this.$>=this.B.length&&(tl(this.B),this.$=0),this.B[this.$++]}}var rl=()=>il().toString(),il=()=>(Qu||(Qu=new Ku)).generate(),nl=["fatal","error","warning","log","info","debug"],ol=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),sl=Uint8Array,al=Uint16Array,ul=Uint32Array,ll=new sl([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]),hl=new sl([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]),cl=new sl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dl=function(t,e){for(var r=new al(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new ul(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},vl=dl(ll,2),fl=vl[0],pl=vl[1];fl[28]=258,pl[258]=28;for(var gl=dl(hl,0)[1],ml=new al(32768),yl=0;yl<32768;++yl){var bl=(43690&yl)>>>1|(21845&yl)<<1;bl=(61680&(bl=(52428&bl)>>>2|(13107&bl)<<2))>>>4|(3855&bl)<<4,ml[yl]=((65280&bl)>>>8|(255&bl)<<8)>>>1}var wl=function(t,e,r){for(var i=t.length,n=0,o=new al(e);n<i;++n)++o[t[n]-1];var s,a=new al(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new al(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[ml[c]>>>u]=l}else for(s=new al(i),n=0;n<i;++n)s[n]=ml[a[t[n]-1]++]>>>15-t[n];return s},_l=new sl(288);for(yl=0;yl<144;++yl)_l[yl]=8;for(yl=144;yl<256;++yl)_l[yl]=9;for(yl=256;yl<280;++yl)_l[yl]=7;for(yl=280;yl<288;++yl)_l[yl]=8;var Cl=new sl(32);for(yl=0;yl<32;++yl)Cl[yl]=5;var Il=wl(_l,9,0),Sl=wl(Cl,5,0),kl=function(t){return(t/8>>0)+(7&t&&1)},xl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof al?al:t instanceof ul?ul:sl)(r-e);return i.set(t.subarray(e,r)),i},Al=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Tl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},El=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new sl(0),0];if(1==n){var s=new sl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new al(d+1),f=Rl(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new sl(v),f]},Rl=function(t,e,r){return-1==t.s?Math.max(Rl(t.l,e,r+1),Rl(t.r,e,r+1)):e[t.s]=r},Nl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new al(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},Ml=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Fl=function(t,e,r){var i=r.length,n=kl(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},Ol=function(t,e,r,i,n,o,s,a,u,l,h){Al(e,h++,r),++n[256];for(var c=El(n,15),d=c[0],v=c[1],f=El(o,15),p=f[0],g=f[1],m=Nl(d),y=m[0],b=m[1],w=Nl(p),_=w[0],C=w[1],I=new al(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=El(I,7),x=k[0],A=k[1],T=19;T>4&&!x[cl[T-1]];--T);var E,R,N,M,F=l+5<<3,O=Ml(n,_l)+Ml(o,Cl)+s,P=Ml(n,d)+Ml(o,p)+s+14+3*T+Ml(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return Fl(e,h,t.subarray(u,u+l));if(Al(e,h,1+(P<O)),h+=2,P<O){E=wl(d,v,0),R=d,N=wl(p,g,0),M=p;var L=wl(x,A,0);Al(e,h,b-257),Al(e,h+5,C-1),Al(e,h+10,T-4),h+=14;for(S=0;S<T;++S)Al(e,h+3*S,x[cl[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];Al(e,h,L[Z]),h+=x[Z],Z>15&&(Al(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=Il,R=_l,N=Sl,M=Cl;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;Tl(e,h,E[Z+257]),h+=R[Z+257],Z>7&&(Al(e,h,i[S]>>>23&31),h+=ll[Z]);var q=31&i[S];Tl(e,h,N[q]),h+=M[q],q>3&&(Tl(e,h,i[S]>>>5&8191),h+=hl[q])}else Tl(e,h,E[i[S]]),h+=R[i[S]];return Tl(e,h,E[256]),h+R[256]},Pl=new ul([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ll=function(){for(var t=new ul(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Dl=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new sl(i+s+5*(1+Math.floor(s/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c<s?l=Fl(u,l,t.subarray(h,c)):(u[h]=o,l=Fl(u,l,t.subarray(h,s)))}else{for(var d=Pl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new al(32768),m=new al(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new ul(25e3),C=new al(288),I=new al(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<s;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,A<=h){var M=s-h;if((S>7e3||x>24576)&&M>423){l=Ol(t,u,0,_,C,I,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),Z=Math.min(258,M);D<=j&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|pl[O]<<18|gl[P];var Y=31&pl[O],U=31&gl[P];k+=ll[Y]+hl[U],++C[257+Y],++I[U],A=h+O,++S}else _[x++]=t[h],++C[t[h]]}}l=Ol(t,u,o,_,C,I,k,x,T,h-T,l)}return xl(a,0,i+kl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Bl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function $l(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Ll[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Dl(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Bl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Bl(n,o-8,r.d()),Bl(n,o-4,i),n}var jl=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),oi(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Zl=!!io||!!ro,ql="text/plain",Hl=function(t,e,i){var n;void 0===i&&(i=!0);var[o,s]=t.split("?"),a=r({},e),u=null!==(n=null==s?void 0:s.split("&").map((t=>{var e,[r,n]=t.split("="),o=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+o})))&&void 0!==n?n:[],l=Eo(a);return l&&u.push(l),o+"?"+u.join("&")},Vl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),zl=t=>{var{data:e,compression:r}=t;if(e){if(r===ol.GZipJS){var i=$l(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new sl(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new sl(n+8+(r-s<<1));a.set(i),i=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return xl(i,0,n)}(Vl(e)),{mtime:0}),n=new Blob([i],{type:ql});return{contentType:ql,body:n,estimatedSize:n.size}}if(r===ol.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=jl(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,h[u++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Vl(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Vl(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Vl(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Gl=[];ro&&Gl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=zl(t))&&void 0!==e?e:{},a=new Headers;go(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(no){var h=new no;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}ro(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){co.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{co.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),io&&Gl.push({transport:"XHR",method:t=>{var e,r=new io;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=zl(t))&&void 0!==e?e:{};go(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&Gl.push({transport:"sendBeacon",method:t=>{var e=Hl(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=zl(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(e,o)}catch(t){}}});var Yl=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 Ul(t,e,r){return Vl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Wl={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=>Yl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Yl(e,t))))),icontains:(t,e)=>e.map(Xl).some((e=>t.map(Xl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Xl).every((e=>t.map(Xl).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)))}))},Xl=t=>t.toLowerCase();function Jl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ri(n)||oi(n))return!1;var o=[String(n)],s=Wl[i.operator];return!!s&&s(i.values,o)}))}var Kl=vo("[Stylesheet Loader]"),Ql=Un,th=to;function eh(t){return"$survey_response_"+t}var rh="#020617",ih={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:Eu.Right,widgetType:Tu.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:rh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function nh(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 oh(t){var e;void 0===t&&(t=ih.backgroundColor),"#"===t[0]&&(e=nh(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=nh(r)),!e)return rh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?rh:"white"}return rh}function sh(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Kl.error("prepare_external_dependency_stylesheet returned null"),null)})(th,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var ah=(t,e,i)=>{var n=Th(t),o=th.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=th.createElement("div");((t,e,i)=>{var n=r({},ih,i),o=t.style,s=![Eu.Center,Eu.Left,Eu.Right].includes(n.position)||e===Nu.Widget&&(null==i?void 0:i.widgetType)===Tu.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||oh(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",oh(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||oh(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",oh(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||oh(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),u=sh(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return th.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},uh=(t,e)=>{if(!e)return null;var r=t[eh(e)];return Jr(r)?[...r]:r},lh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s,properties:a}=t;o?(Yu(i),o.capture(Pu.SENT,r({[Lu.SURVEY_NAME]:i.name,[Lu.SURVEY_ID]:i.id,[Lu.SURVEY_ITERATION]:i.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Lu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:uh(e,t.id)}))),[Lu.SURVEY_SUBMISSION_ID]:n,[Lu.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,a,{$set:{[Vu(i,"responded")]:!0}})),s&&(Ql.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Ah(i))):Bu.error("[survey sent] event not captured, PostHog instance not found.")},hh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!si(t))).length>0,ch=(t,e,i)=>r({[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Lu.SURVEY_PARTIALLY_COMPLETED]:hh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Lu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Lu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:uh((null==e?void 0:e.responses)||{},t.id)})))}),dh=(t,e,i)=>{if(e){if(!i){var n=kh(t);e.capture(Pu.DISMISSED,r({},ch(t,n,e),{$set:{[Vu(t,"dismissed")]:!0}})),Ah(t),Yu(t),Ql.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bu.error("[survey dismissed] event not captured, PostHog instance not found.")},vh=(t,e)=>{if(e){var r=(t=>zu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=kh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Pu.ABANDONED,ch(t,i,e),{transport:"sendBeacon"})}}else Bu.error("[survey abandoned] event not captured, PostHog instance not found.")},fh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),ph=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,gh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?ph(t.questions,fh(t.questions)):t.questions,mh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===Ou.Always||xh(t)},yh=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:()=>{},surveySubmissionId:"",properties:void 0}),bh=()=>bu(yh),wh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return tu(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function _h(t){return null!=t?t:"icontains"}function Ch(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Ql||null==(r=Ql.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=_h(null==(i=t.conditions)?void 0:i.urlMatchType);return Wl[s](o,[n])}var Ih=t=>{var e=""+Hu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Hu+t.id+"_"+t.current_iteration),e},Sh=(t,e)=>{try{localStorage.setItem(Ih(t),JSON.stringify(e))}catch(t){Bu.error("Error setting in-progress survey state in localStorage",t)}},kh=t=>{try{var e=localStorage.getItem(Ih(t));if(e)return JSON.parse(e)}catch(t){Bu.error("Error getting in-progress survey state from localStorage",t)}return null},xh=t=>{var e=kh(t);return!si(null==e?void 0:e.surveySubmissionId)},Ah=t=>{try{localStorage.removeItem(Ih(t))}catch(t){Bu.error("Error clearing in-progress survey state from localStorage",t)}};function Th(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Eh(t,e,r){if(void 0===e&&(e=Eu.Right),t===Nu.ExternalSurvey)return{};switch(e){case Eu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Eu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Eu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Eu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Eu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Eu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Eu.Left:return{left:"30px"};case Eu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Eu.Right:return{right:t===Nu.Widget&&r===Tu.Tab?"60px":"30px"}}}var Rh=0;function Nh(t,e,r,i,n,o){e||(e={});var s,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?s=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rh,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return ga.vnode&&ga.vnode(l),l}var Mh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Fh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Oh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Ph=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Lh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Nh("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"})}),Dh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Nh("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"})}),Bh=Nh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Nh("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"})}),$h=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Nh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Nh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Nh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]})},jh=Nh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Nh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Nh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Nh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Nh("g",{mask:"url(#mask0_2415_6911)",children:[Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"}),Nh("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"})]})]}),Nh("defs",{children:Nh("clipPath",{id:"clip0_2415_6911",children:Nh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Zh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Nh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",jh]})}function qh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:u}=bu(yh);return Nh("div",{className:"bottom-section",children:[!a&&Nh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Un||Un.open(o)),u?null==s||s():n()},children:e}),!i.whiteLabel&&Nh(Zh,{urlParams:{utm_source:"survey-footer"}})]})}function Hh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Nh("div",{class:"question-header",children:[Nh(e.type===Mu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&wh({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vh(t){var{onClick:e}=t,{isPreviewMode:r}=bu(yh);return Nh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:$h({fill:"black"})})}Nh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Nh("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 zh=Un;function Gh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=bu(yh);return gu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return Ao(zh,"keydown",t),()=>{zh.removeEventListener("keydown",t)}}),[s]),Nh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&Nh(Vh,{onClick:()=>s()}),Nh("h3",{className:"thank-you-message-header",children:e}),r&&wh({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Nh(qh,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Yh=t=>Jr(t)&&t.every((t=>ii(t)));function Uh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:u}=bh(),l=mu(null),[h,c]=pu((()=>ii(a)?a:""));gu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+s,v=yu((()=>function(t,e,r){var i,n,o=t.trim();if(!r&&""===o)return"This field is required";if(""===o)return!1;if(e&&e.length>0)for(var s of e)switch(s.type){case $r.MinLength:if(void 0!==s.value&&o.length<s.value)return null!==(i=s.errorMessage)&&void 0!==i?i:"Please enter at least "+s.value+" characters";break;case $r.MaxLength:if(void 0!==s.value&&o.length>s.value)return null!==(n=s.errorMessage)&&void 0!==n?n:"Please enter no more than "+s.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Zr(e.validation,$r.MinLength),p=Zr(e.validation,$r.MaxLength),g=yu((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:e,forceDisableHtml:r,htmlFor:d}),Nh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h}),g&&Nh("div",{className:"validation-hint",children:g})]}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:()=>{v||n(h.trim())},onPreviewSubmit:()=>{v||o(h.trim())}})]})}function Wh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return Nh(Pa,{children:[Nh("div",{className:"question-container",children:Nh(Hh,{question:e,forceDisableHtml:r})}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Xh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=pu((()=>ai(u)?u:Jr(u)&&u.length>0&&ai(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ai(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=bh(),p=t=>f?a(t):s(t);return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:r,forceDisableHtml:i}),Nh("div",{className:"rating-section",children:[Nh("div",{className:"rating-options",children:["emoji"===r.display&&Nh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=rc[r.scale])?void 0:e.map(((t,e)=>Nh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick:()=>{var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Nh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:ic(r.scale).map(((t,e)=>Nh(Jh,{displayQuestionIndex:n,active:c===t,appearance:o,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Nh("div",{className:"rating-text",children:[Nh("div",{children:r.lowerBoundLabel}),Nh("div",{children:r.upperBoundLabel})]})]})]}),Nh(qh,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:oi(c)&&!r.optional,appearance:o,onSubmit:()=>s(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Jh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Nh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Kh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l=mu(null),h=yu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=ph(e,fh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=pu((()=>((t,e)=>ii(t)||Yh(t)?t:e===Mu.SingleChoice?null:[])(u,e.type))),[v,f]=pu((()=>((t,e)=>{if(ii(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Yh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=bh(),g=e.type===Mu.SingleChoice,m=e.type===Mu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Jr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!oi(c)||(!(!Jr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Jr(c)&&(p?a([...c,v.inputValue]):s([...c,v.inputValue])):p?a(c):s(c)};return Nh(Pa,{children:[Nh("div",{className:"question-container",children:[Nh(Hh,{question:e,forceDisableHtml:i}),Nh("fieldset",{className:"multiple-choice-options limit-height",children:[Nh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?c===t:Jr(c)&&c.includes(t);return Nh("label",{className:i?"choice-option-open":"",children:[Nh("div",{className:"response-choice",children:[Nh("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),Nh("span",{children:i?t+":":t})]}),i&&Nh("input",{type:"text",ref:l,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Nh(qh,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Qh=[1,2,3,4,5],tc=[1,2,3,4,5,6,7],ec=[0,1,2,3,4,5,6,7,8,9,10],rc={2:[Dh,Bh],3:[Oh,Fh,Mh],5:[Ph,Oh,Fh,Mh,Lh]};function ic(t){switch(t){case 5:default:return Qh;case 7:return tc;case 10:return ec}}var nc=vo("[Surveys]");function oc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Fu.End:o;if(n.branching.type===Fu.End)return Fu.End;if(n.branching.type===Fu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Fu.ResponseBased){if(n.type===Mu.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Fu.End?Fu.End:o}}else if(n.type===Mu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Fu.End?Fu.End:o}}return o}return nc.warn("Falling back to next question index due to unexpected branching type"),o}var sc=Un,ac=to,uc="ph:show_survey_widget",lc="PHWidgetSurveyClickListener",hc=250,cc=20,dc=12;function vc(t,e){try{var r=t.getBoundingClientRect(),i=sc.innerHeight,n=sc.innerWidth,o=hc,s=r.left+r.width/2-e/2;s+e>n-cc&&(s=n-e-cc),s<cc&&(s=cc);var a=dc,u=i-r.bottom,l=r.top,h=u<o&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:ih.zIndex}}catch(t){return Bu.warn("Failed to calculate trigger position:",t),null}}class fc{constructor(t){var e=this;this.j=new Map,this.Z=new Map,this.q=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(es);if(t)for(var e of t)xh(e)&&vh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,o,s,a=null!=e&&e.position||null!=e&&e.selector?r({},t,{appearance:r({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.H(a.id);var{properties:u,initialResponses:l}=null!=e?e:{},h=!!(l&&Object.keys(l).length>0)&&this.V(a,l,u);if(!h||null!=(i=a.appearance)&&i.displayThankYouMessage){this.G(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Eu.NextToTrigger&&null!=(o=a.appearance)&&o.widgetSelector){var d,v=ac.querySelector(a.appearance.widgetSelector);if(v)c=vc(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||ih.maxWidth))||{}}var f=(null==(s=a.appearance)?void 0:s.surveyPopupDelaySeconds)||0,{shadow:p}=ah(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Y,properties:u,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(f<=0)return Qa(Nh(yc,r({},g)),p);var m=setTimeout((()=>{if(this.j.delete(a.id),!Ch(a))return this.Y(a);Qa(Nh(yc,r({},g,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.j.set(a.id,m)}},this.U=t=>{var{shadow:e,isNewlyCreated:r}=ah(t,this._posthog);r&&Qa(Nh(wc,{posthog:this._posthog,survey:t},t.id),e)},this.W=t=>{this.X(t);var e=this.Z.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(lc),this.Z.delete(t.id),Bu.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=ac.querySelector(e),i=this.Z.get(t.id);if(r){if(this.U(t),i){if(r===i.element)return;Bu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.W(t)}if(!r.hasAttribute(lc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Eu.NextToTrigger?vc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ih.maxWidth)):{};sc.dispatchEvent(new CustomEvent(uc,{detail:{surveyId:t.id,position:n}}))};Ao(r,"click",n),r.setAttribute(lc,"true"),this.Z.set(t.id,{element:r,listener:n,survey:t}),Bu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.W(t)},this.renderPopover=t=>{var{shadow:e}=ah(t,this._posthog);Qa(Nh(yc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.K(t),Qa(Nh(yc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.tt(t)&&e.et(t)&&e.rt(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Nu.Popover||t.type===Nu.Widget)),i=e.it(r),n=new Set;i.forEach((t=>{if(t.type===Nu.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===Tu.Tab)return void e.U(t);if((null==(i=t.appearance)?void 0:i.widgetType)===Tu.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.J(t,null==(s=t.appearance)?void 0:s.widgetSelector)}oi(e.nt)&&t.type===Nu.Popover&&e.handlePopoverSurvey(t)})),e.Z.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.W(r)}))}),t)},this.G=t=>{oi(this.nt)||Bu.error("Survey "+this.nt+" already in focus. Cannot add survey "+t.id+"."),this.nt=t.id},this.Y=t=>{this.nt!==t.id&&Bu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.H(t.id),this.nt=null,this.X(t)},this._posthog=t,this.nt=null}H(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Bu.info("Cancelled pending survey "+t),this.H(t),this.nt===t&&(this.nt=null))}it(t){return t.sort(((t,e)=>{var r,i,n=xh(t),o=xh(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===Ou.Always,a=e.schedule===Ou.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}K(t){if(!this.q.has(t.id)){var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var o of n){var[s,a]=o.split("=");if(s&&!ri(a)){var u=decodeURIComponent(s),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(sc.location.search);if(0!==Object.keys(e).length){Bu.info("[Survey Prefill] Detected URL prefill parameters");var r=this.ot(t,e);if(r){var{responses:i,submissionId:n,isSurveyCompleted:o,skippedResponses:s}=r;(Object.keys(s).length>0&&t.enable_partial_responses||o)&&lh({responses:o?i:s,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:o}),this.q.add(t.id)}}}}V(t,e,r){var i={};for(var[n,o]of Object.entries(e)){i[parseInt(n)]=Jr(o)?o.map(String):[String(o)]}Bu.info("[Survey] Processing initial responses");var s=this.ot(t,i);if(!s)return!1;var{responses:a,submissionId:u,isSurveyCompleted:l}=s;return lh({responses:a,survey:t,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}ot(t,e){try{var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],o=eh(t.id);try{switch(t.type){case Mu.SingleChoice:if(!t.choices||0===t.choices.length)return void co.warn("[Survey Prefill] Question "+i+" has no choices");var s=parseInt(n[0],10);if(isNaN(s)||s<0||s>=t.choices.length)return void co.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[s];break;case Mu.MultipleChoice:if(!t.choices||0===t.choices.length)return void co.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void co.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&co.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=u;break;case Mu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void co.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=l;break;default:co.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){co.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return Bu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=rl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:s}=function(t,e,r){for(var i=0,n={},o=t.questions.length+1;i<t.questions.length&&0<o&&e.includes(i);){var s=t.questions[i];if(!s||!("skipSubmitButton"in s)||!s.skipSubmitButton)break;if(s.id){var a=eh(s.id);ri(r[a])||(n[a]=r[a])}var u=oc(t,i,s.id?r[eh(s.id)]:null);if(u===Fu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=o>=t.questions.length;return Sh(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:o}),Bu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:o,isSurveyCompleted:a,skippedResponses:s}}catch(t){return Bu.error("[Survey Prefill] Error handling prefill:",t),null}}st(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}tt(t){return!t.conditions||Ch(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!oo)return!1;var n=wn(oo);return Wl[_h(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==th||!th.querySelector(t.conditions.selector))}(t)}ut(t){return mh(t)||this.st(t.internal_targeting_flag_key)||xh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!$u(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Uu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.st(t.linked_flag_key,n)?this.st(t.targeting_flag_key)?this.ut(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Gu(t))&&!mh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}et(t){var e;if(!ju(t)&&!Zu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}rt(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.st(r)}))}X(t){try{var e=ac.querySelector(Th(t,!0));null!=e&&e.shadowRoot&&Qa(null,e.shadowRoot),null==e||e.remove()}catch(e){Bu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.nt,surveyTimeouts:this.j,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.it,checkFlags:this.rt.bind(this),isSurveyFeatureFlagEnabled:this.st.bind(this)}}}function pc(t,e){if(ac&&sc){var r,i=new fc(t);if(t.config.disable_surveys_automatic_display)return Bu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Bu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Ao(ac,"visibilitychange",(()=>{ac.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function gc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;gu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===Nu.Widget,o=Ch(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===Tu.Tab&&n;if(!o)return Bu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(Bu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Ao(sc,"popstate",o),Ao(sc,"hashchange",o);var s=sc.history.pushState,a=sc.history.replaceState;return sc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},sc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{sc.removeEventListener("popstate",o),sc.removeEventListener("hashchange",o),sc.history.pushState=s,sc.history.replaceState=a}}}),[n,e,r,i])}function mc(t){switch(void 0===t&&(t=Ru.Right),t){case Ru.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ru.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ru.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Ru.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function yc(t){var e,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=mu(null),C=Number.isInteger(d),I=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,r,i,n,o,s,a){var[u,l]=pu(i||0===r||t.type===Nu.ExternalSurvey),[h,c]=pu(!1),d=()=>{var e=()=>{o&&n(t),l(!1)};ac.startViewTransition?ac.startViewTransition((()=>{var t;null==s||null==(t=s.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return gu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},o=()=>{Ch(t)&&(l(!0),sc.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Pu.SHOWN,{[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Ao(sc,"PHSurveyClosed",v),Ao(sc,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}return o(),()=>{sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}}else Bu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),gc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:u,isSurveySent:h,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(u,h,I,C,v,f,_,w),A=k||d===u.questions.length||!0===b,T=yu((()=>{var t=kh(u);return{isPreviewMode:C,previewPageIndex:d,onPopupSurveyDismissed:()=>{dh(u,h,C),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||rl(),onPreviewSubmit:p,posthog:h,properties:y}}),[C,d,f,h,u,g,p,y]);return S?Nh(yh.Provider,{value:T,children:Nh("div",{className:"ph-survey",style:r({},Eh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:_,children:A?Nh(Gh,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=u.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||ih,onClose:()=>{x(),m()}}):Nh(bc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function bc(t){var e,{survey:i,forceDisableHtml:n,posthog:o}=t,[s,a]=pu((()=>{var t=kh(i);return null!=t&&t.responses&&Bu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=bu(yh),[p,g]=pu((()=>{var t=kh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=yu((()=>gh(i)),[i]);gu((()=>{v&&!ri(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Nh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Nh(Vh,{onClick:()=>{l()}}),Nh("div",{className:"survey-box",children:_c({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||ih,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(o)if(u){var l=eh(u),h=r({},s,{[l]:e});a(h);var c=oc(i,n,e),v=c===Fu.End;v||(g(c),Sh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&lh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:o,properties:f})}else Bu.error("onNextButtonClick called without a questionId.");else Bu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?s[eh(y.id)]:void 0})})]}):null}function wc(t){var e,r,i,n,o,s,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=pu(!0),[f,p]=pu(!1),[g,m]=pu({}),y=()=>{p(!f)};if(gu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Bu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return Ao(sc,uc,e),()=>{sc.removeEventListener(uc,e)}}}else Bu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),gc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Ou.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Nh(Pa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Nh("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===Ru.Top?"widget-tab-top":""),onClick:y,disabled:c,style:mc(null==(s=u.appearance)?void 0:s.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Nh(yc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var _c=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Mu.Open:return Fa(Uh,r({},l,{question:e,key:e.id}));case Mu.Link:return Fa(Wh,r({},l,{question:e,key:e.id}));case Mu.Rating:return Fa(Xh,r({},l,{question:e,key:e.id}));case Mu.SingleChoice:case Mu.MultipleChoice:return Fa(Kh,r({},l,{question:e,key:e.id}));default:return Bu.error("Unsupported question type: "+e.type),null}};so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.generateSurveys=pc,so.extendPostHogWithSurveys=pc;class Cc{emit(t){}}var Ic=new Cc;var Sc=new class{getLogger(t,e,r){return new Cc}};class kc{constructor(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}emit(t){this.ct().emit(t)}ct(){if(this.dt)return this.dt;var t=this.ht.vt(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ic}}class xc{getLogger(t,e,r){var i;return null!==(i=this.vt(t,e,r))&&void 0!==i?i:new kc(this,t,e,r)}ft(){var t;return null!==(t=this.dt)&&void 0!==t?t:Sc}yt(t){this.dt=t}vt(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getLogger(t,e,r)}}var Ac="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Tc=Symbol.for("io.opentelemetry.js.api.logs"),Ec=Ac;class Rc{constructor(){this.bt=new xc}static getInstance(){return this._instance||(this._instance=new Rc),this._instance}setGlobalLoggerProvider(t){return Ec[Tc]?this.getLoggerProvider():(Ec[Tc]=(e=1,r=t,i=Sc,t=>t===e?r:i),this.bt.yt(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=Ec[Tc])||void 0===t?void 0:t.call(Ec,1))&&void 0!==e?e:this.bt}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Ec[Tc],this.bt=new xc}}var Nc=Rc.getInstance();class Mc{constructor(t){this.dt=void 0,this.dt=t}export(t,e){this.dt.export(t,e)}forceFlush(){return this.dt.forceFlush()}shutdown(){return this.dt.shutdown()}}class Fc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Oc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Pc{constructor(t){this.wt=void 0,this._t=[],this.wt=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._t.push(t);var e=()=>{var e=this._t.indexOf(t);this._t.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this._t.length>=this.wt}awaitAll(){var t=this;return e((function*(){yield Promise.all(t._t)}))()}}function Lc(t){return new Pc(t.concurrencyLimit)}var Dc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Bc="1.9.0",$c=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var jc=function(t){var e=new Set([t]),r=new Set,i=t.match($c);if(!i)return function(){return!1};var n=+i[1],o=+i[2],s=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match($c);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?o===h&&s<=c?u(t):a(t):o<=h?u(t):a(t)}}(Bc),Zc=Bc.split(".")[0],qc=Symbol.for("opentelemetry.js.api."+Zc),Hc=Dc;function Vc(t,e,r,i){var n;void 0===i&&(i=!1);var o=Hc[qc]=null!==(n=Hc[qc])&&void 0!==n?n:{version:Bc};if(!i&&o[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(o.version!==Bc){s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Bc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Bc+"."),!0}function zc(t){var e,r,i=null===(e=Hc[qc])||void 0===e?void 0:e.version;if(i&&jc(i))return null===(r=Hc[qc])||void 0===r?void 0:r[t]}function Gc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Bc+".");var r=Hc[qc];r&&delete r[t]}var Yc,Uc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},Wc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Xc=function(){function t(t){this.Ct=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("debug",this.Ct,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("error",this.Ct,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("info",this.Ct,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("warn",this.Ct,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jc("verbose",this.Ct,t)},t}();function Jc(t,e,r){var i=zc("diag");if(i)return r.unshift(e),i[t].apply(i,Wc([],Uc(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Yc||(Yc={}));var Kc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},Qc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},td=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=zc("diag");if(i)return i[t].apply(i,Qc([],Kc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,o;if(void 0===r&&(r={logLevel:Yc.INFO}),t===e){var s=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=s.stack)&&void 0!==i?i:s.message),!1}"number"==typeof r&&(r={logLevel:r});var a=zc("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Yc.NONE?t=Yc.NONE:t>Yc.ALL&&(t=Yc.ALL),e=e||{},{error:r("error",Yc.ERROR),warn:r("warn",Yc.WARN),info:r("info",Yc.INFO),debug:r("debug",Yc.DEBUG),verbose:r("verbose",Yc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Yc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Vc("diag",u,e,!0)},e.disable=function(){Gc("diag",e)},e.createComponentLogger=function(t){return new Xc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function ed(t){return Symbol.for(t)}var rd,id=function t(e){var r=this;r.It=e?new Map(e):new Map,r.getValue=function(t){return r.It.get(t)},r.setValue=function(e,i){var n=new t(r.It);return n.It.set(e,i),n},r.deleteValue=function(e){var i=new t(r.It);return i.It.delete(e),i}},nd=new id,od=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},sd=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},ad=function(){function t(){}return t.prototype.active=function(){return nd},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,sd([r],od(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),ud=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},ld=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},hd="context",cd=new ad,dd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Vc(hd,t,td.instance())},t.prototype.active=function(){return this.St().active()},t.prototype.with=function(t,e,r){for(var i,n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return(i=this.St()).with.apply(i,ld([t,e,r],ud(n),!1))},t.prototype.bind=function(t,e){return this.St().bind(t,e)},t.prototype.St=function(){return zc(hd)||cd},t.prototype.disable=function(){this.St().disable(),Gc(hd,td.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(rd||(rd={}));var vd="0000000000000000",fd="00000000000000000000000000000000",pd={traceId:fd,spanId:vd,traceFlags:rd.NONE},gd=function(){function t(t){void 0===t&&(t=pd),this.kt=t}return t.prototype.spanContext=function(){return this.kt},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),md=ed("OpenTelemetry Context Key SPAN");function yd(t){return t.getValue(md)||void 0}function bd(){return yd(dd.getInstance().active())}function wd(t,e){return t.setValue(md,e)}function _d(t){return t.deleteValue(md)}function Cd(t,e){return wd(t,new gd(e))}function Id(t){var e;return null===(e=yd(t))||void 0===e?void 0:e.spanContext()}var Sd=/^([0-9a-f]{32})$/i,kd=/^[0-9a-f]{16}$/i;function xd(t){return r=t.traceId,Sd.test(r)&&r!==fd&&(e=t.spanId,kd.test(e)&&e!==vd);var e,r}function Ad(t){return new gd(t)}var Td=dd.getInstance(),Ed=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Td.active()),Boolean(null==e?void 0:e.root))return new gd;var i,n=r&&Id(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&xd(n)?new gd(n):new gd},t.prototype.startActiveSpan=function(t,e,r,i){var n,o,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(n=e,s=r):(n=e,o=r,s=i);var a=null!=o?o:Td.active(),u=this.startSpan(t,n,a),l=wd(a,u);return Td.with(l,s,void 0,u)}},t}();var Rd=new Ed,Nd=function(){function t(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.xt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.xt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.xt=function(){if(this.dt)return this.dt;var t=this.ht.getDelegateTracer(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Rd},t}(),Md=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Ed},t}()),Fd=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new Nd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.dt)&&void 0!==t?t:Md},t.prototype.setDelegate=function(t){this.dt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Od=dd.getInstance(),Pd=td.instance(),Ld="trace",Dd=function(){function t(){this.At=new Fd,this.wrapSpanContext=Ad,this.isSpanContextValid=xd,this.deleteSpan=_d,this.getSpan=yd,this.getActiveSpan=bd,this.getSpanContext=Id,this.setSpan=wd,this.setSpanContext=Cd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Vc(Ld,this.At,td.instance());return e&&this.At.setDelegate(t),e},t.prototype.getTracerProvider=function(){return zc(Ld)||this.At},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){Gc(Ld,td.instance()),this.At=new Fd},t}(),Bd=Dd.getInstance(),$d=ed("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function jd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if(Zd(i)){e=i;continue}return!1}return!1}}return!0}(t):Zd(typeof t))}function Zd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var qd=t=>{Pd.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))};function Hd(t){try{qd(t)}catch(t){}}var Vd,zd=performance,Gd="telemetry.sdk.language",Yd="telemetry.sdk.name",Ud="telemetry.sdk.version",Wd={[Yd]:"opentelemetry","process.runtime.name":"browser",[Gd]:"webjs",[Ud]:"2.2.0"},Xd=Math.pow(10,6),Jd=Math.pow(10,9);function Kd(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Xd)]}function Qd(){var t=zd.timeOrigin;if("number"!=typeof t){var e=zd;t=e.timing&&e.timing.fetchStart}return t}function tv(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Jd&&(r[1]-=Jd,r[0]+=1);return r}(Kd(Qd()),Kd("number"==typeof t?t:zd.now()))}function ev(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Qd()?tv(t):Kd(t);if(t instanceof Date)return Kd(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Vd||(Vd={}));var rv="[object Object]",iv="[object Null]",nv="[object Undefined]",ov=Function.prototype.toString,sv=ov.call(Object),av=Object.getPrototypeOf,uv=Object.prototype,lv=uv.hasOwnProperty,hv=Symbol?Symbol.toStringTag:void 0,cv=uv.toString;function dv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?nv:iv;return hv&&hv in Object(t)?function(t){var e=lv.call(t,hv),r=t[hv],i=!1;try{t[hv]=void 0,i=!0}catch(t){}var n=cv.call(t);i&&(e?t[hv]=r:delete t[hv]);return n}(t):function(t){return cv.call(t)}(t)}(t)!==rv)return!1;var e=av(t);if(null===e)return!0;var r=lv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ov.call(r)===sv}var vv=20;function fv(t){return mv(t)?t.slice():t}function pv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>vv)){if(r++,wv(t)||wv(e)||yv(e))n=fv(e);else if(mv(t)){if(n=t.slice(),mv(e))for(var o=0,s=e.length;o<s;o++)n.push(fv(e[o]));else if(bv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=fv(e[h])}}else if(bv(t))if(bv(e)){if(!function(t,e){if(!dv(t)||!dv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(wv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(gv(t,f,i)||gv(e,f,i))delete n[f];else{if(bv(g)&&bv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=pv(n[f],p,r,i)}}}}else n=e;return n}}function gv(t,e,r){for(var i=r.get(t[e])||[],n=0,o=i.length;n<o;n++){var s=i[n];if(s.key===e&&s.obj===t)return!0}return!1}function mv(t){return Array.isArray(t)}function yv(t){return"function"==typeof t}function bv(t){return!wv(t)&&!mv(t)&&!yv(t)&&"object"==typeof t}function wv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class _v extends Error{constructor(t){super(t),Object.setPrototypeOf(this,_v.prototype)}}function Cv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new _v("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Iv{constructor(){this.Tt=void 0,this.Et=void 0,this.Rt=void 0,this.Tt=new Promise(((t,e)=>{this.Et=t,this.Rt=e}))}get promise(){return this.Tt}resolve(t){this.Et(t)}reject(t){this.Rt(t)}}class Sv{constructor(t,e){this.Nt=void 0,this.Mt=void 0,this.Ft=!1,this.Ot=new Iv,this.Nt=t,this.Mt=e}get isCalled(){return this.Ft}get promise(){return this.Ot.promise}call(){if(!this.Ft){this.Ft=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.Nt.call(this.Mt,...e)).then((t=>this.Ot.resolve(t)),(t=>this.Ot.reject(t)))}catch(t){this.Ot.reject(t)}}return this.Ot.promise}}var kv={Pt:function(t,e){return new Promise((r=>{Od.with(function(t){return t.setValue($d,!0)}(Od.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function xv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Pd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Av{constructor(t,e,r,i,n){this.Lt=void 0,this.Dt=void 0,this.Bt=void 0,this.$t=void 0,this.jt=void 0,this.Zt=void 0,this.Lt=t,this.Dt=e,this.Bt=r,this.$t=i,this.jt=n,this.Zt=Pd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Zt.debug("items to be sent",t),this.$t.hasReachedLimit())e({code:Vd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Dt.serializeRequest(t);null!=r?this.$t.pushPromise(this.Lt.send(r,this.jt).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Vd.FAILED,error:t.error}):"retryable"===t.status?e({code:Vd.FAILED,error:new Fc("Export failed with retryable status")}):e({code:Vd.FAILED,error:new Fc("Export failed with unknown error")});else{if(null!=t.data)try{this.Bt.handleResponse(this.Dt.deserializeResponse(t.data))}catch(e){this.Zt.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Vd.SUCCESS})}}),(t=>e({code:Vd.FAILED,error:t})))):e({code:Vd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.$t.awaitAll()}shutdown(){var t=this;return e((function*(){t.Zt.debug("shutdown started"),yield t.forceFlush(),t.Lt.shutdown()}))()}}function Tv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Lc(t)},n={timeout:t.timeoutMillis},new Av(i.transport,i.serializer,xv(),i.promiseHandler,n.timeout);var i,n}function Ev(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Rv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=Ev(t.charCodeAt(i)),o=Ev(t.charCodeAt(i+1));e[r++]=n<<4|o}return e}function Nv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Mv(t){var e,r=Nv(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Fv="undefined"!=typeof BigInt?function(t){return Nv(t).toString()}:function(t){return t[0]*Jd+t[1]};function Ov(t){return t}function Pv(t){if(void 0!==t)return Rv(t)}var Lv={encodeHrTime:Mv,encodeSpanContext:Rv,encodeOptionalSpanContext:Pv};function Dv(t,e){return{key:t,value:Bv(e)}}function Bv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Bv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Dv(e,r)}))}}:{}}function $v(t,e){var r=function(t){var e,r;if(void 0===t)return Lv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Mv:Fv,encodeSpanContext:n?Ov:Rv,encodeOptionalSpanContext:n?Ov:Pv}}(e);return{resourceLogs:jv(t,r)}}function jv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:o="",schemaUrl:s=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+o+":"+s,l=a.get(u);l||(l=[],a.set(u,l)),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Dv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Bv(t.body),eventName:t.eventName,attributes:Zv(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function Zv(t){return Object.keys(t).map((e=>Dv(e,t[e])))}var qv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Hv{static FromAttributeList(t,e){var r=new Hv({},e);return r.qt=zv(t),r.Ht=t.filter((t=>{var[e,r]=t;return qv(r)})).length>0,r}constructor(t,e){var r;this.qt=void 0,this.Ht=!1,this.Vt=void 0,this.zt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.qt=Object.entries(i).map((t=>{var[e,r]=t;return qv(r)&&(this.Ht=!0),[e,r]})),this.qt=zv(this.qt),this.Vt=function(t){if("string"==typeof t||void 0===t)return t;return void Pd.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Ht}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.qt.length;e++){var[r,i]=t.qt[e];t.qt[e]=[r,qv(i)?yield i:i]}t.Ht=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Pd.error("Accessing resource attributes before async attributes settled"),this.zt)return this.zt;var t={};for(var[e,r]of this.qt){var i;if(qv(r))Pd.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Ht||(this.zt=t),t}getRawAttributes(){return this.qt}get schemaUrl(){return this.Vt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,o=void 0===i||""===i;if(n)return i;if(o)return r;if(r===i)return r;return void Pd.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return Hv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Vv(t,e){return Hv.FromAttributeList(Object.entries(t),e)}function zv(t){return t.map((t=>{var[e,r]=t;return qv(r)?[e,r.catch((t=>{Pd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var Gv={serializeRequest:t=>{var e=$v(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Yv{constructor(t){this.Lt=void 0,this.Lt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Lt.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Lt.send(t,r),o=5,s=1e3;"retryable"===n.status&&o>0;){var a;o--;var u=Math.max(Math.min(s,5e3)+(.4*Math.random()-.2),0);s*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Lt.shutdown()}}function Uv(t){return new Yv(t.transport)}function Wv(t){return[429,502,503,504].includes(t)}function Xv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}}class Jv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Gt.headers(),n=yield new Promise((n=>{var o=new XMLHttpRequest;o.timeout=r,o.open("POST",i.Gt.url),Object.entries(e).forEach((t=>{var[e,r]=t;o.setRequestHeader(e,r)})),o.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(Pd.debug("XHR success"),n({status:"success"})):o.status&&Wv(o.status)?n({status:"retryable",retryInMillis:Xv(o.getResponseHeader("Retry-After"))}):0!==o.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},o.send(t)}));return n}))()}shutdown(){}}class Kv{constructor(t){this.Yt=void 0,this.Yt=t}send(t){var r=this;return e((function*(){var e=(yield r.Yt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Yt.url,new Blob([t],{type:e}))?(Pd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Qv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var o,s=!!globalThis.location,a=new URL(i.Gt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Gt.headers(),body:t,signal:e.signal,keepalive:s,mode:s?(null==(o=globalThis.location)?void 0:o.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Pd.debug("response success"),{status:"success"}):Wv(u.status)?{status:"retryable",retryInMillis:Xv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function tf(t,e){return Tv(t,e,Uv({transport:(r=t,new Jv(r))}));var r}function ef(t,e){return Tv(t,e,Uv({transport:(r=t,new Qv(r))}));var r}function rf(t,e){return Tv(t,e,Uv({transport:(r={url:t.url,headers:t.headers},new Kv(r))}));var r}function nf(t,i,n){return e((function*(){var e=r({},yield n()),o={};return null!=i&&Object.assign(o,yield i()),null!=t&&Object.assign(o,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Pd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(o,e)}))}function of(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function sf(t,e,i){var n,o;return r({},function(t,e,r){var i,n,o,s,a,u;return{timeoutMillis:Oc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(o=null!==(s=t.concurrencyLimit)&&void 0!==s?s:e.concurrencyLimit)&&void 0!==o?o:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:nf(t.headers,e.headers,i.headers),url:null!==(n=null!==(o=of(t.url))&&void 0!==o?o:e.url)&&void 0!==n?n:i.url})}function af(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function uf(t,i,n){return sf({url:t.url,timeoutMillis:t.timeoutMillis,headers:af(t),concurrencyLimit:t.concurrencyLimit},{},function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function lf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?ef:tf:rf)(uf(t,r,i),e)}class hf extends Mc{constructor(t){void 0===t&&(t={}),super(lf(t,Gv,"v1/logs",{"Content-Type":"application/json"}))}}class cf{set severityText(t){this.Ut()||(this.Wt=t)}get severityText(){return this.Wt}set severityNumber(t){this.Ut()||(this.Xt=t)}get severityNumber(){return this.Xt}set body(t){this.Ut()||(this.Jt=t)}get body(){return this.Jt}get eventName(){return this.Kt}set eventName(t){this.Ut()||(this.Kt=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Wt=void 0,this.Xt=void 0,this.Jt=void 0,this.Kt=void 0,this.totalAttributesCount=0,this.Qt=!1,this.te=void 0;var{timestamp:i,observedTimestamp:n,eventName:o,severityNumber:s,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=ev(null!=i?i:c),this.hrTimeObserved=ev(null!=n?n:c),h){var d=Bd.getSpanContext(h);d&&xd(d)&&(this.spanContext=d)}this.severityNumber=s,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.te=t.logRecordLimits,this.Kt=o,this.setAttributes(l)}setAttribute(t,e){return this.Ut()||null===e?this:0===t.length?(Pd.warn("Invalid attribute key: "+t),this):jd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.te.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Pd.warn("Dropping extra attributes."),this):(jd(e)?this.attributes[t]=this.ee(e):this.attributes[t]=e,this)):(Pd.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}re(){this.Qt=!0}ee(t){var e=this.te.attributeValueLengthLimit;return e<=0?(Pd.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.ie(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.ie(t,e):t)):t}ie(t,e){return t.length<=e?t:t.substring(0,e)}Ut(){return this.Qt&&Pd.warn("Can not execute the operation on emitted log record"),this.Qt}}class df{constructor(t,e){this.instrumentationScope=void 0,this.ne=void 0,this.instrumentationScope=t,this.ne=e}emit(t){var e=t.context||Od.active(),i=new cf(this.ne,this.instrumentationScope,r({context:e},t));this.ne.activeProcessor.onEmit(i,e),i.re()}}class vf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class ff{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>Cv(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class pf{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new ff(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new vf}}class gf{constructor(t){var e,r,i;void 0===t&&(t={}),this.oe=void 0,this.ne=void 0;var n,o,s,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=pv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Vv({"service.name":"unknown_service",[Gd]:Wd[Gd],[Yd]:Wd[Yd],[Ud]:Wd[Ud]});this.ne=new pf(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(o=null!==(s=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==s?s:void 0)&&void 0!==o?o:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.oe=new Sv(this.se,this)}getLogger(t,e,r){if(this.oe.isCalled)return Pd.warn("A shutdown LoggerProvider cannot provide a Logger"),Ic;t||Pd.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.ne.loggers.has(n)||this.ne.loggers.set(n,new df({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.ne)),this.ne.loggers.get(n)}forceFlush(){return this.oe.isCalled?(Pd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.oe.promise):this.ne.activeProcessor.forceFlush()}shutdown(){return this.oe.isCalled?(Pd.warn("shutdown may only be called once per LoggerProvider"),this.oe.promise):this.oe.call()}se(){return this.ne.activeProcessor.shutdown()}}class mf{constructor(t,e){var r,i,n,o,s,a,u,l;this.ae=void 0,this.ue=void 0,this.le=void 0,this.he=void 0,this.ce=void 0,this.de=!1,this.ve=[],this.fe=void 0,this.oe=void 0,this.ae=t,this.ue=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.le=null!==(n=null!==(o=null==e?void 0:e.maxQueueSize)&&void 0!==o?o:void 0)&&void 0!==n?n:2048,this.he=null!==(s=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==s?s:5e3,this.ce=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.oe=new Sv(this.se,this),this.ue>this.le&&(Pd.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.ue=this.le)}onEmit(t){this.oe.isCalled||this.pe(t)}forceFlush(){return this.oe.isCalled?this.oe.promise:this.ge()}shutdown(){return this.oe.call()}se(){var t=this;return e((function*(){t.onShutdown(),yield t.ge(),yield t.ae.shutdown()}))()}pe(t){this.ve.length>=this.le||(this.ve.push(t),this.me())}ge(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ve.length/this.ue),n=0;n<i;n++)r.push(this.ye());Promise.all(r).then((()=>{t()})).catch(e)}))}ye(){return this.be(),0===this.ve.length?Promise.resolve():new Promise(((t,e)=>{Cv(this.Pt(this.ve.splice(0,this.ue)),this.ce).then((()=>t())).catch(e)}))}me(){if(!this.de){var t=()=>{this.de=!0,this.ye().then((()=>{this.de=!1,this.ve.length>0&&(this.be(),this.me())})).catch((t=>{this.de=!1,Hd(t)}))};if(this.ve.length>=this.ue)return t();void 0===this.fe&&(this.fe=setTimeout((()=>t()),this.he),"number"!=typeof this.fe&&this.fe.unref())}}be(){void 0!==this.fe&&(clearTimeout(this.fe),this.fe=void 0)}Pt(t){var e=()=>kv.Pt(this.ae,t).then((t=>{var e;t.code!==Vd.SUCCESS&&Hd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Hd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,Hd)}}class yf extends mf{constructor(t,e){super(t,e),this.we=void 0,this._e=void 0,this.Ce(e)}onShutdown(){"undefined"!=typeof document&&(this.we&&document.removeEventListener("visibilitychange",this.we),this._e&&document.removeEventListener("pagehide",this._e))}Ce(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.we=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._e=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.we),document.addEventListener("pagehide",this._e))}}var bf=1e4,wf=function(t,e,r,i,n,o){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=bf),void 0===o&&(o=new WeakSet),o.has(t))return r[e||"circular"]="[Circular]",r;for(var s in o.add(t),t)if(Object.prototype.hasOwnProperty.call(t,s)){var a=t[s],u=e?e+"."+s:s;if(ti(a))wf(a,u,r,i,n,o);else{if(i-=1,n-=String(a).length,n-=u.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[u]=a}}return r},_f={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:so.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Nc.setGlobalLoggerProvider(new gf({resource:Vv(e),processors:[new yf(new hf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Nc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:o}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:o.toString()}}var s=function(n){var o=so.console[n];so.console[n]=(o=>function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];if(a.length>0){var l=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!oi(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>bf&&(l=l.slice(0,bf)+"...",i.body_truncated="true"),e.emit({severityText:_f[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":so.location.href},i,ti(a[0])?wf(a[0]):{})}),o.apply(so.console,a)}})(o)};for(var a of["debug","log","warn","error","info"])s(a)}};var Cf=vo("[Error tracking]");function If(){return new In([new Dn,new Yn,new $n,new Bn,new zn,new Vn,new Zn,new Gn],Ln())}class Sf{constructor(t){var e,r;this.Ie=[],this.Se=If(),this._instance=t,this.Ie=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Zo))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.Ie=n,this._instance.persistence&&this._instance.persistence.register({[Zo]:this.Ie,[qo]:o})}get ke(){var t,e=!!this._instance.get_property(qo),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Se.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.xe(e)){if(this.Ae(e))return void Cf.info("Skipping exception capture because a suppression rule matched");if(!this.ke&&this.Te(e))return void Cf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ee(e))return void Cf.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Ae(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ii(r)&&r.length>0&&t.$exception_types.push(r),ii(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ie.some((t=>{var r=t.values.map((t=>{var r,i=Wl[t.operator],n=Jr(t.value)?t.value:[t.value],o=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,o)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Te(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://")))}Ee(t){if(t.length>0){var e,r,i,n,o=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],s=o[o.length-1];return null!==(i=null==s||null==(n=s.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}xe(t){return!si(t)&&Jr(t)}}var kf=vo("[ExceptionAutocapture]"),xf=If(),Af={wrapOnError:t=>{var e=Un;e||kf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n[4],a=n[0],u=xf.buildFromUnknown(s||a,{mechanism:{handled:!1}});return t(u),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Un;e||kf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=xf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||kf.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),o=0;o<i;o++)n[o]=arguments[o];e=1==n.length?n[0]:n.join(" ");var s=n.find((t=>t instanceof Error)),a=xf.buildFromUnknown(s||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.errorWrappingFunctions=Af,so.posthogErrorWrappingFunctions=Af;var Tf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Jr(t)||t.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}e!==ds&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};so.__PosthogExtensions__=so.__PosthogExtensions__||{};var Ef={_patchFetch:(t,r,i)=>Fo(Un,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return Tf(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Fo(Un.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,u){void 0===s&&(s=!0);var l=new Request(o);return Tf(t,e,r,l),i.call(this,n,l.url,s,a,u)}))};so.__PosthogExtensions__.tracingHeadersPatchFns=Ef,so.postHogTracingHeadersPatchFns=Ef;var Rf=-1,Nf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Rf=e.timeStamp,t(e))}),!0)},Mf=(t,e,r,i)=>{var n,o;return s=>{e.value>=0&&(s||i)&&(((o=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e)))}},Ff=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Of=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Pf=()=>{var t,e=Of();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},Lf=function(t,e){void 0===e&&(e=-1);var r=Of(),i="navigate";return Rf>=0?i="back-forward-cache":r&&(document.prerendering||Pf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Df=new WeakMap;function Bf(t,e){return Df.get(t)||Df.set(t,new e),Df.get(t)}class $f{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&&t.startTime-i.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var jf,Zf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},qf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Hf=-1,Vf=new Set,zf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Gf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Vf)e();isFinite(Hf)||(Hf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Gf,!0))}},Yf=()=>{if(Hf<0){var t,e=Pf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;Hf=null!=r?r:zf(),addEventListener("visibilitychange",Gf,!0),addEventListener("prerenderingchange",Gf,!0),Nf((()=>{setTimeout((()=>{Hf=zf()}))}))}return{get firstHiddenTime(){return Hf},onHidden(t){Vf.add(t)}}},Uf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Wf=[1800,3e3],Xf=function(t,e){void 0===e&&(e={}),Uf((()=>{var r,i=Yf(),n=Lf("FCP"),o=Zf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Pf(),0),n.entries.push(e),r(!0)))}));o&&(r=Mf(t,n,Wf,e.reportAllChanges),Nf((i=>{n=Lf("FCP"),r=Mf(t,n,Wf,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Jf=[.1,.25],Kf=0,Qf=1/0,tp=0,ep=t=>{for(var e of t)e.interactionId&&(Qf=Math.min(Qf,e.interactionId),tp=Math.max(tp,e.interactionId),Kf=tp?(tp-Qf)/7+1:0)},rp=()=>{var t;return jf?Kf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ip=0;class np{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){ip=rp(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((rp()-ip)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var o=this.u.splice(10);for(var s of o)this.l.delete(s.id)}null==(n=this.p)||n.call(this,i)}}}}var op=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=qf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},sp=[200,500];class ap{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var up=[2500,4e3],lp={onLCP:function(t,e){void 0===e&&(e={}),Uf((()=>{var r,i=Yf(),n=Lf("LCP"),o=Bf(e,ap),s=t=>{for(var s of(e.reportAllChanges||(t=t.slice(-1)),t))o.h(s),s.startTime<i.firstHiddenTime&&(n.value=Math.max(s.startTime-Pf(),0),n.entries=[s],r())},a=Zf("largest-contentful-paint",s);if(a){r=Mf(t,n,up,e.reportAllChanges);var u=qf((()=>{s(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(op(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Nf((i=>{n=Lf("LCP"),r=Mf(t,n,up,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(t,e){void 0===e&&(e={});var r=Yf();Xf(qf((()=>{var i,n=Lf("CLS",0),o=Bf(e,$f),s=t=>{for(var e of t)o.h(e);o.i>n.value&&(n.value=o.i,n.entries=o.o,i())},a=Zf("layout-shift",s);a&&(i=Mf(t,n,Jf,e.reportAllChanges),r.onHidden((()=>{s(a.takeRecords()),i(!0)})),Nf((()=>{o.i=0,n=Lf("CLS",0),i=Mf(t,n,Jf,e.reportAllChanges),Ff((()=>i()))})),setTimeout(i))})))},onFCP:Xf,onINP:function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Yf();Uf((()=>{var i;"interactionCount"in performance||jf||(jf=Zf("event",ep,{type:"event",buffered:!0,durationThreshold:0}));var n,o=Lf("INP"),s=Bf(e,np),a=t=>{op((()=>{for(var e of t)s.h(e);var r=s.L();r&&r.P!==o.value&&(o.value=r.P,o.entries=r.entries,n())}))},u=Zf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Mf(t,o,sp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Nf((()=>{s.v(),o=Lf("INP"),n=Mf(t,o,sp,e.reportAllChanges)})))}))}}};so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.postHogWebVitalsCallbacks=lp,so.postHogWebVitalsCallbacks=lp,so.__PosthogExtensions__.loadWebVitalsCallbacks=()=>lp;class hp{constructor(t){this.disabled=!1===t;var e=ti(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var cp="$copy_autocapture",dp=vo("[AutoCapture]");function vp(t,e){return e.length>t?e.slice(0,t)+"...":e}function fp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ps(e));return e}function pp(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};ks.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=vp(1024,Vs(t)):o.$el_text=vp(1024,Is(t)));var s=_s(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),go(t.attributes,(function(r){var n;if((!Ls(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Hs(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=bs(s).join(" ")),o["attr__"+r.name]=vp(1024,s)}}));for(var a=1,u=1,l=t;l=fp(l);)a++,l.tagName===t.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function gp(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!gs(h,"body");)ys(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(go(l,(t=>{var e=Ps(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Hs(f)&&f),Vr(_s(t),"ph-no-capture")&&(p=!0),d.push(pp(t,o,s,a));var r=function(t){if(!Ps(t))return{};var e={};return go(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&&Hs(i)&&(e[r]=i)}})),e}(t);mo(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Vs(t):d[0].$el_text=Is(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=To(f))?void 0:g.host,b=null==Un||null==(m=Un.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:mo({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Gs(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class mp{constructor(t){this.Re=!1,this.Ne=null,this.Me=!1,this.instance=t,this.rageclicks=new hp(t.config.rageclick),this.Fe=null}get Oe(){var t,e,r=ti(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}Pe(){if(this.isBrowserSupported()){if(Un&&to){var t=t=>{t=t||(null==Un?void 0:Un.event);try{this.Le(t)}catch(t){dp.error("Failed to capture event",t)}};if(Ao(to,"submit",t,{capture:!0}),Ao(to,"change",t,{capture:!0}),Ao(to,"click",t,{capture:!0}),this.Oe.capture_copied_text){var e=t=>{t=t||(null==Un?void 0:Un.event),this.Le(t,cp)};Ao(to,"copy",e,{capture:!0}),Ao(to,"cut",e,{capture:!0})}}}else dp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Re&&(this.Pe(),this.Re=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Me=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Bo]:!!t.autocapture_opt_out}),this.Ne=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fe=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fe)||e.forEach((e=>{var i=null==to?void 0:to.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[Bo],i=this.Ne;if(oi(i)&&!li(r)&&!this.instance.De())return!1;var n=null!==(e=this.Ne)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Le(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Ss(t);if(ms(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())&&Ns(i,this.instance.config.rageclick)&&this.Le(t,"$rageclick");var n=e===cp;if(i&&Os(i,t,this.Oe,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=gp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:this.Me});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===cp){var u,l=Cs(null==Un||null==(u=Un.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;o.$selected_content=l,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Kr(null==to?void 0:to.querySelectorAll)}}var yp={};function bp(t){return function(t,e){var r=yp[t];if(r)return r;var i=e[t];if(Qr(i)&&!ao())return yp[t]=i.bind(e);var n=e.document;if(n&&Kr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){co.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Kr(i)?yp[t]=i.bind(e):i}("MutationObserver",t)}function wp(t,e){return ai(t)&&t>=e}class _p{Be(t){var e,r,i,n,o,s=this.$e((null==t?void 0:t.__onCapture)||this.je.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:s.capture_clicks_with_modifier_keys,__onCapture:s.__onCapture}}constructor(t,e){this.Ze=[],this.$e=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.qe=t=>{var e=function(t){var e=Ss(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);oi(e)||this.He(e)||this.Ze.push(e),this.Ze.length&&ri(this.Ve)&&(this.Ve=so.setTimeout((()=>{this.ze()}),1e3))},this.Ge=()=>{var t=Date.now();t%50==0&&this.Ze.forEach((e=>{ri(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ye=()=>{this.Ue=Date.now()},this.instance=t,this.Oe=this.Be(e),this._onCapture=this.Oe.__onCapture}start(t){this.We(),this.Xe(),this.Je(),this.Ke(t)}Ke(t){if(!this.Qe){var e=bp(so);this.Qe=new e((t=>{this.tr(t)})),this.Qe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qe)||t.disconnect(),this.Qe=void 0,so.removeEventListener("click",this.qe),so.removeEventListener("scroll",this.Ge,{capture:!0}),so.removeEventListener("selectionchange",this.Ye)}tr(t){this.er=Date.now()}We(){Ao(so,"click",this.qe)}Xe(){Ao(so,"scroll",this.Ge,{capture:!0})}Je(){Ao(so,"selectionchange",this.Ye)}He(t){if(!t)return!0;if(!this.Oe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(fs(t.node))return!0;var r=this.Ze.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!gs(t.node,"html")&&ps(t.node)&&!ks.includes(t.node.tagName.toLowerCase()))}ze(){if(this.Ze.length){clearTimeout(this.Ve),this.Ve=void 0;var t=this.Ze;for(var e of(this.Ze=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.er&&e.timestamp<=this.er?this.er-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ue&&e.timestamp<=this.Ue?this.Ue-e.timestamp:void 0;var i=wp(e.scrollDelayMs,this.Oe.scroll_threshold_ms),n=wp(e.selectionChangedDelayMs,this.Oe.selection_change_threshold_ms),o=wp(e.mutationDelayMs,this.Oe.mutation_threshold_ms),s=wp(e.absoluteDelayMs,1.1*this.Oe.mutation_threshold_ms),a=ai(e.scrollDelayMs)&&e.scrollDelayMs<this.Oe.scroll_threshold_ms,u=ai(e.mutationDelayMs)&&e.mutationDelayMs<this.Oe.mutation_threshold_ms,l=ai(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.Oe.selection_change_threshold_ms;a||u||l||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.er,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.Oe.mutation_threshold_ms&&this.Ze.push(e))}this.Ze.length&&ri(this.Ve)&&(this.Ve=so.setTimeout((()=>{this.ze()}),1e3))}}je(t,e){this.instance.capture("$dead_click",r({},e,gp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new _p(t,e);var Cp=vo("[ExternalScriptsLoader]"),Ip=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Cp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==to?void 0:to.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!to)return r("document not found");var i=to.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)to.head.appendChild(i);else{var n,o=to.querySelectorAll("body > script");if(o.length>0)null==(n=o[0].parentNode)||n.insertBefore(i,o[0]);else to.body.appendChild(i)}};null!=to&&to.body?a():null==to||to.addEventListener("DOMContentLoaded",a)};so.__PosthogExtensions__=so.__PosthogExtensions__||{},so.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);Ip(t,o,r)},so.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Ip(t,i,r)};var Sp="";var kp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xp(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=to),Sp)return Sp;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_"+rl();!Sp&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",Sp=o)}return Sp}(t);if(!r){var i=(t=>{var e=t.match(kp);return e?e[0]:""})(t);i!==r&&co.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ap={rr:()=>!!to,ir:function(t){co.error("cookieStore error: "+t)},nr:function(t){if(to){try{for(var e=t+"=",r=to.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},sr:function(t){var e;try{e=JSON.parse(Ap.nr(t))||{}}catch(t){}return e},ar:function(t,e,r,i,n){if(to)try{var o="",s="",a=xp(to.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),o="; expires="+u.toUTCString()}n&&(s="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&co.warn("cookieStore warning: large cookie, len="+l.length),to.cookie=l,l}catch(t){return}},ur:function(t,e){if(null!=to&&to.cookie)try{Ap.ar(t,"",-1,e)}catch(t){return}}},Tp=null,Ep={rr:function(){if(!oi(Tp))return Tp;var t=!0;if(ri(Un))t=!1;else try{var e="__mplssupport__";Ep.ar(e,"xyz"),'"xyz"'!==Ep.nr(e)&&(t=!1),Ep.ur(e)}catch(e){t=!1}return t||co.error("localStorage unsupported; falling back to cookie store"),Tp=t,t},ir:function(t){co.error("localStorage error: "+t)},nr:function(t){try{return null==Un?void 0:Un.localStorage.getItem(t)}catch(t){Ep.ir(t)}return null},sr:function(t){try{return JSON.parse(Ep.nr(t))||{}}catch(t){}return null},ar:function(t,e){try{null==Un||Un.localStorage.setItem(t,JSON.stringify(e))}catch(t){Ep.ir(t)}},ur:function(t){try{null==Un||Un.localStorage.removeItem(t)}catch(t){Ep.ir(t)}}},Rp=["$device_id","distinct_id",Uo,Wo,hs,ls],Np={},Mp={rr:function(){return!0},ir:function(t){co.error("memoryStorage error: "+t)},nr:function(t){return Np[t]||null},sr:function(t){return Np[t]||null},ar:function(t,e){Np[t]=e},ur:function(t){delete Np[t]}},Fp=null,Op={rr:function(){if(!oi(Fp))return Fp;if(Fp=!0,ri(Un))Fp=!1;else try{var t="__support__";Op.ar(t,"xyz"),'"xyz"'!==Op.nr(t)&&(Fp=!1),Op.ur(t)}catch(t){Fp=!1}return Fp},ir:function(t){co.error("sessionStorage error: ",t)},nr:function(t){try{return null==Un?void 0:Un.sessionStorage.getItem(t)}catch(t){Op.ir(t)}return null},sr:function(t){try{return JSON.parse(Op.nr(t))||null}catch(t){}return null},ar:function(t,e){try{null==Un||Un.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Op.ir(t)}},ur:function(t){try{null==Un||Un.sessionStorage.removeItem(t)}catch(t){Op.ir(t)}}},Pp=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Lp{constructor(t){this._instance=t}get Oe(){return this._instance.config}get consent(){return this.lr()?Pp.DENIED:this.hr}isOptedOut(){return"always"===this.Oe.cookieless_mode||(this.consent===Pp.DENIED||this.consent===Pp.PENDING&&(this.Oe.opt_out_capturing_by_default||"on_reject"===this.Oe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Pp.DENIED}optInOut(t){this.cr.ar(this.dr,t?1:0,this.Oe.cookie_expiration,this.Oe.cross_subdomain_cookie,this.Oe.secure_cookie)}reset(){this.cr.ur(this.dr,this.Oe.cross_subdomain_cookie)}get dr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get hr(){var t=this.cr.nr(this.dr);return gi(t)?Pp.GRANTED:Vr(mi,t)?Pp.DENIED:Pp.PENDING}get cr(){if(!this.vr){var t=this.Oe.opt_out_capturing_persistence_type;this.vr="localStorage"===t?Ep:Ap;var e="localStorage"===t?Ap:Ep;e.nr(this.dr)&&(this.vr.nr(this.dr)||this.optInOut(gi(e.nr(this.dr))),e.ur(this.dr,this.Oe.cross_subdomain_cookie))}return this.vr}lr(){return!!this.Oe.respect_dnt&&!!xo([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,so.doNotTrack],(t=>gi(t)))}}var Dp=vo("[Dead Clicks]"),Bp=()=>!0,$p=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Vo)),i=t.instance.config.capture_dead_clicks;return li(i)?i:!!ti(i)||r};class jp{get lazyLoadedDeadClicksAutocapture(){return this.pr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[Vo]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this.gr((()=>{this.mr()})):this.stop()}gr(t){var e,r;null!=(e=so.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Dp.error("failed to load script",e):t()}))}mr(){var t;if(to){if(!this.pr&&null!=(t=so.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=ti(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.pr=so.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.pr.start(to),Dp.info("starting...")}}else Dp.error("`document` not found. Cannot start.")}stop(){this.pr&&(this.pr.stop(),this.pr=void 0,Dp.info("stopping..."))}}var Zp=vo("[ExceptionAutocapture]");class qp{constructor(t){var e,r,i;this.yr=()=>{var t;if(Un&&this.isEnabled&&null!=(t=so.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=so.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=so.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=so.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.br&&this.Oe.capture_unhandled_errors&&(this.br=e(this.captureException.bind(this))),!this.wr&&this.Oe.capture_unhandled_rejections&&(this.wr=r(this.captureException.bind(this))),!this._r&&this.Oe.capture_console_errors&&(this._r=i(this.captureException.bind(this)))}catch(t){Zp.error("failed to start",t),this.Cr()}}},this._instance=t,this.Ir=!(null==(e=this._instance.persistence)||!e.props[jo]),this.Sr=new bi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,k:Zp}),this.Oe=this.kr(),this.startIfEnabledOrStop()}kr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(t)?e=r({},e,t):(ri(t)?this.Ir:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Oe.capture_console_errors||this.Oe.capture_unhandled_errors||this.Oe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Zp.info("enabled"),this.Cr(),this.gr(this.yr)):this.Cr()}gr(t){var e,r;null!=(e=so.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Zp.error("failed to load script",e);t()}))}Cr(){var t,e,r;null==(t=this.br)||t.call(this),this.br=void 0,null==(e=this.wr)||e.call(this),this.wr=void 0,null==(r=this._r)||r.call(this),this._r=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.Ir=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[jo]:this.Ir}),this.Oe=this.kr(),this.startIfEnabledOrStop()}onConfigChange(){this.Oe=this.kr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Sr.consumeRateLimit(i)?Zp.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Hp{constructor(t){var e;this._instance=t,this.Ar=(null==Un||null==(e=Un.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(co.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Tr&&this.Tr(),this.Tr=void 0,co.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Un&&Un.history){var r=this;null!=(t=Un.history.pushState)&&t.__posthog_wrapped__||Fo(Un.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("pushState")})),null!=(e=Un.history.replaceState)&&e.__posthog_wrapped__||Fo(Un.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("replaceState")})),this.Rr()}}Er(t){try{var e,r=null==Un||null==(e=Un.location)?void 0:e.pathname;if(!r)return;r!==this.Ar&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Ar=r}catch(e){co.error("Error capturing "+t+" pageview",e)}}Rr(){if(!this.Tr){var t=()=>{this.Er("popstate")};Ao(Un,"popstate",t),this.Tr=()=>{Un&&Un.removeEventListener("popstate",t)}}}}var Vp=vo("[SegmentIntegration]");function zp(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()||rl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(ns,"identified")),e()},n=r.user();"then"in n&&Kr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Vp.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()||(Vp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Vp.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var Gp="posthog-js";function Yp(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Up{constructor(t,e,r,i,n,o){this.name=Gp,this.setupOnce=function(s){s(Yp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var Wp=null!=Un&&Un.location?Mo(Un.location.hash,"__posthog")||Mo(location.hash,"state"):null,Xp="_postHogToolbarParams",Jp=vo("[Toolbar]"),Kp=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Kp||{});class Qp{constructor(t){this.instance=t}Nr(t){so.ph_toolbar_state=t}Mr(){var t;return null!==(t=so.ph_toolbar_state)&&void 0!==t?t:Kp.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Un||!to)return!1;t=null!=t?t:Un.location,r=null!=r?r:Un.history;try{if(!e){try{Un.localStorage.setItem("test","test"),Un.localStorage.removeItem("test")}catch(t){return!1}e=null==Un?void 0:Un.localStorage}var i,n=Wp||Mo(t.hash,"__posthog")||Mo(t.hash,"state"),o=n?wo((()=>JSON.parse(atob(decodeURIComponent(n)))))||wo((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Fr(t){var e=so.ph_load_toolbar||so.ph_load_editor;!si(e)&&Kr(e)?e(t,this.instance):Jp.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==to||!to.getElementById(cs));if(!Un||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(Un.localStorage.setItem(Xp,JSON.stringify(r({},n,{source:void 0}))),this.Mr()===Kp.LOADED)this.Fr(n);else if(this.Mr()===Kp.UNINITIALIZED){var o;this.Nr(Kp.LOADING),null==(o=so.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Jp.error("[Toolbar] Failed to load",t),void this.Nr(Kp.UNINITIALIZED);this.Nr(Kp.LOADED),this.Fr(n)})),Ao(Un,"turbolinks:load",(()=>{this.Nr(Kp.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Or(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var tg=vo("[TracingHeaders]");class eg{constructor(t){this.Pr=void 0,this.Lr=void 0,this.yr=()=>{var t,e;ri(this.Pr)&&(null==(t=so.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this.Lr)&&(null==(e=so.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}gr(t){var e,r;null!=(e=so.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return tg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.gr(this.yr):(null==(t=this.Pr)||t.call(this),null==(e=this.Lr)||e.call(this),this.Pr=void 0,this.Lr=void 0)}}var rg="https?://(.*)",ig=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ng=yo(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ig),og="<masked>",sg=["li_fat_id"];function ag(t,e,r){if(!to)return{};var i,n=e?yo([],ig,r||[]):[],o=ug(No(to.URL,n,og),t),s=(i={},go(sg,(function(t){var e=Ap.nr(t);i[t]=e||null})),i);return mo(s,o)}function ug(t,e){var r=ng.concat(e||[]),i={};return go(r,(function(e){var r=Ro(t,e);i[e]=r||null})),i}function lg(t){var e=function(t){return t?0===t.search(rg+"google.([^/?]*)")?"google":0===t.search(rg+"bing.com")?"bing":0===t.search(rg+"yahoo.com")?"yahoo":0===t.search(rg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!oi(e)){i.$search_engine=e;var n=to?Ro(to.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function hg(){return navigator.language||navigator.userLanguage}function cg(){return(null==to?void 0:to.referrer)||"$direct"}function dg(t,e){var r=t?yo([],ig,e||[]):[],i=null==eo?void 0:eo.href.substring(0,1e3);return{r:cg().substring(0,1e3),u:i?No(i,r,og):void 0}}function vg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=To(r))?void 0:e.host};if(i){n.$current_url=i;var o=To(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=ug(i);mo(n,s)}if(r){var a=lg(r);mo(n,a)}return n}function fg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function pg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function gg(t,e){if(!oo)return{};var r,i=t?yo([],ig,e||[]):[],[n,o]=function(t){for(var e=0;e<yn.length;e++){var[r,i]=yn[e],n=r.exec(t),o=n&&(Kr(i)?i(n,t):i);if(o)return o}return["",""]}(oo);return mo(Co({$os:n,$os_version:o,$browser:pn(oo,navigator.vendor),$device:bn(oo),$device_type:wn(oo),$timezone:fg(),$timezone_offset:pg()}),{$current_url:No(null==eo?void 0:eo.href,i,og),$host:null==eo?void 0:eo.host,$pathname:null==eo?void 0:eo.pathname,$raw_user_agent:oo.length>1e3?oo.substring(0,997)+"...":oo,$browser_version:mn(oo,navigator.vendor),$browser_language:hg(),$browser_language_prefix:(r=hg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Un?void 0:Un.screen.height,$screen_width:null==Un?void 0:Un.screen.width,$viewport_height:null==Un?void 0:Un.innerHeight,$viewport_width:null==Un?void 0:Un.innerWidth,$lib:"web",$lib_version:lo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var mg=vo("[Web Vitals]"),yg=9e5;class bg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Br=()=>{clearTimeout(this.$r),0!==this.B.metrics.length&&(this._instance.capture("$web_vitals",this.B.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.pe=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ri(i))mg.error("Could not read session ID. Dropping metrics!");else{this.B=this.B||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.jr();if(!ri(n))if(si(null==t?void 0:t.name)||si(null==t?void 0:t.value))mg.error("Invalid metric received",t);else if(this.Zr&&t.value>=this.Zr)mg.error("Ignoring metric with value >= "+this.Zr,t);else this.B.url!==n&&(this.Br(),this.$r=setTimeout(this.Br,this.flushToCaptureTimeoutMs)),ri(this.B.url)&&(this.B.url=n),this.B.firstMetricTimestamp=ri(this.B.firstMetricTimestamp)?Date.now():this.B.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.B.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.B.metrics.length===this.allowedMetrics.length&&this.Br()}},this.yr=()=>{if(!this.Re){var t,e,r,i,n=so.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.pe.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.pe.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.pe.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.pe.bind(this)),this.Re=!0):mg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Dr=!(null==(e=this._instance.persistence)||!e.props[Ho]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=ti(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return si(r)?(null==(e=this._instance.persistence)?void 0:e.props[Go])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=t&&t}get Zr(){var t=ti(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:yg;return 0<t&&t<=6e4?yg:t}get isEnabled(){var t=null==eo?void 0:eo.protocol;if("http:"!==t&&"https:"!==t)return mg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:li(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return li(e)?e:this.Dr}startIfEnabled(){this.isEnabled&&!this.Re&&(mg.info("enabled, starting..."),this.gr(this.yr))}onRemoteConfig(t){var e=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ho]:e}),this._instance.persistence.register({[Go]:r})),this.Dr=e,this.startIfEnabled()}gr(t){var e,r;if(null!=(e=so.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks)t();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(e=>{e?mg.error("failed to load script",e):t()}))}}jr(){var t=Un?Un.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?yo([],ig,r||[]):[];return No(t,i,og)}mg.error("Could not determine current URL")}}var wg=vo("[Heatmaps]");function _g(t){return ti(t)&&"clientX"in t&&"clientY"in t&&ai(t.clientX)&&ai(t.clientY)}class Cg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.qr=null,this.instance=t,this.Dr=!(null==(e=this.instance.persistence)||!e.props[$o]),this.rageclicks=new hp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return ti(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return si(this.instance.config.capture_heatmaps)?si(this.instance.config.enable_heatmaps)?this.Dr:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Re)return;wg.info("starting..."),this.Hr(),this.Vr()}else{var t;clearInterval(null!==(t=this.qr)&&void 0!==t?t:void 0),this.zr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$o]:e}),this.Dr=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.B;return this.B=void 0,t}Gr(t){this.qe(t.originalEvent,"deadclick")}Vr(){this.qr&&clearInterval(this.qr),this.qr=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(to)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Hr(){Un&&to&&(this.Ur=this.Yr.bind(this),Ao(Un,"beforeunload",this.Ur),this.Wr=t=>this.qe(t||(null==Un?void 0:Un.event)),Ao(to,"click",this.Wr,{capture:!0}),this.Xr=t=>this.Jr(t||(null==Un?void 0:Un.event)),Ao(to,"mousemove",this.Xr,{capture:!0}),this.Kr=new jp(this.instance,Bp,this.Gr.bind(this)),this.Kr.startIfEnabledOrStop(),this.Qr=this.Vr.bind(this),Ao(to,"visibilitychange",this.Qr),this.Re=!0)}zr(){var t;Un&&to&&(this.Ur&&Un.removeEventListener("beforeunload",this.Ur),this.Wr&&to.removeEventListener("click",this.Wr,{capture:!0}),this.Xr&&to.removeEventListener("mousemove",this.Xr,{capture:!0}),this.Qr&&to.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.ti),null==(t=this.Kr)||t.stop(),this.Re=!1)}ei(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&ps(i)&&!gs(i,"body");){if(i===r)return!1;if(Vr(e,null==Un?void 0:Un.getComputedStyle(i).position))return!0;i=As(i)}return!1}(Ss(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}qe(t,e){var i;if(void 0===e&&(e="click"),!fs(t.target)&&_g(t)){var n=this.ei(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.ri(r({},n,{type:"rageclick"})),this.ri(n)}}Jr(t){!fs(t.target)&&_g(t)&&(clearTimeout(this.ti),this.ti=setTimeout((()=>{this.ri(this.ei(t,"mousemove"))}),500))}ri(t){if(Un){var e=Un.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?yo([],ig,i||[]):[],o=No(e,n,og);this.B=this.B||{},this.B[o]||(this.B[o]=[]),this.B[o].push(t)}}Yr(){this.B&&!ei(this.B)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ig{constructor(t){this.ii=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(co.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ni=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.oi()}oi(){var t;this.si=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ii)}destroy(){var t;null==(t=this.si)||t.call(this),this.si=void 0}doPageView(t,e){var r,i=this.ai(t,e);return this.ni={pathname:null!==(r=null==Un?void 0:Un.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ai(t,null==(e=this.ni)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ni)?void 0:t.pageViewId}}ai(t,e){var r=this.ni;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ri(o)||ri(s)||ri(a)||ri(u)||ri(l)||ri(h))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=o<=1?1:yi(s/o,0,1,co),d=o<=1?1:yi(a/o,0,1,co),v=u<=1?1:yi(l/u,0,1,co),f=u<=1?1:yi(h/u,0,1,co);i=mo(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Sg=vo("[FeatureFlags]"),kg=vo("[FeatureFlags]",{debugEnabled:!0}),xg="errors_while_computing_flags",Ag="flag_missing",Tg="quota_limited",Eg="timeout",Rg="connection_error",Ng="unknown_error",Mg=t=>"api_error_"+t,Fg="$active_feature_flags",Og="$override_feature_flags",Pg="$feature_flag_payloads",Lg="$override_feature_flag_payloads",Dg="$feature_flag_request_id",Bg="$feature_flag_evaluated_at",$g=t=>{var e={};for(var[r,i]of bo(t||{}))i&&(e[r]=i);return e},jg=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]})))):Sg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Zg=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class qg{constructor(t){this.ui=!1,this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.pi=!1,this._instance=t,this.featureFlagEventHandlers=[]}gi(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.pi||(Sg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.pi=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Sg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}mi(){return this.gi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.vi=!0;else{var t=!this.yi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.bi({disableFlags:t})}}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Ko),e=this._instance.get_property(Og),i=this._instance.get_property(Lg);if(!i&&!e)return t||{};var n=mo({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,u,l=n[s],h=null==e?void 0:e[s],c=ri(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ri(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[s],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[s]=f}return this.ui||(Sg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ui=!0),n}getFlagVariants(){var t=this._instance.get_property(Xo),e=this._instance.get_property(Og);if(!e)return t||{};for(var r=mo({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Sg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ui=!0),r}getFlagPayloads(){var t=this._instance.get_property(Pg),e=this._instance.get_property(Lg);if(!e)return t||{};for(var r=mo({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Sg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ui=!0),r}reloadFeatureFlags(){this.ci||this._instance.config.advanced_disable_feature_flags||this.yi||(this._instance.wi.emit("featureFlagsReloading",!0),this.yi=setTimeout((()=>{this.bi()}),5))}Ci(){clearTimeout(this.yi),this.yi=void 0}ensureFlagsLoaded(){this.li||this.hi||this.yi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ci=t}bi(t){var e;if(this.Ci(),!this._instance.De())if(this.hi)this.di=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Qo)||{}),group_properties:this._instance.get_property(ts)};oi(n)||ri(n)||(o.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.mi()&&(o.evaluation_contexts=this.gi());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);s&&(o.timezone=fg()),this.hi=!0,this._instance._send_request({method:"POST",url:l,data:o,compression:this._instance.config.disable_compression?void 0:ol.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n,s=!0;(200===t.statusCode&&(this.di||(this.$anon_distinct_id=void 0),s=!1),this.hi=!1,this.vi)||(this.vi=!0,this._instance.Ii(null!==(n=t.json)&&void 0!==n?n:{}));if(!o.disable_flags||this.di){this.fi=!s;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?Eg:Rg):a.push(Ng):200!==t.statusCode&&a.push(Mg(t.statusCode)),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push(xg);var u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes(Zg.FeatureFlags));if(u&&a.push(Tg),null==(i=this._instance.persistence)||i.register({[is]:a}),u)Sg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var l;if(!o.disable_flags)this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},s);this.di&&(this.di=!1,this.bi())}}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){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}Sg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}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={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=t in r,n=r[t],o=this.getFlagPayloads()[t],s=String(n),a=this._instance.get_property(Dg)||void 0,u=this._instance.get_property(Bg)||void 0,l=this._instance.get_property(rs)||{};if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(s))){var h,c,d,v,f,p,g,m,y,b;Jr(l[t])?l[t].push(s):l[t]=[s],null==(h=this._instance.persistence)||h.register({[rs]:l});var w=this.getFeatureFlagDetails(t),_=[...null!==(c=this._instance.get_property(is))&&void 0!==c?c:[]];ri(n)&&_.push(Ag);var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:o||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(d=this._instance.config.bootstrap)||null==(d=d.featureFlags)?void 0:d[t])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[t])||null,$used_bootstrap_value:!this.fi};ri(null==w||null==(f=w.metadata)?void 0:f.version)||(C.$feature_flag_version=w.metadata.version);var I,S=null!==(p=null==w||null==(g=w.reason)?void 0:g.description)&&void 0!==p?p:null==w||null==(m=w.reason)?void 0:m.code;if(S&&(C.$feature_flag_reason=S),null!=w&&null!=(y=w.metadata)&&y.id&&(C.$feature_flag_id=w.metadata.id),ri(null==w?void 0:w.original_variant)&&ri(null==w?void 0:w.original_enabled)||(C.$feature_flag_original_response=ri(w.original_variant)?w.original_enabled:w.original_variant),null!=w&&null!=(b=w.metadata)&&b.original_payload)C.$feature_flag_original_payload=null==w||null==(I=w.metadata)?void 0:I.original_payload;_.length&&(C.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",C)}if(i){var k=o;if(!ri(o))try{k=JSON.parse(o)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else Sg.warn('getFeatureFlagResult for key "'+t+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.mi()&&(i.evaluation_contexts=this.gi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:ol.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ri(r)?void 0:!!r}Sg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=jg(t),a=s.flags,u=s.featureFlags,l=s.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Jr(u)){Sg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[Fg]:u,[Xo]:d})}else{var f=u,p=l,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=r({},i,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=r({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=r({},o,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=r({},i,f),p=r({},n,p),g=r({},o,g);e&&e.register(r({[Fg]:Object.keys($g(f)),[Xo]:f||{},[Pg]:p||{},[Ko]:g||{}},h?{[Dg]:h}:{},c?{[Bg]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.Si(e)}}override(t,e){void 0===e&&(e=!1),Sg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Sg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Og),this._instance.persistence.unregister(Lg),this.Si(),kg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ui=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Og),kg.info("Flag overrides cleared");else if(r.flags){if(Jr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Og]:i})}else this._instance.persistence.register({[Og]:r.flags});kg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Lg),kg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lg]:r.payloads}),kg.info("Payload overrides set",{payloads:r.payloads}))),void this.Si()}this.Si()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.li){var{flags:e,flagVariants:r}=this.ki();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Jo)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Fg]:Object.keys($g(u)),[Xo]:u}),this.Si()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Jo),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Jo),null==(i=this._instance.persistence)||i.register({[Jo]:n}),t(n)}}})}ki(){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)),{})}}Si(t){var{flags:e,flagVariants:r}=this.ki();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Qo)||{};this._instance.register({[Qo]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Qo)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(ts)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[ts]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(ts)||{};this._instance.register({[ts]:r({},e,{[t]:{}})})}else this._instance.unregister(ts)}reset(){this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.$anon_distinct_id=void 0,this.Ci(),this.ui=!1}}var Hg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vg{constructor(t,e){this.Oe=t,this.props={},this.xi=!1,this.Ai=(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.cr=this.Ti(t),this.load(),t.debug&&co.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Ei}Ti(t){-1===Hg.indexOf(t.persistence.toLowerCase())&&(co.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Rp,...t];return r({},Ep,{sr:function(t){try{var e={};try{e=Ap.sr(t)||{}}catch(t){}var r=mo(e,JSON.parse(Ep.nr(t)||"{}"));return Ep.ar(t,r),r}catch(t){}return null},ar:function(t,r,i,n,o,s){try{Ep.ar(t,r,void 0,void 0,s);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Ap.ar(t,a,i,n,o,s)}catch(t){Ep.ir(t)}},ur:function(t,e){try{null==Un||Un.localStorage.removeItem(t),Ap.ur(t,e)}catch(t){Ep.ir(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Ep.rr()?Ep:"localstorage+cookie"===i&&e.rr()?e:"sessionstorage"===i&&Op.rr()?Op:"memory"===i?Mp:"cookie"===i?Ap:e.rr()?e:Ap}properties(){var t={};return go(this.props,(function(e,r){if(r===Xo&&ti(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(oi(o=vs)?a:Kn&&o.indexOf===Kn?-1!=o.indexOf(s):(go(o,(function(t){if(a||(a=t===s))return fo})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.Ei){var t=this.cr.sr(this.Ai);t&&(this.props=mo({},t))}}save(){this.Ei||this.cr.ar(this.Ai,this.props,this.Ri,this.Ni,this.Mi,this.Oe.debug)}remove(){this.cr.ur(this.Ai,!1),this.cr.ur(this.Ai,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(ti(t)){ri(e)&&(e="None"),this.Ri=ri(r)?this.Fi:r;var i=!1;if(go(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(ti(t)){this.Ri=ri(e)?this.Fi:e;var r=!1;if(go(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.xi){var t=ag(this.Oe.custom_campaign_params,this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties);ei(Co(t))||this.register(t),this.xi=!0}}update_search_keyword(){var t;this.register((t=null==to?void 0:to.referrer)?lg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:cg(),$referring_domain:null!=to&&to.referrer&&(null==(t=To(to.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[as]||this.props[us]||this.register_once({[ls]:dg(this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};go([us,as],(e=>{var r=this.props[e];r&&go(r,(function(e,r){t["$initial_"+Gr(r)]=e}))}));var e,r,i=this.props[ls];if(i){var n=(e=vg(i),r={},go(e,(function(t,e){r["$initial_"+Gr(e)]=t})),r);mo(t,n)}return t}safe_merge(t){return go(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Fi=this.Ri=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.Ti(t),n=this.props;this.clear(),this.cr=i,this.props=n,this.save()}}set_disabled(t){this.Ei=t,this.Ei?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ni&&(this.Ni=t,this.remove(),this.save())}set_secure(t){t!==this.Mi&&(this.Mi=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Do]||{};r[t]=e,this.props[Do]=r,this.save()}remove_event_timer(t){var e=(this.props[Do]||{})[t];return ri(e)||(delete this.props[Do][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var zg=vo("[Product Tours]"),Gg="ph_product_tours";class Yg{constructor(t){this.Oi=null,this.Pi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[zo]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.Oi||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(zo))||this.gr((()=>this.Li()))}gr(t){var e,r;null!=(e=so.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?zg.error("Could not load product tours script",e):t()}))}Li(){var t;!this.Oi&&null!=(t=so.__PosthogExtensions__)&&t.generateProductTours&&(this.Oi=so.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Jr(this.Pi)||e){var r=this._instance.persistence;if(r){var i=r.props[Gg];if(Jr(i)&&!e)return this.Pi=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return zg.error(n),void t([],{isLoaded:!1,error:n})}var o=Jr(e.json.product_tours)?e.json.product_tours:[];this.Pi=o,r&&r.register({[Gg]:o}),t(o,{isLoaded:!0})}})}else t(this.Pi,{isLoaded:!0})}getActiveProductTours(t){si(this.Oi)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Oi.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Oi)||e.showTourById(t)}previewTour(t){this.Oi?this.Oi.previewTour(t):this.gr((()=>{var e;this.Li(),null==(e=this.Oi)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Oi)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Oi)||t.nextStep()}previousStep(){var t;null==(t=this.Oi)||t.previousStep()}clearCache(){var t;this.Pi=null,null==(t=this._instance.persistence)||t.unregister(Gg)}resetTour(t){var e;null==(e=this.Oi)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Oi)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Oi)||e.cancelPendingTour(t)}}class Ug{constructor(){this.Di={},this.Di={}}on(t,e){return this.Di[t]||(this.Di[t]=[]),this.Di[t].push(e),()=>{this.Di[t]=this.Di[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Di[t]||[])r(e);for(var i of this.Di["*"]||[])i(t,e)}}function Wg(t,e,r){if(si(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 Xg{constructor(t){this.Bi=new Ug,this.$i=(t,e)=>this.ji(t,e)&&this.Zi(t,e)&&this.qi(t,e)&&this.Hi(t,e),this.ji=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Vi=new Set,this.zi=new Set}init(){var t;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)){var e;null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zi)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Vi)||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.Vi.has(t)||this.Vi.has(null==e?void 0:e.event))&&this.zi&&(null==(r=this.zi)?void 0:r.size)>0&&this.zi.forEach((t=>{this.Gi(e,t)&&this.Bi.emit("actionCaptured",t.name)}))}Yi(t){this.onAction("actionCaptured",(e=>t(e)))}Gi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.$i(t,r))return!0;return!1}onAction(t,e){return this.Bi.on(t,e)}Zi(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(!Wg(i,e.url,e.url_matching||"contains"))return!1}return!0}qi(t,e){return!!this.Ui(t,e)&&(!!this.Wi(t,e)&&!!this.Xi(t,e))}Ui(t,e){var r;if(null==e||!e.href)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Wg(t.href,e.href,e.href_matching||"exact")));var n,o=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!o&&Wg((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Wi(t,e){var r;if(null==e||!e.text)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Wg(t.text,e.text,e.text_matching||"exact")||Wg(t.$el_text,e.text,e.text_matching||"exact")));var n,o,s,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!si(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),o=e.text,s=e.text_matching||"exact",n.some((t=>Wg(t,o,s))))}Xi(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch(t){return!1}return!1}Ji(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Hi(t,e){return null==e||!e.properties||0===e.properties.length||Jl(e.properties.reduce(((t,e)=>{var r=Jr(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 Jg{constructor(t){this._instance=t,this.Ki=new Map,this.Qi=new Map,this.tn=new Map}en(t,e){return!!t&&Jl(t.propertyFilters,null==e?void 0:e.properties)}rn(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}nn(t,e,r){var i=(r===Au.Activation?this.Ki:this.Qi).get(t),n=[];return this.sn((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,o=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.en(o,e)}))}register(t){var e;ri(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.an(t),this.un(t))}un(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.ln){this.ln=new Xg(this._instance),this.ln.init();this.ln.Yi((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ln)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.tn.get(e.name);r&&r.push(t.id),this.tn.set(e.name,r||[t.id])}})))}))}}an(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Ki=this.rn(t,Au.Activation),this.Qi=this.rn(t,Au.Cancellation)}}onEvent(t,e){var r,i=this.ct(),n=this.hn(),o=this.cn(),s=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(o===t&&e&&s.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:s});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=s.indexOf(l);h>=0&&(s.splice(h,1),this.dn(s))}}else{if(this.Qi.has(t)){var c=this.nn(t,e,Au.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=s.indexOf(t.id);e>=0&&s.splice(e,1),this.vn(t.id)})),this.dn(s))}if(this.Ki.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Ki.get(t)});var d=this.nn(t,e,Au.Activation);this.dn(s.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.hn(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.tn.has(t)&&this.dn(i.concat(this.tn.get(t)||[]))}dn(t){var e,r=this.ct(),i=this.hn(),n=[...new Set(t)].filter((t=>!this.fn(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.hn(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Ki}pn(){return this.ln}}class Kg extends Jg{constructor(t){super(t)}hn(){return"$surveys_activated"}cn(){return Pu.SHOWN}sn(t){var e;null==(e=this._instance)||e.getSurveys(t)}vn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ct(){return Bu}fn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Qg{constructor(t){this.gn=void 0,this._surveyManager=null,this.mn=!1,this.yn=[],this.bn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(si(e))return Bu.warn("Flags not loaded yet. Not loading surveys.");var r=Jr(e);this.gn=r?e.length>0:e,Bu.info("flags response received, isSurveysEnabled: "+this.gn),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(qu)||null!=r&&r.startsWith(Hu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.mn)Bu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Bu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==so?void 0:so.__PosthogExtensions__;if(t){if(!ri(this.gn)||this._instance.config.advanced_enable_surveys){var e=this.gn||this._instance.config.advanced_enable_surveys;this.mn=!0;try{var r=t.generateSurveys;if(r)return void this.wn(r,e);var i=t.loadExternalDependency;if(!i)return void this._n("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this._n("Could not load surveys script",r):this.wn(t.generateSurveys,e)}))}catch(t){throw this._n("Error initializing surveys",t),t}finally{this.mn=!1}}}else Bu.error("PostHog Extensions not found.")}}wn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Kg(this._instance),Bu.info("Surveys loaded successfully"),this.Cn({isLoaded:!0})}_n(t,e){Bu.error(t,e),this.Cn({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.yn.push(t),this._surveyManager&&this.Cn({isLoaded:!0}),()=>{this.yn=this.yn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(es);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.bn?this.bn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.bn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.bn=null;var n=e.statusCode;if(200!==n||!e.json){var o="Surveys API could not be loaded, status: "+n;Bu.error(o);var s={isLoaded:!1,error:o};return t([],s),void(null==r||r({surveys:[],context:s}))}var a,u=e.json.surveys||[],l=u.filter((t=>$u(t)&&(ju(t)||Zu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[es]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Cn(t){for(var e of this.yn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!si(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bu.warn("init was not called")}In(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}Sn(t){if(si(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.In(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(si(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Sn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return si(this._surveyManager)?(Bu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.Sn(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(si(this._surveyManager))Bu.warn("init was not called");else{var n="string"==typeof t?this.In(t):t;if(null!=n&&n.id)if(Uu.includes(n.type)){var o=null==to?void 0:to.querySelector(e);if(o)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Bu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,o,r),Bu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o,r);Bu.warn("Survey element not found")}else Bu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bu.warn("Survey not found")}}displaySurvey(t,e){var i;if(si(this._surveyManager))Bu.warn("init was not called");else{var n=this.In(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Du.Popover&&e.initialResponses&&Bu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void Bu.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Du.Inline?this._surveyManager.handlePopoverSurvey(o,e):this.renderSurvey(o,e.selector,e.properties)}else Bu.warn("Survey not found")}}cancelPendingSurvey(t){si(this._surveyManager)?Bu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var tm=vo("[Conversations]");class em{constructor(t){this.kn=void 0,this._conversationsManager=null,this.xn=!1,this.An=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;si(e)||(li(e)?this.kn=e:(this.kn=e.enabled,this.An=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.kn=void 0,this.An=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==so?void 0:so.__PosthogExtensions__;if(t&&!ri(this.kn)&&this.kn)if(this.An&&this.An.token){this.xn=!0;try{var e=t.initConversations;if(e)return this.Tn(e),void(this.xn=!1);var r=t.loadExternalDependency;if(!r)return void this.En("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.En("Could not load conversations script",e):this.Tn(t.initConversations),this.xn=!1}))}catch(t){this.En("Error initializing conversations",t),this.xn=!1}}else tm.error("Conversations enabled but missing token in remote config.")}}Tn(t){if(this.An)try{this._conversationsManager=t(this.An,this._instance),tm.info("Conversations loaded successfully")}catch(t){this.En("Error completing conversations initialization",t)}else tm.error("Cannot complete initialization: remote config is null")}En(t,e){tm.error(t,e),this._conversationsManager=null,this.xn=!1}show(){this._conversationsManager?this._conversationsManager.show():tm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.kn&&!oi(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):(tm.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(tm.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(tm.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(tm.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class rm{constructor(t){var e;this.Rn=!1,this.Nn=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Rn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!si(r)&&r&&(this.Rn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Rn&&!this.Nn){var t=vo("[logs]"),e=null==so?void 0:so.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=e.logs)||!i.initializeLogs?t.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.Nn=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var im=vo("[RateLimiter]");class nm{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=>{im.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void im.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:o}=this,s=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(ss))&&void 0!==e?e:{tokens:n,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>n&&(a.tokens=n);var u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(ss,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var om=vo("[RemoteConfig]");class sm{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=so._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mn(t){var e,r;null!=(e=so.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(om.error("PostHog Extensions not found. Cannot load remote config."),t())}Fn(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 om.info("Using preloaded remote config",this.remoteConfig),void this.Ii(this.remoteConfig);if(this._instance.De())return void om.warn("Remote config is disabled. Falling back to local config.");this.Mn((t=>{if(!t)return om.info("No config found after loading remote JS config. Falling back to JSON."),void this.Fn((t=>{this.Ii(t)}));this.Ii(t)}))}catch(t){om.error("Error loading remote config",t)}}Ii(t){t?this._instance.config.__preview_remote_config?(this._instance.Ii(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):om.info("__preview_remote_config is disabled. Logging config instead",t):om.error("Failed to fetch remote config from PostHog.")}}var am=3e3;class um{constructor(t,e){this.On=!0,this.Pn=[],this.Ln=yi((null==e?void 0:e.flush_interval_ms)||am,250,5e3,co.createLogger("flush interval"),am),this.Dn=t}enqueue(t){this.Pn.push(t),this.Bn||this.$n()}unload(){this.jn();var t=this.Pn.length>0?this.Zn():{},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.Dn(r({},t,{transport:"sendBeacon"}))}))}enable(){this.On=!1,this.$n()}$n(){var t=this;this.On||(this.Bn=setTimeout((()=>{if(this.jn(),this.Pn.length>0){var e=this.Zn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Jr(r.data)&&go(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dn(r)};for(var i in e)r()}}),this.Ln))}jn(){clearTimeout(this.Bn),this.Bn=void 0}Zn(){var t={};return go(this.Pn,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;ri(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.Pn=[],t}}var lm=["retriesPerformedSoFar"];class hm{constructor(t){this.qn=!1,this.Hn=3e3,this.Pn=[],this._instance=t,this.Pn=[],this.Vn=!0,!ri(Un)&&"onLine"in Un.navigator&&(this.Vn=Un.navigator.onLine,this.zn=()=>{this.Vn=!0,this.Yr()},this.Gn=()=>{this.Vn=!1},Ao(Un,"online",this.zn),Ao(Un,"offline",this.Gn))}get length(){return this.Pn.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,lm);ui(e)&&(n.url=Hl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Yn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Yn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Pn.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),co.warn(n),this.qn||(this.qn=!0,this.Un())}Un(){if(this.Wn&&clearTimeout(this.Wn),0===this.Pn.length)return this.qn=!1,void(this.Wn=void 0);this.Wn=setTimeout((()=>{this.Vn&&this.Pn.length>0&&this.Yr(),this.Un()}),this.Hn)}Yr(){var t=Date.now(),e=[],r=this.Pn.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Pn=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Wn&&(clearTimeout(this.Wn),this.Wn=void 0),this.qn=!1,ri(Un)||(this.zn&&(Un.removeEventListener("online",this.zn),this.zn=void 0),this.Gn&&(Un.removeEventListener("offline",this.Gn),this.Gn=void 0)),this.Pn))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){co.error(t)}this.Pn=[]}}class cm{constructor(t){this.Xn=()=>{var t,e,r,i;this.Jn||(this.Jn={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),u=(null==n?void 0:n.scrollHeight)||0;this.Jn.lastScrollY=Math.ceil(o),this.Jn.maxScrollY=Math.max(o,null!==(t=this.Jn.maxScrollY)&&void 0!==t?t:0),this.Jn.maxScrollHeight=Math.max(s,null!==(e=this.Jn.maxScrollHeight)&&void 0!==e?e:0),this.Jn.lastContentY=a,this.Jn.maxContentY=Math.max(a,null!==(r=this.Jn.maxContentY)&&void 0!==r?r:0),this.Jn.maxContentHeight=Math.max(u,null!==(i=this.Jn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Jn}resetContext(){var t=this.Jn;return setTimeout(this.Xn,0),t}startMeasuringScrollPosition(){Ao(Un,"scroll",this.Xn,{capture:!0}),Ao(Un,"scrollend",this.Xn,{capture:!0}),Ao(Un,"resize",this.Xn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Un?void 0:Un.document.documentElement;var t=Jr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Un?void 0:Un.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Un&&(Un.scrollY||Un.pageYOffset||Un.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Un&&(Un.scrollX||Un.pageXOffset||Un.document.documentElement.scrollLeft)||0}}var dm=t=>dg(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class vm{constructor(t,e,r,i){this.Kn=t=>{var e=this.Qn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.eo(this._instance)};this.ro.register({[os]:r})}},this._instance=t,this.io=e,this.ro=r,this.eo=i||dm,this.io.onSessionId(this.Kn)}Qn(){return this.ro.props[os]}getSetOnceProps(){var t,e=null==(t=this.Qn())?void 0:t.props;return e?"r"in e?vg(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return go(Co(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Gr(r)]=e})),t}}var fm=vo("[SessionId]");class pm{on(t,e){return this.no.on(t,e)}constructor(t,e,r){var i;if(this.oo=[],this.so=void 0,this.no=new Ug,this.ao=(t,e)=>!(!ui(t)||!ui(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oe=t.config,this.ro=t.persistence,this.uo=void 0,this.lo=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ho=e||rl,this.co=r||rl;var n=this.Oe.persistence_name||this.Oe.token,o=this.Oe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yi(o,60,36e3,fm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.do(),this.vo="ph_"+n+"_window_id",this.fo="ph_"+n+"_primary_window_exists",this.po()){var s=Op.sr(this.vo),a=Op.sr(this.fo);s&&!a?this.uo=s:Op.ur(this.vo),Op.ar(this.fo,!0)}if(null!=(i=this.Oe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.Oe.bootstrap.sessionID);this.mo(this.Oe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){fm.error("Invalid sessionID in bootstrap",t)}this.yo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ri(this.oo)&&(this.oo=[]),this.oo.push(t),this.lo&&t(this.lo,this.uo),()=>{this.oo=this.oo.filter((e=>e!==t))}}po(){return"memory"!==this.Oe.persistence&&!this.ro.Ei&&Op.rr()}bo(t){t!==this.uo&&(this.uo=t,this.po()&&Op.ar(this.vo,t))}wo(){return this.uo?this.uo:this.po()?Op.sr(this.vo):null}mo(t,e,r){t===this.lo&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.lo=t,this.ro.register({[Uo]:[e,t,r]}))}_o(){var t=this.ro.props[Uo];return Jr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.mo(null,null,null)}destroy(){clearTimeout(this.Co),this.Co=void 0,this.so&&Un&&(Un.removeEventListener("beforeunload",this.so,{capture:!1}),this.so=void 0),this.oo=[]}yo(){this.so=()=>{this.po()&&Op.ur(this.fo)},Ao(Un,"beforeunload",this.so,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.Oe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this._o(),s=this.wo(),a=ui(o)&&Math.abs(r-o)>864e5,u=!1,l=!n,h=!l&&!t&&this.ao(r,i);l||h||a?(n=this.ho(),s=this.co(),fm.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),o=r,u=!0):s||(s=this.co(),u=!0);var c=!!ui(i)&&t&&!a?i:r,d=!ui(o)?(new Date).getTime():o;return this.bo(s),this.mo(n,c,d),t||this.do(),u&&this.oo.forEach((t=>t(n,s,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}do(){clearTimeout(this.Co),this.Co=setTimeout((()=>{var[t]=this._o();if(this.ao((new Date).getTime(),t)){var e=this.lo;this.resetSessionId(),this.no.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var gm=["$set_once","$set"],mm=vo("[SiteApps]");class ym{constructor(t){this._instance=t,this.Io=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}So(t,e){if(e){var r=this.globalsForEvent(e);this.Io.push(r),this.Io.length>1e3&&(this.Io=this.Io.slice(10))}}get siteAppLoaders(){var t;return null==(t=so._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.So.bind(this));this.ko=()=>{t(),this.Io=[],this.ko=void 0}}}globalsForEvent(t){var e,n,o,s,a,u,l;if(!t)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,gm),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Io.length&&(mm.info("Processing "+this.Io.length+" events for site app with id "+t.id),this.Io.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.ko)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,mm.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){mm.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){mm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}xo(){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)}Ao(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){mm.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.xo(),void this._instance.on("eventCaptured",(t=>this.Ao(t)))):void mm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.ko)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;so["__$$ph_site_app_"+t]=n._instance,null==(e=so.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return mm.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else mm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var bm=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Hr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Hr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},wm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),_m="i.posthog.com";class Cm{constructor(t){this.To={},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("."+_m,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.To[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.To[this.apiHost]=wm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.To[this.apiHost]=wm.EU:this.To[this.apiHost]=wm.CUSTOM),this.To[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===wm.CUSTOM)return this.apiHost+e;var r=_m+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Im={icontains:(t,e)=>!!Un&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Un&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Un&&Yl(e.href,t),not_regex:(t,e)=>!!Un&&!Yl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Sm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Sm.Eo("retrieved web experiments from the server"),e.Ro=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Ro)Sm.Eo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ro)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&e.No(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];Sm.Mo(o)&&e.No(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Sm.Eo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(si(this.Ro))return this.Ro=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Sm.Eo("applying feature flags",t),t.forEach((t=>{var e;if(this.Ro&&null!=(e=this.Ro)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ro)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.No(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Sm.getWindowLocation();if(null!=t&&t.search){var e=Ro(null==t?void 0:t.search,"__experiment_id"),r=Ro(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Sm.Eo("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Fo(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Fo(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Sm.Eo("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.No(i[0].name,e,i[0].variants[e].transforms))}static Mo(t){return!si(t.conditions)&&(Sm.Oo(t)&&Sm.Po(t))}static Oo(t){var e;if(si(t.conditions)||si(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=Sm.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||Im[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Un?void 0:Un.location}static Po(t){var e;if(si(t.conditions)||si(null==(e=t.conditions)?void 0:e.utm))return!0;var r=ag();if(r.utm_source){var i,n,o,s,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Eo(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];co.info("[WebExperiments] "+t,r)}No(t,e,r){this._is_bot()?Sm.Eo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Sm.Eo("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)}))}})):Sm.Eo("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?bm(Qn,this._instance.config.custom_blocked_useragents):void 0}}var km=vo("[PostHog ExternalIntegrations]"),xm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Am{constructor(t){this._instance=t}gr(t,e){var r;null==(r=so.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return km.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=so.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.gr(xm[e],(()=>{var r;null==(r=so.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=so.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=so.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}vo("[SessionRecording]");var Tm="[SessionRecording]",Em=vo(Tm);class Rm{get started(){var t;return!(null==(t=this.Lo)||!t.isStarted)}get status(){return this.Lo?this.Lo.status:this.Do&&!this.Bo?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Do=!1,this.$o=!1,this.jo=void 0,this._instance=t,!this._instance.sessionManager)throw Em.error("started without valid sessionManager"),new Error(Tm+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Tm+' cannot be used with cookieless_mode="always"')}get Bo(){var t,e=!(null==(t=this._instance.get_property(Yo))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Un&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Bo||null==(e=this.Lo)||!e.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this.Bo&&r?(this.Zo(t),Em.info("starting")):this.stopRecording()}}Zo(t){var e,r,i;this.Bo&&(null!=so&&null!=(e=so.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=so.__PosthogExtensions__)&&r.initSessionRecording?this.qo(t):null==(i=so.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ho,(e=>{if(e)return Em.error("could not load recorder",e);this.qo(t)})))}stopRecording(){var t,e;null==(t=this.jo)||t.call(this),this.jo=void 0,null==(e=this.Lo)||e.stop()}Vo(){var t;null==(t=this._instance.persistence)||t.unregister(Wo)}zo(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=si(i)?null:parseFloat(i);si(o)&&this.Vo();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Yo]:r({cache_timestamp:Date.now(),enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ri(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.jo)||e.call(this),this.jo=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.$o=!1,this.zo(t),this.Do=!0,this.startIfEnabledOrStop()):this.Do=!0:Em.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Lo)&&r.log?this.Lo.log(t,e):Em.warn("log called before recorder was ready")}get Ho(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Yo);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Go(){var t,e=this._instance.get_property(Yo);if(!e)return!1;var r=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return Date.now()-r<=3e5}qo(t){var e,r;if(null==(e=so.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Lo||(this.Lo=null==(r=so.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Lo._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Go()?this.Lo.start(t):this.$o||(this.$o=!0,Em.info("persisted remote config is stale, requesting fresh config before starting"),new sm(this._instance).load())}onRRwebEmit(t){var e;null==(e=this.Lo)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Lo||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.Lo)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Lo||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.Lo)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Lo||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.Lo)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Lo)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Lo)||!r.tryAddCustomEvent(t,e))}}var Nm={},Mm=()=>{},Fm="posthog",Om=!Zl&&-1===(null==oo?void 0:oo.indexOf("MSIE"))&&-1===(null==oo?void 0:oo.indexOf("Mozilla")),Pm=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ko(null==to?void 0:to.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Mm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:eo&&ii(null==eo?void 0:eo.search)&&-1!==eo.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Un||null==(e=Un.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;co.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:am},error_tracking:{},_onCapture:Mm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Lm=t=>{var e={};ri(t.process_person)||(e.person_profiles=t.process_person),ri(t.xhr_headers)||(e.request_headers=t.xhr_headers),ri(t.cookie_name)||(e.persistence_name=t.cookie_name),ri(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ri(t.store_google)||(e.save_campaign_params=t.store_google),ri(t.verbose)||(e.debug=t.verbose);var r=mo({},e,t);return Jr(t.property_blacklist)&&(ri(t.property_denylist)?r.property_denylist=t.property_blacklist:Jr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:co.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Dm{constructor(){this.__forceAllowLocalhost=!1}get Yo(){return this.__forceAllowLocalhost}set Yo(t){co.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Dm,this.Uo=!1,this.version=lo.LIB_VERSION,this.wi=new Ug,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Pm(),this.SentryIntegration=Up,this.sentryIntegration=t=>function(t,e){var r=Yp(t,e);return{name:Gp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wo=!1,this.Xo=null,this.Jo=null,this.Ko=null,this.featureFlags=new qg(this),this.toolbar=new Qp(this),this.scrollManager=new cm(this),this.pageViewManager=new Ig(this),this.surveys=new Qg(this),this.conversations=new em(this),this.logs=new rm(this),this.experiments=new Sm(this),this.exceptions=new Sf(this),this.rateLimiter=new nm(this),this.requestRouter=new Cm(this),this.consent=new Lp(this),this.externalIntegrations=new Am(this),this.people={set:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>co.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Fm){var i,n=null!==(i=Nm[r])&&void 0!==i?i:new Bm;return n._init(t,e,r),Nm[r]=n,Nm[Fm][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ri(t)||ni(t))return co.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.Qo(e.debug),this.ts=e,this.es=[],e.person_profiles&&(this.Jo=e.person_profiles),this.set_config(mo({},Pm(e.defaults),Lm(e),{name:i,token:t})),this.config.on_xhr_error&&co.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:ol.GZipJS;var o=this.rs();this.persistence=new Vg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vg(r({},this.config,{persistence:"sessionStorage"}),o);var s=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.ns=new um((t=>this.os(t)),this.config.request_queue_config),this.ss=new hm(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new pm(this),this.sessionPropsManager=new vm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(co.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.us(u)}),0)):(co.info("Initializing extensions synchronously"),this.us(u)),lo.DEBUG=lo.DEBUG||this.config.debug,lo.DEBUG&&co.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:s,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(rl()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(ns,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.ls()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:ds,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(rl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ns,"anonymous")}return Ao(Un,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?zp(this,(()=>this.hs())):this.hs(),Kr(this.config._onCapture)&&this.config._onCapture!==Mm&&(co.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&co.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}us(t){var e=performance.now();this.historyAutocapture=new Hp(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new eg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new ym(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Rm(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new mp(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Yg(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Cg(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new bg(this)})),r.push((()=>{this.exceptionObserver=new qp(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new jp(this,$p),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this.cs){var t=this.cs;this.cs=void 0,this.Ii(t)}})),this.ds(r,e)}ds(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ds(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){co.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&co.info("PostHog extensions initialized ("+i+"ms)")}Ii(t){var e,r,i,n,o,s,a,u,l;if(!to||!to.body)return co.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ii(t)}),500);this.config.__preview_deferred_init_extensions&&(this.cs=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(t.supportedCompression,ol.GZipJS)?ol.GZipJS:Vr(t.supportedCompression,ol.Base64)?ol.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Jo?this.Jo:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(s=this.productTours)||s.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}hs(){try{this.config.loaded(this)}catch(t){co.critical("`loaded` function failed",t)}if(this.vs(),this.config.internal_or_test_user_hostname&&null!=eo&&eo.hostname){var t=eo.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()||"always"===this.config.cookieless_mode)&&this.fs()}),1),new sm(this).load(),this.featureFlags.flags()}vs(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.ns)||t.enable()))}_dom_loaded(){this.is_capturing()&&po(this.__request_queue,(t=>this.os(t))),this.__request_queue=[],this.vs()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.ps()&&this.capture("$pageleave"),null==(t=this.ns)||t.unload(),null==(e=this.ss)||e.unload()):this.ps()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Om?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Hl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=Hl(o.url,{_:(new Date).getTime().toString(),ver:lo.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Gl.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),u=null!==(i=null==(n=xo(a,(t=>t.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(o)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}os(t){this.ss?this.ss.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];po(t,(t=>{t&&(e=t[0],Jr(e)?n.push(t):Kr(t)?t.call(this):Jr(t)&&"alias"===e?r.push(t):Jr(t)&&-1!==e.indexOf("capture")&&Kr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){po(t,(function(t){if(Jr(t[0])){var r=e;go(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}ls(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ns){if(this.is_capturing())if(!ri(t)&&ii(t)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=e&&e.$current_url&&!ii(null==e?void 0:e.$current_url)&&(co.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(null==i?void 0:i.timestamp)||a,l=rl(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.gs(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=Io(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ri(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Pu.DISMISSED||t===Pu.SENT){var v=null==e?void 0:e[Lu.SURVEY_ID],f=null==e?void 0:e[Lu.SURVEY_ITERATION];Yu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Vu({id:v,current_iteration:f},t===Pu.SENT?"responded":"dismissed")]:!0})}else t===Pu.SHOWN&&(h.$set=r({},h.$set,{[Lu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(ei(p)||this.setPersonPropertiesForFlags(p),!si(this.config.before_send)){var g=this.ys(h);if(!g)return;h=g}this.wi.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.os(m):this.ns.enqueue(m),h}co.critical("This capture call is ignored due to client rate limiting.")}}else co.error("No event name provided to posthog.capture")}else co.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&co.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=gg(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&mo(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&mo(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.ss)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===wm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=mo(a,l),"$pageview"===t&&to&&(a.title=to.title),!ri(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}oo&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=mo({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Jr(this.config.property_denylist)?go(this.config.property_denylist,(function(t){delete a[t]})):co.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(co.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.bs();return a.$process_person_profile=g,g&&!o&&this.ws("_calculate_event_properties"),a}gs(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.bs())return t;if(this.Uo)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=mo({},i,n||{},t||{}),s=this.config.sanitize_properties;return s&&(co.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),e&&(this.Uo=!0),ei(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)}_s(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){return this.featureFlags.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},o=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=r({},n,t),a=r({},o,e),u={};for(var[l,h]of Object.entries(s)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ri(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.wi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Wu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return co.uninitializedWarning("posthog.identify");if(ai(t)&&(t=t.toString(),co.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))co.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ds){if(this.ws("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Lo)&&(this.unregister(Lo),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(ns)||"anonymous");t!==n&&s?(this.persistence.set_property(ns,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Ko=Ul(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(rs))}}else co.critical('The string "'+ds+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else co.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.ws("posthog.setPersonProperties")){var i=Ul(this.get_distinct_id(),t,e);this.Ko!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ko=i):co.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else co.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.ws("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(co.info("reset"),!this.__loaded)return co.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(ns,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Ko=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ds,$device_id:null},"");else{var s=this.config.get_device_id(rl());this.register_once({distinct_id:s,$device_id:t?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(t,e){return t===this.get_property(Po)?(co.critical("Attempting to create alias for existing People user - aborting."),-2):this.ws("posthog.alias")?(ri(e)&&(e=this.get_distinct_id()),t!==e?(this._s(Lo,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(co.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(ti(t)){var i,n,o,s,a,u,l,h;mo(this.config,Lm(t));var c=this.rs();null==(i=this.persistence)||i.update_config(this.config,e,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vg(r({},this.config,{persistence:"sessionStorage"}),c);var d=this.Qo(this.config.debug);li(d)&&(this.config.debug=d),li(this.config.debug)&&(this.config.debug?(lo.DEBUG=!0,Ep.rr()&&Ep.ar("ph_debug","true"),co.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(lo.DEBUG=!1,Ep.rr()&&Ep.ur("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Cs(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Fm;return e!==Fm&&(e=Fm+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(ns))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(ns))}bs(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ei(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Lo])&&(null==(e=this.persistence)||null==(e=e.props)||!e[hs]))}ps(){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.bs()||this.ws("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ws("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ws(t){return"never"===this.config.person_profiles?(co.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._s(hs,!0),!0)}rs(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Cs(){var t,e,r,i,n=this.rs();(null==(t=this.persistence)?void 0:t.Ei)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Ei)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new pm(this),this.pageViewManager=new Ig(this),this.persistence&&(this.sessionPropsManager=new vm(this,this.sessionManager,this.persistence)),this.sessionRecording=new Rm(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Cs(),this.vs(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.fs()}else co.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Cs(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ds,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.fs())):co.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Pp.GRANTED?"granted":t===Pp.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Cs()}_is_bot(){return Qn?bm(Qn,this.config.custom_blocked_useragents):void 0}fs(){to&&("visible"===to.visibilityState?this.Wo||(this.Wo=!0,this.capture("$pageview",{title:to.title},{send_instantly:!0}),this.Xo&&(to.removeEventListener("visibilitychange",this.Xo),this.Xo=null)):this.Xo||(this.Xo=this.fs.bind(this),Ao(to,"visibilitychange",this.Xo)))}debug(t){!1===t?(null==Un||Un.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Un||Un.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}))}De(){var t,e,r,i,n,o,s,a=this.ts||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(co.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=co,o=(e="advanced_disable_flags")in(t=a)&&!si(t[e]),s=r in t&&!si(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}ys(t){if(si(this.config.before_send))return t;var e=Jr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),si(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return ci(t.event)?co.warn(n+". This can cause unexpected behavior."):co.info(n),null}r.properties&&!ei(r.properties)||co.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.ni)?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)})}Qo(t){var e=li(t)&&!t,r=Ep.rr()&&"true"===Ep.nr("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=_o(t.prototype[e[r]])}(Bm,["identify"]);var $m,jm={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Zm=function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t}({}),qm=function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t}({}),Hm=($m=Nm[Fm]=new Bm,function(){function t(){t.done||(t.done=!0,Om=!1,go(Nm,(function(t){t._dom_loaded()})))}null!=to&&to.addEventListener?"complete"===to.readyState?t():Ao(to,"DOMContentLoaded",t,{capture:!1}):Un&&co.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),$m);export{ol as Compression,jm as DEFAULT_PRODUCT_TOUR_APPEARANCE,Du as DisplaySurveyType,Bm as PostHog,Zm as ProductTourEventName,qm as ProductTourEventProperties,Pu as SurveyEventName,Lu as SurveyEventProperties,Au as SurveyEventType,Eu as SurveyPosition,Fu as SurveyQuestionBranchingType,Mu as SurveyQuestionType,Ou as SurveySchedule,Ru as SurveyTabPosition,Nu as SurveyType,Tu as SurveyWidgetType,Hm as default,Hm as posthog,nl as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.full.js.map
|