posthog-js 1.335.1 → 1.335.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(l||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var h={};function v(e){if(h[e])return h[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return h[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?h[e]=l:t.prototype}catch(e){return t.prototype}}var f={};function p(e,t,r){var n,i=e+"."+String(r);if(f[i])return f[i].call(t);var o=v(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(f[i]=a,a.call(t)):t[r]}var m={};function y(e,t,r){var n=e+"."+String(r);if(m[n])return m[n].bind(t);var i=v(e)[r];return"function"!=typeof i?t[r]:(m[n]=i,i.bind(t))}var g={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return y("Node",e,"contains")(t)},getRootNode:function(e){return y("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(e){var t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function C(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>S(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?L(i,t):i}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:a}=e,s=o||"",u=i&&T(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function T(e){return e.toLowerCase()}var N="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function R(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var _=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,E=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,O=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(_,((e,r,n,i,o,a)=>{var s,u=n||o||a,l=r||i||"";if(!u)return e;if(E.test(u)||F.test(u))return"url("+l+u+l+")";if(O.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+l+c.join("/")+l+")"}))}var B,Z,P=1,D=new RegExp("[^a-z0-9-_:]"),q=-2;function j(){return P++}var V=/^[^ \t\n\r\u000c]+/,H=/^[, \t\n\r\u000c]+/;var Y=new WeakMap;function G(e,t){return t&&""!==t.trim()?z(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function z(e,t){var r=Y.get(e);if(r||(r=e.createElement("a"),Y.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?G(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(H),!(r>=t.length);){var o=n(V);if(","===o.slice(-1))o=G(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=G(e,o);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?L(n,z(e)):"object"===t&&"data"===r?G(e,n):n:G(e,n):n}function U(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(g.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&K(g.parentNode(e),t,r)}function J(e,t,r,n){var i;if(b(e)){if(i=e,!g.childNodes(i).length)return!1}else{if(null===g.parentElement(e))return!1;i=g.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(K(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Q(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,dataURLOptions:h={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,y=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:l.Document,childNodes:[],compatMode:e.compatMode}:{type:l.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return D.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];U(y,S.name,S.value)||(b[S.name]=X(n,y,T(S.name),S.value))}if("link"===y&&a){var x=function(e){return null==e?void 0:e.href}(e);if(x){var R=k(n,x);if(!R&&x.includes(".css"))R=k(n,window.location.origin+"/"+x.replace(window.location.href,""));var _=null;R&&(_=I(R)),_&&(delete b.rel,delete b.href,b._cssText=_)}}if("style"===y&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){var E=I(e.sheet);E&&(b._cssText=E)}if("input"===y||"textarea"===y||"select"===y){var F=e.value,O=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&F?b.value=A({element:e,type:M(e),tagName:y,value:F,maskInputOptions:s,maskInputFn:u}):O&&(b.checked=O)}"option"===y&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("dialog"===y&&e.open)try{b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){b.rr_open_mode="modal",b.ph_rr_could_not_detect_modal=!0}if("canvas"===y&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=N in i?i[N]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var L=e.toDataURL(c.type,c.quality),P=n.createElement("canvas");P.width=e.width,P.height=e.height,L!==P.toDataURL(c.type,c.quality)&&(b.rr_dataURL=L)}if("img"===y&&d){B||(B=n.createElement("canvas"),Z=B.getContext("2d"));var q=e,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",V=q.crossOrigin,H=()=>{q.removeEventListener("load",H);try{B.width=q.naturalWidth,B.height=q.naturalHeight,Z.drawImage(q,0,0),b.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H));console.warn("Cannot inline img src="+j+"! Error: "+e)}"anonymous"===q.crossOrigin&&(V?b.crossOrigin=V:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H)}if("audio"===y||"video"===y){var Y=b;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(m){var{width:G,height:z}=e.getBoundingClientRect();b={class:b.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==y||v(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(y)&&(r=!0)}catch(e){}return{type:l.Element,tagName:y,attributes:b,childNodes:[],isSVG:W(e)||void 0,needBlock:m,rootId:p,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:h,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,a=g.parentNode(e),s=a&&a.tagName,u=g.textContent(e),c="STYLE"===s||void 0,d="SCRIPT"===s||void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=I(a.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=L(u,z(t.doc))}d&&(u="SCRIPT_PLACEHOLDER");!c&&!d&&u&&n&&(u=i?i(u,g.parentElement(e)):u.replace(/[\S]/g,"*"));return{type:l.Text,textContent:u||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:l.Comment,textContent:g.textContent(e)||"",rootId:y};default:return!1}}function ee(e){return null==e?"":e.toLowerCase()}function te(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:_=!0}=t;M||(M=J(e,a,s,void 0===M));var E,F=Q(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:y,keepIframeSrcFn:T,newlyAddedElement:N});if(!F)return console.warn(e,"not serialized"),null;E=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===l.Comment)return!0;if(e.type===l.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===R(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ee(e.attributes.name)||"icon"===ee(e.attributes.rel)||"apple-touch-icon"===ee(e.attributes.rel)||"shortcut icon"===ee(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ee(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ee(e.attributes.name)||"googlebot"===ee(e.attributes.name)||"bingbot"===ee(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ee(e.attributes.name)||"generator"===ee(e.attributes.name)||"framework"===ee(e.attributes.name)||"publisher"===ee(e.attributes.name)||"progid"===ee(e.attributes.name)||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ee(e.attributes.name)||"yandex-verification"===ee(e.attributes.name)||"csrf-token"===ee(e.attributes.name)||"p:domain_verify"===ee(e.attributes.name)||"verify-v1"===ee(e.attributes.name)||"verification"===ee(e.attributes.name)||"shopify-checkout-api-token"===ee(e.attributes.name)))return!0}}return!1}(F,f)&&(_||F.type!==l.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?j():q;var O=Object.assign(F,{id:E});if(n.add(e,O),E===q)return null;I&&I(e);var L=!u;if(O.type===l.Element){L=L&&!O.needBlock,delete O.needBlock;var B=g.shadowRoot(e);B&&C(B)&&(O.isShadowHost=!0)}if((O.type===l.Document||O.type===l.Element)&&L){f.headWhitespace&&O.type===l.Element&&"head"===O.tagName&&(_=!1);var Z={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T};if(O.type===l.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var P of Array.from(g.childNodes(e))){var D=te(P,Z);D&&O.childNodes.push(D)}var V=null;if(b(e)&&(V=g.shadowRoot(e)))for(var H of Array.from(g.childNodes(V))){var Y=te(H,Z);Y&&(C(V)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=g.parentNode(e);return G&&w(G)&&C(G)&&(O.isShadow=!0),O.type===l.Element&&"iframe"===O.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(n.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&S){var r=te(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});r&&S(e,r)}}),k),O.type===l.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===R(O.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(x){var t=te(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});t&&x(e,t)}}),A),O}let re=class e{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in ne?ne[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ie?ie[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return oe[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?oe[e]=l:r}catch(e){return r}}var se={};function ue(e,t,r){var n,i=e+"."+String(r);if(se[i])return se[i].call(t);var o=ae(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(se[i]=a,a.call(t)):t[r]}var le={};function ce(e,t,r){var n=e+"."+String(r);if(le[n])return le[n].bind(t);var i=ae(e)[r];return"function"!=typeof i?t[r]:(le[n]=i,i.bind(t))}function de(){return ae("MutationObserver").constructor}var he={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return ce("Node",e,"contains")(t)},getRootNode:function(e){return ce("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:de};function ve(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var fe="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.",pe={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function me(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}}function ye(e,t,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function ge(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pe=new Proxy(pe,{get:(e,t,r)=>("map"===t&&console.error(fe),Reflect.get(e,t,r))}));var be=Date.now;function we(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=he.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=he.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:he.parentElement(e):null}function ke(e,t,r,n){if(!e)return!1;var i=Se(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(K(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===q}function Ae(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=he.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Ae(n,t))}function Te(e){return Boolean(e.changedTouches)}function Ne(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Re(e){return!!e&&(e instanceof re&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(he.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let _e=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ee(e){var t,r=null;return"getRootNode"in e&&(null==(t=he.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&he.host(he.getRootNode(e))&&(r=he.host(he.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ee(r);)r=t;return r}(e);return he.contains(t,r)}function Oe(e){var t=e.ownerDocument;return!!t&&(he.contains(t,e)||Fe(e))}var Le=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Le||{}),Be=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Be||{}),Ze=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ze||{}),Pe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pe||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),qe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qe||{});function je(e){return"__ln"in e}class Ve{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&je(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&je(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var He,Ye=(e,t)=>e+"@"+t;class Ge{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",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ve,n=e=>{for(var t=e,r=q;r===q;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=he.parentNode(i);if(o&&Oe(i)&&"TEXTAREA"!==o.tagName){var a=w(o)?this.mirror.getId(Ee(i)):this.mirror.getId(o),s=n(i);if(-1===a||-1===s)return r.addNode(i);var u=te(i,{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:e=>{Ne(e,this.mirror)&&this.iframeManager.addIframe(e),Me(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Re(i)&&this.shadowDomManager.addShadowRoot(he.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:a,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)ze(this.removes,o,this.mirror)&&!this.movedSet.has(he.parentNode(o))||i(o);for(var a of this.addedSet)Xe(this.droppedSet,a)||ze(this.removes,a,this.mirror)?Xe(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(he.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var v=this.mirror.getId(he.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,p=he.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=he.host(p);if(-1!==this.mirror.getId(m)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var y={texts:this.texts.map((e=>{var t=e.node,r=he.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(y.texts.length||y.attributes.length||y.removes.length||y.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(y))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(he.childNodes(e),(e=>he.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=he.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:J(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=M(r);i=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var a=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!U(r.tagName,n))if(a.attributes[n]=X(this.doc,T(r.tagName),T(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&s.setAttribute("style",e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?a.styleDiff[u]=""===c?l:[l,c]:a._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=w(e.target)?this.mirror.getId(he.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(We(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ae(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ye(r,n)]?We(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!w(e.target)||!C(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ye(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(he.childNodes(e).forEach((e=>this.genAdds(e))),Re(e)&&he.childNodes(he.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 We(e,t){e.delete(t),he.childNodes(t).forEach((t=>We(e,t)))}function ze(e,t,r){return 0!==e.length&&function(e,t,r){var n,i=he.parentNode(t),o=function(){var t=r.getId(i);if(e.some((e=>e.id===t)))return{v:!0};i=he.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(e,t,r)}function Xe(e,t){return 0!==e.size&&Ue(e,t)}function Ue(e,t){var r=he.parentNode(t);return!!r&&(!!e.has(r)||Ue(e,r))}var Ke=e=>{if(!He)return e;return function(){try{return e(...arguments)}catch(e){if(He&&!0===He(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function $e(e,t){var r=new Ge;Je.push(r),r.init(e);var n=new(de())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function et(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],c=null;return Object.keys(Ze).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=T(e),u=(e=>n=>{var s=Qe(n);if(!ke(s,o,a,!0)){var u=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=Pe.Mouse;break;case"touch":u=Pe.Touch;break;case"pen":u=Pe.Pen}u===Pe.Touch?Ze[e]===Ze.MouseDown?l="TouchStart":Ze[e]===Ze.MouseUp&&(l="TouchEnd"):Pe.Pen}else Te(n)&&(u=Pe.Touch);null!==u?(c=u,(l.startsWith("Touch")&&u===Pe.Touch||l.startsWith("Mouse")&&u===Pe.Mouse)&&(u=null)):Ze[e]===Ze.Click&&(u=c,c=null);var d=Te(n)?n.changedTouches[0]:n;if(d){var h=i.getId(s),{clientX:v,clientY:f}=d;Ke(t)(r({type:Ze[l],id:h,x:v,y:f},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(Ze[e]){case Ze.MouseDown:case Ze.MouseUp:s=s.replace("mouse","pointer");break;case Ze.TouchStart:case Ze.TouchEnd:return}l.push(ve(s,u,n))})),Ke((()=>{l.forEach((e=>e()))}))}function tt(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:a}=e;return ve("scroll",Ke(me(Ke((e=>{var a=Qe(e);if(a&&!ke(a,i,o,!0)){var s=n.getId(a);if(a===r&&r.defaultView){var u=we(r.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var rt=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function it(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ot(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function at(e,t){var r,n,i,{mirror:o,stylesheetManager:a}=e,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(he.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function st(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),a(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(n=$e(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=me(Ke((e=>{var r=Date.now()-o;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],o=null})),s),c=Ke(me(Ke((e=>{var t=Qe(e),{clientX:r,clientY:n}=Te(e)?e.changedTouches[0]:e;o||(o=be()),u.push({x:r,y:n,id:i.getId(t),timeOffset:be()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),a,{trailing:!1})),d=[ve("mousemove",c,n),ve("touchmove",c,n),ve("drag",c,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),a=et(e),s=tt(e),u=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return ve("resize",Ke(me(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),l=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function v(e){var t=Qe(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=he.parentElement(t)),t&&i&&!(rt.indexOf(i)<0)&&!ke(t,o,a,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,v=!1,p=M(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(l[i.toLowerCase()]||l[p])&&(d=A({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),f(t,h?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var m=t.name;"radio"===p&&m&&v&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,n){var o=nt.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){nt.set(e,n);var a=i.getId(e);Ke(t)(r({},n,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(v),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&p.push(...g.map((e=>ye(e[0],e[1],{set(){Ke(v)({target:this,isTrusted:!1})}},!1,m)))),Ke((()=>{p.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:a}=e,s=Ke((e=>me(Ke((o=>{var a=Qe(o);if(a&&!ke(a,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=a;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500))),u=[ve("play",s(qe.Play),a),ve("pause",s(qe.Pause),a),ve("seeked",s(qe.Seeked),a),ve("volumechange",s(qe.VolumeChange),a),ve("ratechange",s(qe.RateChange),a)];return Ke((()=>{u.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=ot(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var n=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:a}),e.apply(t,o)}))}));var c={};lt("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(lt("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),lt("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),lt("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=ot(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...it(t),s||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...it(t),a]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=at(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:a}=t,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ke(((e,t,a)=>{var u,[l,c,d]=a;if(i.has(l))return s.apply(t,[l,c,d]);var{id:h,styleId:v}=ot(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:c,priority:d},index:it(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ke(((e,t,a)=>{var s,[l]=a;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=ot(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,o.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:it(t.parentRule)}),e.apply(t,a)}))}),Ke((()=>{a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:i}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,r){var n=new a(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ge(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=a})),i.push(s),Ke((()=>{i.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,a=!0,s=Ke((()=>{var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:h,endContainer:v,endOffset:f}=c;ke(d,n,i,!0)||ke(v,n,i,!0)||s.push({start:r.getId(d),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:s})}}));return s(),ve("selectionchange",s)}(e),m=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?ge(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),y=[];for(var g of e.plugins)y.push(g.observer(g.callback,i,g.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==n||n.disconnect(),o(),a(),s(),u(),l(),c(),d(),h(),v(),f(),p(),m(),y.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function lt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ct{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class dt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ct(j)),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=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Le.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Le.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Le.Meta:case Le.Load:case Le.DomContentLoaded:return!1;case Le.Plugin:return t;case Le.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Le.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===l.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ht{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(C(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=$e(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(tt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(he.host(e))),this.restoreHandlers.push(at({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ge(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=he.shadowRoot(this);return o&&Oe(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pt=0;pt<64;pt++)ft[vt.charCodeAt(pt)]=pt;var mt=new Map;var yt=(e,t,r)=>{if(e&&(wt(e,t)||"object"==typeof e)){var n=function(e,t){var r=mt.get(e);return r||(r=new Map,mt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function gt(e,t,r){if(e instanceof Array)return e.map((e=>gt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=vt[r[t]>>2],i+=vt[(3&r[t])<<4|r[t+1]>>4],i+=vt[(15&r[t+1])<<2|r[t+2]>>6],i+=vt[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[gt(e.data,t,r),e.width,e.height]}:wt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>gt(e,t,r))),wt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,n){var i=[];try{var o=ge(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];if(!ke(this,t,r,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,r,n,i,o){var a=[],s=Object.getOwnPropertyNames(e),u=function(s){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return 0;try{if("function"!=typeof e[s])return 0;var u=ge(e,s,(function(e){return function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];var c=e.apply(this,u);if(yt(c,o,this),"tagName"in this.canvas&&!ke(this.canvas,n,i,!0)){var d=bt(u,o,this),h={type:t,property:s,args:d};r(this.canvas,h)}return c}}));a.push(u)}catch(n){var l=ye(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(l)}};for(var l of s)u(l);return a}var St,kt,xt,At,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Nt="undefined"!=typeof window&&window.Blob&&new Blob([(St=Tt,Uint8Array.from(atob(St),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Mt(e){var t;try{if(!(t=Nt&&(window.URL||window.webkitURL).createObjectURL(Nt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Rt{constructor(e){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",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{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(e,r,n,i,o){var a=this,s=Ct(r,n,i,!0),u=new Map,l=new Mt;l.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var c,d=1e3/e,h=0,v=e=>{var s,f;h&&e-h<d?c=requestAnimationFrame(v):(h=e,(s=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,n,i,!0)||s.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),s).forEach(function(){var e=t((function*(e){var t,r=a.mirror.getId(e);if(!u.get(r)&&0!==e.width&&0!==e.height){if(u.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,s=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:s});l.postMessage({id:r,bitmap:c,width:i,height:s,dataURLOptions:o.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(v))};c=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ct(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=ge(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return ke(this.canvas,r,n,!0)||setTimeout((()=>{var r=bt(s,t,this);e(this.canvas,{type:De["2D"],property:o,args:r})}),0),i.apply(this,s)}}));i.push(a)}catch(r){var s=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:De["2D"],property:o,args:[t],setter:!0})}});i.push(s)}};for(var s of o)a(s);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,De.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class _t{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new _e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),n.styleIds.push(t)};for(var a of e)o(a);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ot=document.createElement("iframe");document.body.appendChild(Ot),Array.from=(null==(n=Ot.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ot)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt,Bt,Zt=new x;function Pt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:m,hooks:y,packFn:g,sampling:b={},dataURLOptions:w={},mousemoveWait:C,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:N=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:_=(()=>!1),ignoreCSSAttributes:E=new Set([]),errorHandler:F}=e;He=F;var O=!k||window.parent===window,L=!1;if(!O)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!L)return()=>{};void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),Zt.reset();var B,Z=!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}:void 0!==v?v:{password:!0},P=!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(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var D=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&!L&&(e=g(e)),e};kt=(e,r)=>{var o,a=e;if(a.timestamp=be(),!(null==(o=Je[0])?void 0:o.isFrozen())||a.type===Le.FullSnapshot||a.type===Le.IncrementalSnapshot&&a.data.source===Be.Mutation||Je.forEach((e=>e.unfreeze())),O)null==t||t(q(a),r);else if(L){var s={type:"rrweb",event:q(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(s,"*")}if(a.type===Le.FullSnapshot)B=a,D=0;else if(a.type===Le.IncrementalSnapshot){if(a.data.source===Be.Mutation&&a.data.isAttachIframe)return;D++;var u=i&&D>=i,l=n&&a.timestamp-B.timestamp>n;(u||l)&&xt(!0)}};var j=e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.Mutation},e)})},V=e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Scroll},e)}),H=e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.CanvasMutation},e)}),Y=new _t({mutationCb:j,adoptedStyleSheetCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.AdoptedStyleSheet},e)})}),G=new dt({mirror:Zt,mutationCb:j,stylesheetManager:Y,recordCrossOriginIframes:k,wrappedEmit:kt});for(var W of R||[])W.getMirror&&W.getMirror({nodeMirror:Zt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var z=new Et;At=new Rt({recordCanvas:S,mutationCb:H,win:window,blockClass:o,blockSelector:a,mirror:Zt,sampling:b.canvas,dataURLOptions:w});var X=new ht({mutationCb:j,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:Z,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:S,inlineImages:M,sampling:b,slimDOMOptions:P,iframeManager:G,stylesheetManager:Y,canvasManager:At,keepIframeSrcFn:_,processedNodeManager:z},mirror:Zt});xt=function(e){if(void 0===e&&(e=!1),I){kt({type:Le.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Y.reset(),X.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C=(()=>!1)}=t||{};return te(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,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:m,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:Zt,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:Z,maskTextFn:m,maskInputFn:p,slimDOM:P,dataURLOptions:w,recordCanvas:S,inlineImages:M,onSerialize:e=>{Ne(e,Zt)&&G.addIframe(e),Me(e,Zt)&&Y.trackLinkElement(e),Re(e)&&X.addShadowRoot(he.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:_});if(!t)return console.warn("Failed to snapshot the document");kt({type:Le.FullSnapshot,data:{node:t,initialOffset:we(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Zt.getId(document))}};try{var U=[],K=e=>{var t;return Ke(st)({mutationCb:j,mousemoveCb:(e,t)=>kt({type:Le.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.ViewportResize},e)}),inputCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Input},e)}),mediaInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.StyleDeclaration},e)}),canvasMutationCb:H,fontCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Font},e)}),selectionCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.Selection},e)})},customElementCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:s,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:Z,inlineStylesheet:d,sampling:b,recordDOM:I,recordCanvas:S,inlineImages:M,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:_,blockSelector:a,slimDOMOptions:P,dataURLOptions:w,mirror:Zt,iframeManager:G,stylesheetManager:Y,shadowDomManager:X,processedNodeManager:z,canvasManager:At,ignoreCSSAttributes:E,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Le.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};G.addLoadListener((e=>{try{U.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),U.push(K(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(U.push(ve("DOMContentLoaded",(()=>{kt({type:Le.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&J()}))),U.push(ve("load",(()=>{kt({type:Le.Load,data:{}}),"load"===A&&J()}),window))),()=>{U.forEach((e=>e())),z.destroy(),Ft=!1,He=void 0}}catch(e){console.warn(e)}}Pt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Le.Custom,data:{tag:e,payload:t}})},Pt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Pt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");xt(e)},Pt.mirror=Zt,(Bt=Lt||(Lt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var Dt,qt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Ut(e){if(Xt[e])return Xt[e];var t=globalThis[e],r=t.prototype,n=e in Wt?Wt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in zt?zt[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return Xt[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?Xt[e]=l:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var n,i=e+"."+String(r);if(Kt[i])return Kt[i].call(t);var o=Ut(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(Kt[i]=a,a.call(t)):t[r]}var Qt={};function $t(e,t,r){var n=e+"."+String(r);if(Qt[n])return Qt[n].bind(t);var i=Ut(e)[r];return"function"!=typeof i?t[r]:(Qt[n]=i,i.bind(t))}var er={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return $t("Node",e,"contains")(t)},getRootNode:function(e){return $t("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ut("MutationObserver").constructor}};class tr{constructor(){Gt(this,"idNodeMap",new Map),Gt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function rr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&rr(er.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&rr(er.parentNode(e),t,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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var ir={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function sr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,n=e in ir?ir[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in or?or[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return ar[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?ar[e]=l:r}catch(e){return r}}var ur={};function lr(e,t,r){var n,i=e+"."+String(r);if(ur[i])return ur[i].call(t);var o=sr(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(ur[i]=a,a.call(t)):t[r]}var cr={};function dr(e,t,r){var n=e+"."+String(r);if(cr[n])return cr[n].bind(t);var i=sr(e)[r];return"function"!=typeof i?t[r]:(cr[n]=i,i.bind(t))}var hr={childNodes:function(e){return lr("Node",e,"childNodes")},parentNode:function(e){return lr("Node",e,"parentNode")},parentElement:function(e){return lr("Node",e,"parentElement")},textContent:function(e){return lr("Node",e,"textContent")},contains:function(e,t){return dr("Node",e,"contains")(t)},getRootNode:function(e){return dr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?lr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?lr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return lr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return lr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return sr("MutationObserver").constructor}};var vr="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.",fr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fr=new Proxy(fr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var pr=Date.now;function mr(e){return e?e.nodeType===e.ELEMENT_NODE?e:hr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(pr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=hr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&hr.host(hr.getRootNode(e))&&(r=hr.host(hr.getRootNode(e))),r}function gr(e){for(var t,r=e;t=yr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=gr(e);return hr.contains(t,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ht(this,"id",1),Ht(this,"styleIDMap",new WeakMap),Ht(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return fr},closestElementOfNode:mr,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=o.getBoundingClientRect(),s=e(o,r),u=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:u,absoluteScale:s.absoluteScale*u}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:gr,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=hr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=hr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(hr.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>e(t,r,a||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(hr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&er.host(n)||null,Boolean(i&&"shadowRoot"in i&&er.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var a=hr.parentNode(t);return(!a||a.nodeType!==t.DOCUMENT_NODE)&&(!a||e(a,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=mr(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(rr(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return pr},on:function(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:a}=i;if(o&&o in t){var s=t[o];if(s.parent){var u=s.parent.children.indexOf(s);s.parent.children.splice(u,0,r(i,s.parent))}else{var l=n.indexOf(s);n.splice(l,0,r(i,null))}}else if(a in t){var c=t[a];c.children.push(r(i,c))}else n.push(r(i,null))}return n},shadowHostInDom:br,throttle:function(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.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([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==(Dt=xr.contentWindow)?void 0:Dt.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new tr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(e){jt(this,"fileName"),jt(this,"functionName"),jt(this,"lineNumber"),jt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Nr=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Rr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Nr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Nr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ar({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Mr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ar({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ar({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new Ar({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new Ar({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var a=n.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&i.push(a)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Er(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Er(e[n])&&Fr(e[n],t-1))return!0;return!1}function Or(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Er(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Er(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=_r(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}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 Br(e,t,r){var n,i=r?Object.assign({},Lr,r):Lr,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=t.error,o=Rr.parse(n).map((e=>e.toString())),a=[Or(r,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Or("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Or("Uncaught (in promise)",i.stringifyOptions),Or(t.reason,i.stringifyOptions)]);var o=Rr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(h(n,d));return()=>{u.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?wr.patch(t,r,(t=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Rr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Or(e,i.stringifyOptions)));++a<i.lengthThreshold?e({level:r,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Or("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})):()=>{}}}var Zr=e=>({name:"rrweb/console@1",observer:Br,options:e});function Pr(e,t){return-1!==e.indexOf(t)}var Dr=function(e){return e.trim()},qr=Array.isArray,jr=Object.prototype,Vr=jr.hasOwnProperty,Hr=jr.toString,Yr=qr||function(e){return"[object Array]"===Hr.call(e)},Gr=e=>"function"==typeof e,Wr=e=>Gr(e)&&-1!==e.toString().indexOf("[native code]"),zr=e=>e===Object(e)&&!Yr(e),Xr=e=>void 0===e,Ur=e=>"[object String]"==Hr.call(e),Kr=e=>null===e,Jr=e=>Xr(e)||Kr(e),Qr=e=>"[object Number]"==Hr.call(e)&&e==e,$r=e=>"[object Boolean]"===Hr.call(e),en=e=>e instanceof FormData;function tn(e){return null===e||"object"!=typeof e}function rn(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function nn(e){return!Xr(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var on,an,sn,un="Mobile",ln="Android",cn="Tablet",dn=ln+" "+cn,hn="iPad",vn="Apple Watch",fn="BlackBerry",pn="Nintendo",mn="PlayStation",yn="Xbox",gn="Windows Phone",bn="Nokia",wn="Ouya",Cn="Generic",In=Cn+" "+un.toLowerCase(),Sn=Cn+" "+cn.toLowerCase(),kn=new RegExp(yn,"i"),xn=new RegExp(mn+" \\w+","i"),An=new RegExp(pn+" \\w+","i"),Tn=new RegExp(fn+"|PlayBook|BB10","i"),Nn=function(e){var t=function(e){return An.test(e)?pn:xn.test(e)?mn:kn.test(e)?yn:new RegExp(wn,"i").test(e)?wn:new RegExp("("+gn+"|WPDesktop)","i").test(e)?gn:/iPad/.test(e)?hn:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?vn:Tn.test(e)?fn:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(bn,"i").test(e)?bn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(un).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ln:dn:new RegExp("(pda|"+un+")","i").test(e)?In:new RegExp(cn,"i").test(e)&&!new RegExp(cn+" pc","i").test(e)?Sn:""}(e);return t===hn||t===dn||"Kobo"===t||"Kindle Fire"===t||t===Sn?cn:t===pn||t===yn||t===mn||t===wn?"Console":t===vn?"Wearable":t?un:"Desktop"},Mn=e=>e instanceof Error;function Rn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return sn&&r.length===an||(an=r.length,sn=r.reduce(((r,n)=>{on||(on={});var i=on[n];if(i)r[i[0]]=i[1];else for(var o=e(n),a=o.length-1;a>=0;a--){var s=o[a],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,on[n]=[u,l];break}}return r}),{})),sn}}class _n{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(),o=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Yr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),r({},e,{cause:n,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var n of r.modifiers)t=yield n(t);return t}))()}convertToExceptionList(e,t){var n,i,o,a={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(o=e.synthetic)&&void 0!==o&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:Rn(this.stackParser)}}buildCoercingContext(e,t,n){void 0===n&&(n=0);var i=(r,n)=>{if(n<=4){var i=this.buildCoercingContext(e,t,n);return this.applyCoercers(r,i)}};return r({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,n),next:e=>i(e,n+1)})}}var En="?";function Fn(e,t,r,n,i){var o={platform:e,filename:t,function:"<anonymous>"===r?En:r,in_app:!0};return Xr(n)||(o.lineno=n),Xr(i)||(o.colno=i),o}var On=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:En,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ln=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Bn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Zn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Pn=(e,t)=>{var r=Ln.exec(e);if(r){var[,n,i,o]=r;return Fn(t,n,En,+i,+o)}var a=Bn.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var s=Zn.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[u,l]=On(a[1]||En,a[2]);return Fn(t,l,u,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jn=(e,t)=>{var r=Dn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=qn.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],o=r[1]||En;return[o,i]=On(o,i),Fn(t,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Vn=/\(error: (.*)\)/,Hn=50;function Yn(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var o=[],a=t.split("\n"),s=i;s<a.length;s++){var u=a[s];if(!(u.length>1024)){var l=Vn.test(u)?u.replace(Vn,"$1"):u;if(!l.match(/\S*Error: /)){for(var c of n){var d=c(l,e);if(d){o.push(d);break}}if(o.length>=Hn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Hn).map((e=>{return r({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||En});var n}))}(o)}}("web:javascript",Pn,jn)}class Gn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Ur(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return rn(e,"DOMException")}isDOMError(e){return rn(e,"DOMError")}}class Wn{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class zn{constructor(){}match(e){return rn(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,n=t.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Xn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(e){return"string"==typeof e}coerce(e,t){var r,[n,i]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(Xn);return n&&(t=n[1],r=n[2]),[t,r]}}var Kn=["fatal","error","warning","log","info","debug"];function Jn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:i.slice(0,t)+"..."}return""}class Qn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return nn(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Jn(e)}isSeverityLevel(e){return Ur(e)&&!(e=>Ur(e)&&0===e.trim().length)(e)&&Kn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(Mn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class $n{match(e){return nn(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+Jn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class ei{match(e){return tn(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class ti{match(e){return rn(e,"PromiseRejectionEvent")}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return tn(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){if(tn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var ri="undefined"!=typeof window?window:void 0,ni="undefined"!=typeof globalThis?globalThis:ri;"undefined"==typeof self&&(ni.self=ni),"undefined"==typeof File&&(ni.File=function(){});var ii=Array.prototype.forEach,oi=null==ni?void 0:ni.navigator,ai=null==ni?void 0:ni.document;null==ni||ni.location,null==ni||ni.fetch,null!=ni&&ni.XMLHttpRequest&&"withCredentials"in new ni.XMLHttpRequest&&ni.XMLHttpRequest,null==ni||ni.AbortController;var si=null==oi?void 0:oi.userAgent,ui=null!=ri?ri:{},li=()=>!!ri.Zone,ci=e=>e instanceof Document,di=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,n={C:function(t){if(ri&&(ui.POSTHOG_DEBUG||r)&&!Xr(ri.console)&&ri.console){for(var n=("__rrweb_original__"in ri.console[t]?ri.console[t].__rrweb_original__:ri.console[t]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];n(e,...o)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>di(e+" "+t,r)};return n},hi=di("[PostHog.js]"),vi=hi.createLogger,fi={};function pi(e,t,r){if(Yr(e))if(ii&&e.forEach===ii)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===fi)return}function mi(e,t,r){if(!Jr(e)){if(Yr(e))return pi(e,t,r);if(en(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===fi)return}else for(var i in e)if(Vr.call(e,i)&&t.call(r,e[i],i)===fi)return}}var yi=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return pi(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e};function gi(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function bi(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var wi=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return mi(e,(function(e,t){Xr(e)||Xr(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function Ci(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return Gr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Ii(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}function Si(e){return!!e&&1===e.nodeType}function ki(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function xi(e){return e?Dr(e).split(/\s+/):[]}function Ai(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return xi(t)}function Ti(e){var t="";return Mi(e)&&!Ri(e)&&e.childNodes&&e.childNodes.length&&mi(e.childNodes,(function(e){var r;(function(e){return!!e&&3===e.nodeType})(e)&&e.textContent&&(t+=null!==(r=function(e){return Jr(e)?null:Dr(e).split(/(\s+)/).filter((e=>Zi(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),Dr(t)}var Ni=["a","button","form","input","select","textarea","label"];function Mi(e){for(var t=e;t.parentNode&&!ki(t,"body");t=t.parentNode){var r=Ai(t);if(Pr(r,"ph-sensitive")||Pr(r,"ph-no-capture"))return!1}if(Pr(Ai(e),"ph-include"))return!0;var n=e.type||"";if(Ur(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Ur(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ri(e){return!!(ki(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ki(e,"select")||ki(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var _i="(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})",Ei=new RegExp("^(?:"+_i+")$"),Fi=new RegExp(_i),Oi="\\d{3}-?\\d{2}-?\\d{4}",Li=new RegExp("^("+Oi+")$"),Bi=new RegExp("("+Oi+")");function Zi(e,t){if(void 0===t&&(t=!0),Jr(e))return!1;if(Ur(e)){if(e=Dr(e),(t?Ei:Fi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Li:Bi).test(e))return!1}return!0}function Pi(e){var t=Ti(e);return Zi(t=(t+" "+Di(e)).trim())?t:""}function Di(e){var t="";return e&&e.childNodes&&e.childNodes.length&&mi(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Ti(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Di(e)).trim())}catch(e){hi.error("[AutoCapture]",e)}})),t}function qi(e){return function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+="."+o.replace(/"/g,"");var a=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return gi(a).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[ji(t.toString())]=ji(r.toString())})),i+=":",i+=gi(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Vi(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return gi(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function ji(e){return e.replace(/"|\\"/g,'\\"')}function Vi(e){var t=e.attr__class;return t?Yr(t)?t:xi(t):void 0}var Hi={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,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"]},Yi=vi("[Recorder]"),Gi=e=>"navigation"===e.entryType,Wi=e=>"resource"===e.entryType;function zi(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Gi(e)||Wi(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>eo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>Gi(e)||Wi(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>eo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Xi(e,t){return!!t&&($r(t)||t[e])}function Ui(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if($r(r))return!0;if(Yr(r))return o(r);var a=r[t];return $r(a)?a:o(a)}function Ki(e,t,r,n,i,o){return Ji.apply(this,arguments)}function Ji(){return Ji=t((function*(e,t,r,n,i,o){if(void 0===o&&(o=0),o>10)return Yi.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var a=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Wi(e)&&e.initiatorType===t&&(Xr(n)||e.startTime>=n)&&(Xr(i)||e.startTime<=i)));return a||(yield new Promise((e=>setTimeout(e,50*o))),Ki(e,t,r,n,i,o+1))})),Ji.apply(this,arguments)}function Qi(e){var{body:t,options:r,url:n}=e;if(Jr(t))return null;var{hostname:i,isHostDenied:o}=Ii(n,r);if(o)return i+" is in deny list";if(Ur(t))return t;if(ci(t))return t.textContent;if(en(t))return wi(t);if(zr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var $i=e=>!Kr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function eo(e){var{entry:t,method:n,status:i,networkRequest:o,isInitial:a,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(s||0)),v=[r({},t?t.toJSON():{name:l},{startTime:Xr(s)?void 0:Math.round(s),endTime:Xr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if($i(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var to=["video/","audio/"];function ro(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function no(){return no=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Ii(n,r);return o?Promise.resolve(i+" is in deny list"):ro(t)})),no.apply(this,arguments)}function io(){return io=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),a=to.some((e=>null==o?void 0:o.startsWith(e)));if(o&&a)return"Content-Type "+o+" is not supported";var{hostname:s,isHostDenied:u}=Ii(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return Kr(i)?ro(t):Promise.resolve(i)})),io.apply(this,arguments)}function oo(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Xi("request",n.recordHeaders),o=Xi("response",n.recordHeaders),a=Ci(r,"fetch",(a=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),h={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),i&&(h.requestHeaders=v),Ui({type:"request",headers:v,url:t,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return no.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=yield a(d),c=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),o&&(h.responseHeaders=f),Ui({type:"response",headers:f,url:t,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return io.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Ki(r,"fetch",d.url,l,c).then((t=>{var r,n=eo({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{a()}}var ao=null;function so(e,t,n){if(!("performance"in t))return()=>{};if(ao)return Yi.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},Hi,n):Hi,o=t=>{var n=[];t.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},a=zi(o,t,i),s=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Xi("request",r.recordHeaders),i=Xi("response",r.recordHeaders),o=Ci(t.XMLHttpRequest.prototype,"open",(o=>function(a,s,u,l,c){void 0===u&&(u=!0);var d,h,v=this,f=new Request(s),p={},m={},y=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=v.send.bind(v);v.send=e=>(Ui({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=Qi({body:e,options:r,url:s})),d=t.performance.now(),g(e));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(),h=t.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Ui({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=Qi({body:v.response,options:r,url:s})),Ki(t,"xmlhttprequest",f.url,d,h).then((t=>{var r=eo({entry:t,method:a,status:null==v?void 0:v.status,networkRequest:p,start:d,end:h,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,a,s.toString(),u,l,c)}));return()=>{o()}}(o,t,i),u=oo(o,t,i)),ao=()=>{a(),s(),u(),ao=null}}var uo=e=>({name:"rrweb/network@1",observer:so,options:e});ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Zr,getRecordNetworkPlugin:uo},ui.__PosthogExtensions__.rrweb={record:Pt,version:"v2"},ui.rrweb={record:Pt,version:"v2"},ui.rrwebConsoleRecord={getRecordConsolePlugin:Zr},ui.getRecordNetworkPlugin=uo;var lo,co,ho,vo,fo,po,mo,yo,go,bo,wo,Co,Io={},So=[],ko=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xo=Array.isArray;function Ao(e,t){for(var r in t)e[r]=t[r];return e}function To(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function No(e,t,r){var n,i,o,a={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?lo.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Mo(e,a,n,i,null)}function Mo(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++ho:i,__i:-1,__u:0};return null==i&&null!=co.vnode&&co.vnode(o),o}function Ro(e){return e.children}function _o(e,t){this.props=e,this.context=t}function Eo(e,t){if(null==t)return e.__?Eo(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Eo(e):null}function Fo(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Fo(e)}}function Oo(e){(!e.__d&&(e.__d=!0)&&vo.push(e)&&!$.__r++||fo!=co.debounceRendering)&&((fo=co.debounceRendering)||po)($)}function $(){for(var e,t,r,n,i,o,a,s=1;vo.length;)vo.length>s&&vo.sort(mo),e=vo.shift(),s=vo.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ao({},n)).__v=n.__v+1,co.vnode&&co.vnode(r),jo(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,null==i?Eo(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Ho(o,r,a),n.__e=n.__=null,r.__e!=i&&Fo(r)));$.__r=0}function Lo(e,t,r,n,i,o,a,s,u,l,c){var d,h,v,f,p,m,y,g=n&&n.__k||So,b=t.length;for(u=function(e,t,r,n,i){var o,a,s,u,l,c=r.length,d=c,h=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[o]=Mo(null,a,null,null,null):xo(a)?a=e.__k[o]=Mo(Ro,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[o]=Mo(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,u=o+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=Zo(a,r,u,d))&&(d--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(i>c?h--:i<c&&h++),"function"!=typeof a.type&&(a.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,a.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(s=r[o])&&0==(2&s.__u)&&(s.__e==n&&(n=Eo(s)),Wo(s,s));return n}(r,t,g,u,b),d=0;d<b;d++)null!=(v=r.__k[d])&&(h=-1==v.__i?Io:g[v.__i]||Io,v.__i=d,m=jo(e,v,h,i,o,a,s,u,l,c),f=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&Go(h.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(y=!!(4&v.__u))||h.__k===v.__k?u=Bo(v,u,e,y):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Bo(e,t,r,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=Bo(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Eo(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Zo(e,t,r,n){var i,o,a,s=e.key,u=e.type,l=t[r],c=null!=l&&0==(2&l.__u);if(null===l&&null==s||c&&s==l.key&&u==l.type)return r;if(n>(c?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;)if(null!=(l=t[a=i>=0?i--:o++])&&0==(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function Po(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||ko.test(t)?r:r+"px"}function Do(e,t,r,n,i){var o,a;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Po(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Po(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(yo,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=go,e.addEventListener(t,o?wo:bo,o)):e.removeEventListener(t,o?wo:bo,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function qo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=go++;else if(t.t<r.u)return;return r(co.event?co.event(t):t)}}}function jo(e,t,r,n,i,o,a,s,u,l){var c,d,h,v,f,p,m,y,g,b,w,$,C,I,S,k,x,A=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(c=co.__b)&&c(t);e:if("function"==typeof A)try{if(y=t.props,g="prototype"in A&&A.prototype.render,b=(c=A.contextType)&&n[c.__c],w=c?b?b.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:(g?t.__c=d=new A(y,w):(t.__c=d=new _o(y,w),d.constructor=A,d.render=zo),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),g&&null==d.__s&&(d.__s=d.state),g&&null!=A.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ao({},d.__s)),Ao(d.__s,A.getDerivedStateFromProps(y,d.__s))),v=d.props,f=d.state,d.__v=t,h)g&&null==A.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),g&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(g&&null==A.getDerivedStateFromProps&&y!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){for(t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),g&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,C=co.__r,I=0,g){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(n=Ao(Ao({},n),d.getChildContext())),g&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),k=c,null!=c&&c.type===Ro&&null==c.key&&(k=Yo(c.props.children)),s=Lo(e,xo(k)?k:[k],t,r,n,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=o)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(x=o.length;x--;)To(o[x]);Vo(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Vo(t);co.__e(e,t,r)}else null==o&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,n,i,o,a,s,u){var l,c,d,h,v,f,p,m=r.props||Io,y=t.props,g=t.type;if("svg"==g?i="http://www.w3.org/2000/svg":"math"==g?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!g&&(g?v.localName==g:3==v.nodeType)){e=v,o[l]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(i,g,y.is&&y),s&&(co.__m&&co.__m(t,o),s=!1),o=null}if(null==g)m===y||s&&e.data==y||(e.data=y);else{if(o=o&&lo.call(e.childNodes),!s&&null!=o)for(m={},l=0;l<e.attributes.length;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)if(v=m[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=v;else if(!(l in y)){if("value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y)continue;Do(e,l,null,v,i)}for(l in y)v=y[l],"children"==l?h=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||Do(e,l,v,m[l],i);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Lo("template"==t.type?e.content:e,xo(h)?h:[h],t,r,n,"foreignObject"==g?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Eo(r,0),s,u),null!=o)for(l=o.length;l--;)To(o[l]);s||(l="value","progress"==g&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==g&&!f||"option"==g&&f!=m[l])&&Do(e,l,f,m[l],i),l="checked",null!=p&&p!=e[l]&&Do(e,l,p,m[l],i))}return e}(r.__e,t,r,n,i,o,a,u,l);return(c=co.diffed)&&c(t),128&t.__u?void 0:s}function Vo(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Vo)}function Ho(e,t,r){for(var n=0;n<r.length;n++)Go(r[n],r[++n],r[++n]);co.__c&&co.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){co.__e(e,t.__v)}}))}function Yo(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:xo(e)?e.map(Yo):Ao({},e)}function Go(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){co.__e(e,r)}}function Wo(e,t,r){var n,i;if(co.unmount&&co.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Go(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){co.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Wo(n[i],t,r||"function"!=typeof e.type);r||To(e.__e),e.__c=e.__=e.__e=void 0}function zo(e,t,r){return this.constructor(e,r)}function Xo(e,t,r){var n,i,o;t==document&&(t=document.documentElement),co.__&&co.__(e,t),n=!1?null:t.__k,i=[],o=[],jo(t,e=t.__k=No(Ro,null,[e]),n||Io,Io,t.namespaceURI,n?null:t.firstChild?lo.call(t.childNodes):null,i,n?n.__e:t.firstChild,false,o),Ho(i,e,o)}function Uo(e,t,r){var n,i,o,a,s=Ao({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&null!=a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?lo.call(arguments,2):r),Mo(e.type,s,n||e.key,i||e.ref,null)}lo=So.slice,co={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},ho=0,_o.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ao({},this.state),"function"==typeof e&&(e=e(Ao({},r),this.props)),e&&Ao(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Oo(this))},_o.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Oo(this))},_o.prototype.render=Ro,vo=[],po="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mo=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,yo=/(PointerCapture)$|Capture$/i,go=0,bo=qo(!1),wo=qo(!0),Co=0;var Ko,Jo,Qo,$o,ea=0,ta=[],ra=co,na=ra.__b,ia=ra.__r,oa=ra.diffed,aa=ra.__c,sa=ra.unmount,ua=ra.__;function la(e,t){ra.__h&&ra.__h(Jo,e,ea||t),ea=0;var r=Jo.__H||(Jo.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ca(e){return ea=1,function(e,t,r){var n=la(Ko++,2);if(n.t=e,!n.__c&&(n.__=[Ca(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Jo,!Jo.__f)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=n.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),o&&o.call(this,e,t,r)||a};Jo.__f=!0;var o=Jo.shouldComponentUpdate,a=Jo.componentWillUpdate;Jo.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},Jo.shouldComponentUpdate=i}return n.__N||n.__}(Ca,e)}function da(e,t){var r=la(Ko++,3);!ra.__s&&wa(r.__H,t)&&(r.__=e,r.u=t,Jo.__H.__h.push(r))}function ha(e){return ea=5,va((function(){return{current:e}}),[])}function va(e,t){var r=la(Ko++,7);return wa(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function fa(e){var t=Jo.context[e.__c],r=la(Ko++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Jo)),t.props.value):e.__}function pa(){for(var e;e=ta.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ga),e.__H.__h.forEach(ba),e.__H.__h=[]}catch(t){e.__H.__h=[],ra.__e(t,e.__v)}}ra.__b=function(e){Jo=null,na&&na(e)},ra.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ua&&ua(e,t)},ra.__r=function(e){ia&&ia(e),Ko=0;var t=(Jo=e.__c).__H;t&&(Qo===Jo?(t.__h=[],Jo.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(ga),t.__h.forEach(ba),t.__h=[],Ko=0)),Qo=Jo},ra.diffed=function(e){oa&&oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ta.push(t)&&$o===ra.requestAnimationFrame||(($o=ra.requestAnimationFrame)||ya)(pa)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Qo=Jo=null},ra.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ga),e.__h=e.__h.filter((function(e){return!e.__||ba(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ra.__e(r,e.__v)}})),aa&&aa(e,t)},ra.unmount=function(e){sa&&sa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{ga(e)}catch(e){t=e}})),r.__H=void 0,t&&ra.__e(t,r.__v))};var ma="function"==typeof requestAnimationFrame;function ya(e){var t,r=function(){clearTimeout(n),ma&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);ma&&(t=requestAnimationFrame(r))}function ga(e){var t=Jo,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Jo=t}function ba(e){var t=Jo;e.__c=e.__(),Jo=t}function wa(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Ca(e,t){return"function"==typeof t?t(e):t}var Ia=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Sa=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),ka=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),xa=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Aa=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ta=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Na=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Ma=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),Ra=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),_a=vi("[Surveys]");var Ea="inProgressSurvey_",Fa=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Oa=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},La=e=>Oa("seenSurvey_",e),Ba=e=>{localStorage.getItem(La(e))||localStorage.setItem(La(e),"true")},Za=[xa.Popover,xa.Widget,xa.API];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});var Pa="0123456789abcdef";class Da{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Da(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Pa.charAt(this.bytes[t]>>>4)+Pa.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Da(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class qa{constructor(){this.I=0,this.S=0,this.k=new Ha}generate(){var e=this.generateOrAbort();if(Xr(e)){this.I=0;var t=this.generateOrAbort();if(Xr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(!(e+1e4>this.I))return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Da.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var ja,Va=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ri&&!Xr(ri.crypto)&&crypto.getRandomValues&&(Va=e=>crypto.getRandomValues(e));class Ha{constructor(){this.N=new Uint32Array(8),this.R=1/0}nextUint32(){return this.R>=this.N.length&&(Va(this.N),this.R=0),this.N[this.R++]}}var Ya=()=>Ga().toString(),Ga=()=>(ja||(ja=new qa)).generate();null!=oi&&oi.sendBeacon;var Wa=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},za={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Wa(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Wa(t,e))))),icontains:(e,t)=>t.map(Xa).some((t=>e.map(Xa).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Xa).every((t=>e.map(Xa).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Xa=e=>e.toLowerCase(),Ua=vi("[Stylesheet Loader]"),Ka=ri,Ja=ai;function Qa(e){return"$survey_response_"+e}var $a="#020617",es={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:Sa.Right,widgetType:Ia.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:$a,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function ts(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function rs(e){var t;void 0===e&&(e=es.backgroundColor),"#"===e[0]&&(t=ts(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=ts(r)),!t)return $a;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?$a:"white"}return $a}function ns(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(Ua.error("prepare_external_dependency_stylesheet returned null"),null)})(Ja,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var is=(e,t,n)=>{var i=xs(e),o=Ja.querySelector("."+i);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var a=Ja.createElement("div");((e,t,n)=>{var i=r({},es,n),o=e.style,a=![Sa.Center,Sa.Left,Sa.Right].includes(i.position)||t===xa.Widget&&(null==n?void 0:n.widgetType)===Ia.Tab;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),o.setProperty("--ph-survey-box-padding",i.boxPadding),o.setProperty("--ph-survey-max-width",i.maxWidth),o.setProperty("--ph-survey-z-index",i.zIndex),o.setProperty("--ph-survey-border-color",i.borderColor),a?(o.setProperty("--ph-survey-border-radius",i.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",i.borderRadius+" "+i.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",i.backgroundColor),o.setProperty("--ph-survey-box-shadow",i.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||rs(i.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",rs(i.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||rs(i.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),o.setProperty("--ph-widget-color",i.widgetColor),o.setProperty("--ph-widget-text-color",rs(i.widgetColor)),o.setProperty("--ph-widget-z-index",i.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=s||i.inputBackground;s||"white"!==i.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||rs(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var s=a.attachShadow({mode:"open"}),u=ns(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return Ja.body.appendChild(a),{shadow:s,isNewlyCreated:!0}},os=(e,t)=>{if(!t)return null;var r=e[Qa(t)];return Yr(r)?[...r]:r},as=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:o,isSurveyCompleted:a,properties:s}=e;o?(Ba(n),o.capture(Ma.SENT,r({[Ra.SURVEY_NAME]:n.name,[Ra.SURVEY_ID]:n.id,[Ra.SURVEY_ITERATION]:n.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:n.current_iteration_start_date,[Ra.SURVEY_QUESTIONS]:n.questions.map((e=>({id:e.id,question:e.question,response:os(t,e.id)}))),[Ra.SURVEY_SUBMISSION_ID]:i,[Ra.SURVEY_COMPLETED]:a,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,s,{$set:{[Fa(n,"responded")]:!0}})),a&&(Ka.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),ks(n))):_a.error("[survey sent] event not captured, PostHog instance not found.")},ss=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!Jr(e))).length>0,us=(e,t,n)=>r({[Ra.SURVEY_NAME]:e.name,[Ra.SURVEY_ID]:e.id,[Ra.SURVEY_ITERATION]:e.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ra.SURVEY_PARTIALLY_COMPLETED]:ss(t),sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},null==t?void 0:t.responses,{[Ra.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[Ra.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:os((null==t?void 0:t.responses)||{},e.id)})))}),ls=(e,t,n)=>{if(t){if(!n){var i=Is(e);t.capture(Ma.DISMISSED,r({},us(e,i,t),{$set:{[Fa(e,"dismissed")]:!0}})),ks(e),Ba(e),Ka.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else _a.error("[survey dismissed] event not captured, PostHog instance not found.")},cs=(e,t)=>{if(t){var r=(e=>Oa("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var n=Is(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Ma.ABANDONED,us(e,n,t),{transport:"sendBeacon"})}}else _a.error("[survey abandoned] event not captured, PostHog instance not found.")},ds=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),hs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,vs=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?hs(e.questions,ds(e.questions)):e.questions,fs=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Na.Always||Ss(e)},ps=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Oo(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Co++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),ms=()=>fa(ps),ys=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return Uo(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function gs(e){return null!=e?e:"icontains"}function bs(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==Ka||null==(r=Ka.location)?void 0:r.href;if(!i)return!1;var o=[e.conditions.url],a=gs(null==(n=e.conditions)?void 0:n.urlMatchType);return za[a](o,[i])}var ws=e=>{var t=""+Ea+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ea+e.id+"_"+e.current_iteration),t},Cs=(e,t)=>{try{localStorage.setItem(ws(e),JSON.stringify(t))}catch(e){_a.error("Error setting in-progress survey state in localStorage",e)}},Is=e=>{try{var t=localStorage.getItem(ws(e));if(t)return JSON.parse(t)}catch(e){_a.error("Error getting in-progress survey state from localStorage",e)}return null},Ss=e=>{var t=Is(e);return!Jr(null==t?void 0:t.surveySubmissionId)},ks=e=>{try{localStorage.removeItem(ws(e))}catch(e){_a.error("Error clearing in-progress survey state from localStorage",e)}};function xs(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function As(e,t,r){if(void 0===t&&(t=Sa.Right),e===xa.ExternalSurvey)return{};switch(t){case Sa.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Sa.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Sa.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Sa.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Sa.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Sa.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Sa.Left:return{left:"30px"};case Sa.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Sa.Right:return{right:e===xa.Widget&&r===Ia.Tab?"60px":"30px"}}}var Ts=0;function Ns(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ts,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return co.vnode&&co.vnode(l),l}var Ms=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Rs=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),_s=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Es=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Fs=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Os=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ns("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"})}),Ls=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ns("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"})}),Bs=Ns("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[Ns("title",{id:"close-survey-title",children:"Close survey"}),Ns("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"currentColor"})]}),Zs=Ns("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ns("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ns("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ns("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ns("g",{mask:"url(#mask0_2415_6911)",children:[Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"})]})]}),Ns("defs",{children:Ns("clipPath",{id:"clip0_2415_6911",children:Ns("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Ps(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Ns("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Zs]})}function Ds(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:a,skipSubmitButton:s}=e,{isPreviewMode:u}=fa(ps);return Ns("div",{className:"bottom-section",children:[!s&&Ns("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==ri||ri.open(o)),u?null==a||a():i()},children:t}),!n.whiteLabel&&Ns(Ps,{urlParams:{utm_source:"survey-footer"}})]})}function qs(e){var{question:t,forceDisableHtml:r,htmlFor:n}=e;return Ns("div",{class:"question-header",children:[Ns(t.type===Aa.Open?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&ys({component:No("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function js(e){var{onClick:t}=e,{isPreviewMode:r}=fa(ps);return Ns("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Bs})}Ns("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ns("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 Vs=ri;function Hs(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:o,onClose:a}=e,{isPopup:s}=fa(ps);return da((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),a())};return bi(Vs,"keydown",e),()=>{Vs.removeEventListener("keydown",e)}}),[a]),Ns("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Ns(js,{onClick:()=>a()}),Ns("h3",{className:"thank-you-message-header",children:t}),r&&ys({component:No("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&Ns(Ds,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})}var Ys=e=>Yr(e)&&e.every((e=>Ur(e)));function Gs(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o,displayQuestionIndex:a,initialValue:s}=e,{isPreviewMode:u}=ms(),l=ha(null),[c,d]=ca((()=>Ur(s)?s:""));da((()=>{setTimeout((()=>{var e;u||(null==(e=l.current)||e.focus())}),100)}),[u]);var h="surveyQuestion"+a;return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:t,forceDisableHtml:r,htmlFor:h}),Ns("textarea",{ref:l,id:h,rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c})]}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:!c&&!t.optional,appearance:n,onSubmit:()=>i(c),onPreviewSubmit:()=>o(c)})]})}function Ws(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return Ns(Ro,{children:[Ns("div",{className:"question-container",children:Ns(qs,{question:t,forceDisableHtml:r})}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function zs(e){var t,{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l=r.scale,c=10===r.scale?0:1,[d,h]=ca((()=>Qr(u)?u:Yr(u)&&u.length>0&&Qr(parseInt(u[0]))?parseInt(u[0]):Ur(u)&&Qr(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=ms(),p=e=>f?s(e):a(e);return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:r,forceDisableHtml:n}),Ns("div",{className:"rating-section",children:[Ns("div",{className:"rating-options",children:["emoji"===r.display&&Ns("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=$s[r.scale])?void 0:t.map(((e,t)=>Ns("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick:()=>{var e=t+1;h(e),r.skipSubmitButton&&p(e)},children:e},t)))}),"number"===r.display&&Ns("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-c+1)+", minmax(0, 1fr))"},children:eu(r.scale).map(((e,t)=>Ns(Xs,{displayQuestionIndex:i,active:d===e,appearance:o,num:e,setActiveNumber:e=>{h(e),r.skipSubmitButton&&p(e)}},t)))})]}),!v&&Ns("div",{className:"rating-text",children:[Ns("div",{children:r.lowerBoundLabel}),Ns("div",{children:r.upperBoundLabel})]})]})]}),Ns(Ds,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Kr(d)&&!r.optional,appearance:o,onSubmit:()=>a(d),onPreviewSubmit:()=>s(d),skipSubmitButton:r.skipSubmitButton})]})}function Xs(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return Ns("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{i(t)},children:t})}function Us(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l=ha(null),c=va((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=hs(t,ds(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[d,h]=ca((()=>((e,t)=>Ur(e)||Ys(e)?e:t===Aa.SingleChoice?null:[])(u,t.type))),[v,f]=ca((()=>((e,t)=>{if(Ur(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Ys(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,c))),{isPreviewMode:p}=ms(),m=t.type===Aa.SingleChoice,y=t.type===Aa.MultipleChoice,g=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(e,t)=>{if(t){var n=!v.isSelected;return f((e=>r({},e,{isSelected:n,inputValue:n?e.inputValue:""}))),m&&h(""),void(n&&setTimeout((()=>{var e;return null==(e=l.current)?void 0:e.focus()}),75))}if(m)return h(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(g&&(a(e),p&&s(e)));y&&Yr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),m&&h(t)},C=e=>{e.stopPropagation(),"Enter"!==e.key||I()||(e.preventDefault(),S()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),m&&h(null))},I=()=>!t.optional&&(!!Kr(d)||(!(!Yr(d)||v.isSelected||0!==d.length)||!(!v.isSelected||""!==v.inputValue.trim()))),S=()=>{v.isSelected&&y?Yr(d)&&(p?s([...d,v.inputValue]):a([...d,v.inputValue])):p?s(d):a(d)};return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:t,forceDisableHtml:n}),Ns("fieldset",{className:"multiple-choice-options limit-height",children:[Ns("legend",{className:"sr-only",children:y?" Select all that apply":" Select one"}),c.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,o="surveyQuestion"+i+"Choice"+r,a=o+"Open",s=n?v.isSelected:m?d===e:Yr(d)&&d.includes(e);return Ns("label",{className:n?"choice-option-open":"",children:[Ns("div",{className:"response-choice",children:[Ns("input",{type:m?"radio":"checkbox",name:o,checked:s,onChange:()=>b(e,n),id:o,"aria-controls":a}),Ns("span",{children:n?e+":":e})]}),n&&Ns("input",{type:"text",ref:l,id:a,name:"question"+i+"Open",value:v.inputValue,onKeyDown:C,onInput:w,onClick:t=>{v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:I(),appearance:o,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:g})]})}var Ks=[1,2,3,4,5],Js=[1,2,3,4,5,6,7],Qs=[0,1,2,3,4,5,6,7,8,9,10],$s={2:[Os,Ls],3:[_s,Rs,Ms],5:[Es,_s,Rs,Ms,Fs]};function eu(e){switch(e){case 5:default:return Ks;case 7:return Js;case 10:return Qs}}var tu=vi("[Surveys]");function ru(e,t,r){var n,i=e.questions[t],o=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?Ta.End:o;if(i.branching.type===Ta.End)return Ta.End;if(i.branching.type===Ta.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ta.ResponseBased){if(i.type===Aa.SingleChoice){var a,s=i.choices.indexOf(""+r);if(-1===s&&i.hasOpenChoice&&(s=i.choices.length-1),null!=(a=i.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(s)){var u=i.branching.responseValues[s];return Number.isInteger(u)?u:u===Ta.End?Ta.End:o}}else if(i.type===Aa.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(e<1||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===Ta.End?Ta.End:o}}return o}return tu.warn("Falling back to next question index due to unexpected branching type"),o}var nu=ri,iu=ai,ou="ph:show_survey_widget",au="PHWidgetSurveyClickListener",su=250,uu=20,lu=12;function cu(e,t){try{var r=e.getBoundingClientRect(),n=nu.innerHeight,i=nu.innerWidth,o=su,a=r.left+r.width/2-t/2;a+t>i-uu&&(a=i-t-uu),a<uu&&(a=uu);var s=lu,u=n-r.bottom,l=r.top,c=u<o&&l>u;return{position:"fixed",top:c?"auto":r.bottom+s+"px",left:a+"px",right:"auto",bottom:c?n-r.top+s+"px":"auto",zIndex:es.zIndex}}catch(e){return _a.warn("Failed to calculate trigger position:",e),null}}class du{constructor(e){var t=this;this.F=new Map,this.O=new Map,this.B=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Ss(t)&&cs(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var n,i,o,a,s=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this.Z(s.id);var{properties:u,initialResponses:l}=null!=t?t:{},c=!!(l&&Object.keys(l).length>0)&&this.D(s,l,u);if(!c||null!=(n=s.appearance)&&n.displayThankYouMessage){this.q(s);var d={};if((null==(i=s.appearance)?void 0:i.position)===Sa.NextToTrigger&&null!=(o=s.appearance)&&o.widgetSelector){var h,v=iu.querySelector(s.appearance.widgetSelector);if(v)d=cu(v,parseInt((null==(h=s.appearance)?void 0:h.maxWidth)||es.maxWidth))||{}}var f=(null==(a=s.appearance)?void 0:a.surveyPopupDelaySeconds)||0,{shadow:p}=is(s,this._posthog);if(f<=0)return Xo(Ns(pu,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.j,properties:u,style:d,isSurveyCompleted:c}),p);var m=setTimeout((()=>{if(this.F.delete(s.id),!bs(s))return this.j(s);Xo(Ns(pu,{posthog:this._posthog,survey:r({},s,{appearance:r({},s.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.j,properties:u,style:d,isSurveyCompleted:c}),p)}),1e3*f);this.F.set(s.id,m)}},this.V=e=>{var{shadow:t,isNewlyCreated:r}=is(e,this._posthog);r&&Xo(Ns(yu,{posthog:this._posthog,survey:e},e.id),t)},this.H=e=>{this.Y(e);var t=this.O.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(au),this.O.delete(e.id),_a.info("Removed click listener for survey "+e.id))},this.G=(e,t)=>{var r=iu.querySelector(t),n=this.O.get(e.id);if(r){if(this.V(e),n){if(r===n.element)return;_a.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.H(e)}if(!r.hasAttribute(au)){var i=t=>{var r,n;t.stopPropagation();var i=(null==(r=e.appearance)?void 0:r.position)===Sa.NextToTrigger?cu(t.currentTarget,parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||es.maxWidth)):{};nu.dispatchEvent(new CustomEvent(ou,{detail:{surveyId:e.id,position:i}}))};bi(r,"click",i),r.setAttribute(au,"true"),this.O.set(e.id,{element:r,listener:i,survey:e}),_a.info("Attached click listener for feedback button survey "+e.id)}}else n&&this.H(e)},this.renderPopover=e=>{var{shadow:t}=is(e,this._posthog);Xo(Ns(pu,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.j}),t)},this.renderSurvey=(e,t,r)=>{var n;null!=(n=this._posthog.config)&&null!=(n=n.surveys)&&n.prefillFromUrl&&this.W(e),Xo(Ns(pu,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.j,isPopup:!1,properties:r}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||n.surveys.getSurveys((r=>{var n=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.X(e)&&t.U(e)&&t.K(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===xa.Popover||e.type===xa.Widget)),n=t.J(r),i=new Set;n.forEach((e=>{if(e.type===xa.Widget){var r,n,o,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Ia.Tab)return void t.V(e);if((null==(n=e.appearance)?void 0:n.widgetType)===Ia.Selector&&null!=(o=e.appearance)&&o.widgetSelector)i.add(e.id),t.G(e,null==(a=e.appearance)?void 0:a.widgetSelector)}Kr(t.$)&&e.type===xa.Popover&&t.handlePopoverSurvey(e)})),t.O.forEach((e=>{var{survey:r}=e;i.has(r.id)||t.H(r)}))}),e)},this.q=e=>{Kr(this.$)||_a.error("Survey "+this.$+" already in focus. Cannot add survey "+e.id+"."),this.$=e.id},this.j=e=>{this.$!==e.id&&_a.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.Z(e.id),this.$=null,this.Y(e)},this._posthog=e,this.$=null}Z(e){var t=this.F.get(e);t&&(clearTimeout(t),this.F.delete(e))}cancelSurvey(e){this.F.has(e)&&(_a.info("Cancelled pending survey "+e),this.Z(e),this.$===e&&(this.$=null))}J(e){return e.sort(((e,t)=>{var r,n,i=Ss(e),o=Ss(t);if(i&&!o)return-1;if(!i&&o)return 1;var a=e.schedule===Na.Always,s=t.schedule===Na.Always;return a&&!s?1:!a&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}W(e){if(!this.B.has(e.id)){var{params:t}=function(e){var t={},r=!1,n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};var i=n.split("&");for(var o of i){var[a,s]=o.split("=");if(a&&!Xr(s)){var u=decodeURIComponent(a),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var c=u.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(l)}}else r=!0}}return{params:t,autoSubmit:r}}(nu.location.search);if(0!==Object.keys(t).length){_a.info("[Survey Prefill] Detected URL prefill parameters");var r=this.ee(e,t);if(r){var{responses:n,submissionId:i,isSurveyCompleted:o,skippedResponses:a}=r;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&as({responses:o?n:a,survey:e,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:o}),this.B.add(e.id)}}}}D(e,t,r){var n={};for(var[i,o]of Object.entries(t)){n[parseInt(i)]=Yr(o)?o.map(String):[String(o)]}_a.info("[Survey] Processing initial responses");var a=this.ee(e,n);if(!a)return!1;var{responses:s,submissionId:u,isSurveyCompleted:l}=a;return as({responses:s,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}ee(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,n)=>{if(t[n]&&e.id){var i=t[n],o=Qa(e.id);try{switch(e.type){case Aa.SingleChoice:if(!e.choices||0===e.choices.length)return void hi.warn("[Survey Prefill] Question "+n+" has no choices");var a=parseInt(i[0],10);if(isNaN(a)||a<0||a>=e.choices.length)return void hi.warn("[Survey Prefill] Invalid choice index for q"+n+": "+i[0]);r[o]=e.choices[a];break;case Aa.MultipleChoice:if(!e.choices||0===e.choices.length)return void hi.warn("[Survey Prefill] Question "+n+" has no choices");var s=i.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===s.length)return void hi.warn("[Survey Prefill] No valid choices for q"+n);var u=[...new Set(s.map((t=>e.choices[t])))];u.length<s.length&&hi.warn("[Survey Prefill] Removed duplicate choices for q"+n),r[o]=u;break;case Aa.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||l<0||l>c)return void hi.warn("[Survey Prefill] Invalid rating for q"+n+": "+i[0]+" (scale: 0-"+c+")");r[o]=l;break;default:hi.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){hi.error("[Survey Prefill] Error converting q"+n+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return _a.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Ya(),i=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var n=0,i={},o=e.questions.length+1;n<e.questions.length&&0<o&&t.includes(n);){var a=e.questions[n];if(!a||!("skipSubmitButton"in a)||!a.skipSubmitButton)break;if(a.id){var s=Qa(a.id);Xr(r[s])||(i[s]=r[s])}var u=ru(e,n,a.id?r[Qa(a.id)]:null);if(u===Ta.End)return{startQuestionIndex:e.questions.length,skippedResponses:i};n=u}return{startQuestionIndex:n,skippedResponses:i}}(e,i,r),s=o>=e.questions.length;return Cs(e,{surveySubmissionId:n,responses:r,lastQuestionIndex:o}),_a.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:s,skippedResponses:a}}catch(e){return _a.error("[Survey Prefill] Error handling prefill:",e),null}}te(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),n=!0;t&&(n=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&n}X(e){return!e.conditions||bs(e)&&function(e){var t,r,n;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!si)return!1;var i=Nn(si);return za[gs(null==(n=e.conditions)?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==Ja||!Ja.querySelector(e.conditions.selector))}(e)}re(e){return fs(e)||this.te(e.internal_targeting_flag_key)||Ss(e)}checkSurveyEligibility(e){var t,r,n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason="Survey is not running. It was completed on "+e.end_date,n;if(!Za.includes(e.type))return n.eligible=!1,n.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",n;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.te(e.linked_flag_key,i)?this.te(e.targeting_flag_key)?this.re(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(n/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(La(e))&&!fs(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n):(n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n):(n.eligible=!1,n.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",n)}U(e){var t;if(!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}K(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.te(r)}))}Y(e){try{var t=iu.querySelector(xs(e,!0));null!=t&&t.shadowRoot&&Xo(null,t.shadowRoot),null==t||t.remove()}catch(t){_a.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.q,removeSurveyFromFocus:this.j,surveyInFocus:this.$,surveyTimeouts:this.F,handleWidget:this.V,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.G,sortSurveysByAppearanceDelay:this.J,checkFlags:this.K.bind(this),isSurveyFeatureFlagEnabled:this.te.bind(this)}}}function hu(e,t){if(iu&&nu){var r,n=new du(e);if(e.config.disable_surveys_automatic_display)return _a.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===t)return _a.info("There are no surveys to load or Surveys is disabled in the project settings."),n;n.callSurveysAndEvaluateDisplayLogic(!0);var i=()=>{Xr(r)&&(r=setInterval((()=>{n.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return i(),bi(iu,"visibilitychange",(()=>{iu.hidden?Xr(r)||(clearInterval(r),r=void 0):(n.callSurveysAndEvaluateDisplayLogic(!1),i())})),n}}function vu(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;da((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,i=t.type===xa.Widget,o=bs(t),a=(null==(e=t.appearance)?void 0:e.widgetType)===Ia.Tab&&i;if(!o)return _a.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);a&&(_a.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};bi(nu,"popstate",o),bi(nu,"hashchange",o);var a=nu.history.pushState,s=nu.history.replaceState;return nu.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},nu.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},()=>{nu.removeEventListener("popstate",o),nu.removeEventListener("hashchange",o),nu.history.pushState=a,nu.history.replaceState=s}}}),[i,t,r,n])}function fu(e){switch(void 0===e&&(e=ka.Right),e){case ka.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case ka.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case ka.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case ka.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function pu(e){var t,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:y=(()=>{}),properties:g,isSurveyCompleted:b}=e,w=ha(null),C=Number.isInteger(h),I=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(e,t,r,n,i,o,a){var[s,u]=ca(n||0===r||e.type===xa.ExternalSurvey),[l,c]=ca(!1),d=()=>{var t=()=>{o&&i(e),u(!1)};iu.startViewTransition?iu.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},h=t=>{t.detail.surveyId===e.id&&d()};return da((()=>{if(t){if(!n){var i=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{d()}),5e3)}},o=()=>{bs(e)&&(u(!0),nu.dispatchEvent(new Event("PHSurveyShown")),t.capture(Ma.SHOWN,{[Ra.SURVEY_NAME]:e.name,[Ra.SURVEY_ID]:e.id,[Ra.SURVEY_ITERATION]:e.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(bi(nu,"PHSurveyClosed",h),bi(nu,"PHSurveySent",i),r>0){var a=setTimeout(o,r);return()=>{clearTimeout(a),nu.removeEventListener("PHSurveyClosed",h),nu.removeEventListener("PHSurveySent",i)}}return o(),()=>{nu.removeEventListener("PHSurveyClosed",h),nu.removeEventListener("PHSurveySent",i)}}}else _a.error("usePopupVisibility hook called without a PostHog instance.")}),[]),vu({survey:e,removeSurveyFromFocus:i,setSurveyVisible:u,isPreviewMode:n}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:u,hidePopupWithViewTransition:d}}(u,c,I,C,v,f,w),A=k||h===u.questions.length||!0===b,T=va((()=>{var e=Is(u);return{isPreviewMode:C,previewPageIndex:h,onPopupSurveyDismissed:()=>{ls(u,c,C),m()},isPopup:f||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Ya(),onPreviewSubmit:p,posthog:c,properties:g}}),[C,h,f,c,u,m,p,g]);return S?Ns(ps.Provider,{value:T,children:Ns("div",{className:"ph-survey",style:r({},As(u.type,null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:w,children:A?Ns(Hs,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(a=u.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||es,onClose:()=>{x(),y()}}):Ns(mu,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function mu(e){var t,{survey:n,forceDisableHtml:i,posthog:o}=e,[a,s]=ca((()=>{var e=Is(n);return null!=e&&e.responses&&_a.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:v,properties:f}=fa(ps),[p,m]=ca((()=>{var e=Is(n);return u||(null==e?void 0:e.lastQuestionIndex)||0})),y=va((()=>vs(n)),[n]);da((()=>{v&&!Xr(u)&&m(u)}),[u,v]);var g=y.at(p);return g?Ns("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=n.appearance)?void 0:t.hideCancelButton)&&Ns(js,{onClick:()=>{l()}}),Ns("div",{className:"survey-box",children:gu({question:g,forceDisableHtml:i,displayQuestionIndex:p,appearance:n.appearance||es,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:i,questionId:u}=e;if(o)if(u){var l=Qa(u),c=r({},a,{[l]:t});s(c);var d=ru(n,i,t),v=d===Ta.End;v||(m(d),Cs(n,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(n.enable_partial_responses||v)&&as({responses:c,survey:n,surveySubmissionId:h,isSurveyCompleted:v,posthog:o,properties:f})}else _a.error("onNextButtonClick called without a questionId.");else _a.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:p,questionId:g.id}),onPreviewSubmit:d,initialValue:g.id?a[Qa(g.id)]:void 0})})]}):null}function yu(e){var t,r,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,readOnly:d}=e,[h,v]=ca(!0),[f,p]=ca(!1),[m,y]=ca({}),g=()=>{p(!f)};if(da((()=>{var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(_a.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),g())};return bi(nu,ou,t),()=>{nu.removeEventListener(ou,t)}}}else _a.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(n=u.appearance)?void 0:n.borderColor]),vu({survey:u,setSurveyVisible:v}),!h)return null;var b=()=>{u.schedule!==Na.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Ns(Ro,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&Ns("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===ka.Top?"widget-tab-top":""),onClick:g,disabled:d,style:fu(null==(a=u.appearance)?void 0:a.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),f&&Ns(pu,{posthog:c,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var gu=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l={forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{s(e)},onSubmit:e=>{a(e)},initialValue:u,displayQuestionIndex:i};switch(t.type){case Aa.Open:return No(Gs,r({},l,{question:t,key:t.id}));case Aa.Link:return No(Ws,r({},l,{question:t,key:t.id}));case Aa.Rating:return No(zs,r({},l,{question:t,key:t.id}));case Aa.SingleChoice:case Aa.MultipleChoice:return No(Us,r({},l,{question:t,key:t.id}));default:return _a.error("Unsupported question type: "+t.type),null}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.generateSurveys=hu,ui.extendPostHogWithSurveys=hu;class bu{emit(e){}}var wu=new bu;var Cu=new class{getLogger(e,t,r){return new bu}};class Iu{constructor(e,t,r,n){this.ne=e,this.name=t,this.version=r,this.options=n}emit(e){this.ie().emit(e)}ie(){if(this.oe)return this.oe;var e=this.ne.ae(this.name,this.version,this.options);return e?(this.oe=e,this.oe):wu}}class Su{getLogger(e,t,r){var n;return null!==(n=this.ae(e,t,r))&&void 0!==n?n:new Iu(this,e,t,r)}se(){var e;return null!==(e=this.oe)&&void 0!==e?e:Cu}ue(e){this.oe=e}ae(e,t,r){var n;return null===(n=this.oe)||void 0===n?void 0:n.getLogger(e,t,r)}}var ku="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},xu=Symbol.for("io.opentelemetry.js.api.logs"),Au=ku;class Tu{constructor(){this.le=new Su}static getInstance(){return this._instance||(this._instance=new Tu),this._instance}setGlobalLoggerProvider(e){return Au[xu]?this.getLoggerProvider():(Au[xu]=(t=1,r=e,n=Cu,e=>e===t?r:n),this.le.ue(e),e);var t,r,n}getLoggerProvider(){var e,t;return null!==(t=null===(e=Au[xu])||void 0===e?void 0:e.call(Au,1))&&void 0!==t?t:this.le}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Au[xu],this.le=new Su}}var Nu=Tu.getInstance();class Mu{constructor(e){this.oe=void 0,this.oe=e}export(e,t){this.oe.export(e,t)}forceFlush(){return this.oe.forceFlush()}shutdown(){return this.oe.shutdown()}}class Ru extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function _u(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Eu{constructor(e){this.ce=void 0,this.de=[],this.ce=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.de.push(e);var t=()=>{var t=this.de.indexOf(e);this.de.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this.de.length>=this.ce}awaitAll(){var e=this;return t((function*(){yield Promise.all(e.de)}))()}}function Fu(e){return new Eu(e.concurrencyLimit)}var Ou="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Lu="1.9.0",Bu=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Zu=function(e){var t=new Set([e]),r=new Set,n=e.match(Bu);if(!n)return function(){return!1};var i=+n[1],o=+n[2],a=+n[3];if(null!=n[4])return function(t){return t===e};function s(e){return r.add(e),!1}function u(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(Bu);if(!n)return s(e);var l=+n[1],c=+n[2],d=+n[3];return null!=n[4]||i!==l?s(e):0===i?o===c&&a<=d?u(e):s(e):o<=c?u(e):s(e)}}(Lu),Pu=Lu.split(".")[0],Du=Symbol.for("opentelemetry.js.api."+Pu),qu=Ou;function ju(e,t,r,n){var i;void 0===n&&(n=!1);var o=qu[Du]=null!==(i=qu[Du])&&void 0!==i?i:{version:Lu};if(!n&&o[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(o.version!==Lu){a=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+Lu);return r.error(a.stack||a.message),!1}return o[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Lu+"."),!0}function Vu(e){var t,r,n=null===(t=qu[Du])||void 0===t?void 0:t.version;if(n&&Zu(n))return null===(r=qu[Du])||void 0===r?void 0:r[e]}function Hu(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Lu+".");var r=qu[Du];r&&delete r[e]}var Yu,Gu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Wu=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},zu=function(){function e(e){this.he=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("debug",this.he,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("error",this.he,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("info",this.he,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("warn",this.he,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("verbose",this.he,e)},e}();function Xu(e,t,r){var n=Vu("diag");if(n)return r.unshift(t),n[e].apply(n,Wu([],Gu(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Yu||(Yu={}));var Uu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Ku=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Ju=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=Vu("diag");if(n)return n[e].apply(n,Ku([],Uu(t),!1))}}var t=this;t.setLogger=function(e,r){var n,i,o;if(void 0===r&&(r={logLevel:Yu.INFO}),e===t){var a=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(n=a.stack)&&void 0!==n?n:a.message),!1}"number"==typeof r&&(r={logLevel:r});var s=Vu("diag"),u=function(e,t){function r(r,n){var i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<Yu.NONE?e=Yu.NONE:e>Yu.ALL&&(e=Yu.ALL),t=t||{},{error:r("error",Yu.ERROR),warn:r("warn",Yu.WARN),info:r("info",Yu.INFO),debug:r("debug",Yu.DEBUG),verbose:r("verbose",Yu.VERBOSE)}}(null!==(i=r.logLevel)&&void 0!==i?i:Yu.INFO,e);if(s&&!r.suppressOverrideMessage){var l=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";s.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return ju("diag",u,t,!0)},t.disable=function(){Hu("diag",t)},t.createComponentLogger=function(e){return new zu(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Qu(e){return Symbol.for(e)}var $u,el=function e(t){var r=this;r.ve=t?new Map(t):new Map,r.getValue=function(e){return r.ve.get(e)},r.setValue=function(t,n){var i=new e(r.ve);return i.ve.set(t,n),i},r.deleteValue=function(t){var n=new e(r.ve);return n.ve.delete(t),n}},tl=new el,rl=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},nl=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},il=function(){function e(){}return e.prototype.active=function(){return tl},e.prototype.with=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return t.call.apply(t,nl([r],rl(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),ol=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},al=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},sl="context",ul=new il,ll=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return ju(sl,e,Ju.instance())},e.prototype.active=function(){return this.fe().active()},e.prototype.with=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return(n=this.fe()).with.apply(n,al([e,t,r],ol(i),!1))},e.prototype.bind=function(e,t){return this.fe().bind(e,t)},e.prototype.fe=function(){return Vu(sl)||ul},e.prototype.disable=function(){this.fe().disable(),Hu(sl,Ju.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}($u||($u={}));var cl="0000000000000000",dl="00000000000000000000000000000000",hl={traceId:dl,spanId:cl,traceFlags:$u.NONE},vl=function(){function e(e){void 0===e&&(e=hl),this.pe=e}return e.prototype.spanContext=function(){return this.pe},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),fl=Qu("OpenTelemetry Context Key SPAN");function pl(e){return e.getValue(fl)||void 0}function ml(){return pl(ll.getInstance().active())}function yl(e,t){return e.setValue(fl,t)}function gl(e){return e.deleteValue(fl)}function bl(e,t){return yl(e,new vl(t))}function wl(e){var t;return null===(t=pl(e))||void 0===t?void 0:t.spanContext()}var Cl=/^([0-9a-f]{32})$/i,Il=/^[0-9a-f]{16}$/i;function Sl(e){return r=e.traceId,Cl.test(r)&&r!==dl&&(t=e.spanId,Il.test(t)&&t!==cl);var t,r}function kl(e){return new vl(e)}var xl=ll.getInstance(),Al=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=xl.active()),Boolean(null==t?void 0:t.root))return new vl;var n,i=r&&wl(r);return"object"==typeof(n=i)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&Sl(i)?new vl(i):new vl},e.prototype.startActiveSpan=function(e,t,r,n){var i,o,a;if(!(arguments.length<2)){2===arguments.length?a=t:3===arguments.length?(i=t,a=r):(i=t,o=r,a=n);var s=null!=o?o:xl.active(),u=this.startSpan(e,i,s),l=yl(s,u);return xl.with(l,a,void 0,u)}},e}();var Tl=new Al,Nl=function(){function e(e,t,r,n){this.ne=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this.me().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){var i=this.me();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype.me=function(){if(this.oe)return this.oe;var e=this.ne.getDelegateTracer(this.name,this.version,this.options);return e?(this.oe=e,this.oe):Tl},e}(),Ml=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Al},e}()),Rl=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!==(n=this.getDelegateTracer(e,t,r))&&void 0!==n?n:new Nl(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this.oe)&&void 0!==e?e:Ml},e.prototype.setDelegate=function(e){this.oe=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null===(n=this.oe)||void 0===n?void 0:n.getTracer(e,t,r)},e}(),_l=ll.getInstance(),El=Ju.instance(),Fl="trace",Ol=function(){function e(){this.ye=new Rl,this.wrapSpanContext=kl,this.isSpanContextValid=Sl,this.deleteSpan=gl,this.getSpan=pl,this.getActiveSpan=ml,this.getSpanContext=wl,this.setSpan=yl,this.setSpanContext=bl}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=ju(Fl,this.ye,Ju.instance());return t&&this.ye.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Vu(Fl)||this.ye},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Hu(Fl,Ju.instance()),this.ye=new Rl},e}().getInstance(),Ll=Qu("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Bl(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var n=typeof r;if(n!==t){if(!t){if(Zl(n)){t=n;continue}return!1}return!1}}return!0}(e):Zl(typeof e))}function Zl(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}var Pl=e=>{El.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var n=r[e];n&&(t[e]=String(n))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))};function Dl(e){try{Pl(e)}catch(e){}}var ql,jl=performance,Vl="telemetry.sdk.language",Hl="telemetry.sdk.name",Yl="telemetry.sdk.version",Gl={[Hl]:"opentelemetry","process.runtime.name":"browser",[Vl]:"webjs",[Yl]:"2.2.0"},Wl=Math.pow(10,6),zl=Math.pow(10,9);function Xl(e){var t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Wl)]}function Ul(){var e=jl.timeOrigin;if("number"!=typeof e){var t=jl;e=t.timing&&t.timing.fetchStart}return e}function Kl(e){return function(e,t){var r=[e[0]+t[0],e[1]+t[1]];r[1]>=zl&&(r[1]-=zl,r[0]+=1);return r}(Xl(Ul()),Xl("number"==typeof e?e:jl.now()))}function Jl(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Ul()?Kl(e):Xl(e);if(e instanceof Date)return Xl(e.getTime());throw TypeError("Invalid input type");var t}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(ql||(ql={}));var Ql="[object Object]",$l="[object Null]",ec="[object Undefined]",tc=Function.prototype.toString,rc=tc.call(Object),nc=Object.getPrototypeOf,ic=Object.prototype,oc=ic.hasOwnProperty,ac=Symbol?Symbol.toStringTag:void 0,sc=ic.toString;function uc(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){if(null==e)return void 0===e?ec:$l;return ac&&ac in Object(e)?function(e){var t=oc.call(e,ac),r=e[ac],n=!1;try{e[ac]=void 0,n=!0}catch(e){}var i=sc.call(e);n&&(t?e[ac]=r:delete e[ac]);return i}(e):function(e){return sc.call(e)}(e)}(e)!==Ql)return!1;var t=nc(e);if(null===t)return!0;var r=oc.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&tc.call(r)===rc}var lc=20;function cc(e){return vc(e)?e.slice():e}function dc(e,t,r,n){var i;if(void 0===r&&(r=0),!(r>lc)){if(r++,mc(e)||mc(t)||fc(t))i=cc(t);else if(vc(e)){if(i=e.slice(),vc(t))for(var o=0,a=t.length;o<a;o++)i.push(cc(t[o]));else if(pc(t))for(var s=Object.keys(t),u=0,l=s.length;u<l;u++){var c=s[u];i[c]=cc(t[c])}}else if(pc(e))if(pc(t)){if(!function(e,t){if(!uc(e)||!uc(t))return!1;return!0}(e,t))return t;i=Object.assign({},e);for(var d=Object.keys(t),h=0,v=d.length;h<v;h++){var f=d[h],p=t[f];if(mc(p))void 0===p?delete i[f]:i[f]=p;else{var m=i[f],y=p;if(hc(e,f,n)||hc(t,f,n))delete i[f];else{if(pc(m)&&pc(y)){var g=n.get(m)||[],b=n.get(y)||[];g.push({obj:e,key:f}),b.push({obj:t,key:f}),n.set(m,g),n.set(y,b)}i[f]=dc(i[f],p,r,n)}}}}else i=t;return i}}function hc(e,t,r){for(var n=r.get(e[t])||[],i=0,o=n.length;i<o;i++){var a=n[i];if(a.key===t&&a.obj===e)return!0}return!1}function vc(e){return Array.isArray(e)}function fc(e){return"function"==typeof e}function pc(e){return!mc(e)&&!vc(e)&&!fc(e)&&"object"==typeof e}function mc(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class yc extends Error{constructor(e){super(e),Object.setPrototypeOf(this,yc.prototype)}}function gc(e,t){var r,n=new Promise((function(e,n){r=setTimeout((function(){n(new yc("Operation timed out."))}),t)}));return Promise.race([e,n]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class bc{constructor(){this.ge=void 0,this.be=void 0,this.we=void 0,this.ge=new Promise(((e,t)=>{this.be=e,this.we=t}))}get promise(){return this.ge}resolve(e){this.be(e)}reject(e){this.we(e)}}class wc{constructor(e,t){this.Ce=void 0,this.Ie=void 0,this.Se=!1,this.ke=new bc,this.Ce=e,this.Ie=t}get isCalled(){return this.Se}get promise(){return this.ke.promise}call(){if(!this.Se){this.Se=!0;try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Promise.resolve(this.Ce.call(this.Ie,...t)).then((e=>this.ke.resolve(e)),(e=>this.ke.reject(e)))}catch(e){this.ke.reject(e)}}return this.ke.promise}}var Cc={xe:function(e,t){return new Promise((r=>{_l.with(function(e){return e.setValue(Ll,!0)}(_l.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))}};function Ic(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&El.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Sc{constructor(e,t,r,n,i){this.Ae=void 0,this.Te=void 0,this.Ne=void 0,this.Me=void 0,this.Re=void 0,this._e=void 0,this.Ae=e,this.Te=t,this.Ne=r,this.Me=n,this.Re=i,this._e=El.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._e.debug("items to be sent",e),this.Me.hasReachedLimit())t({code:ql.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Te.serializeRequest(e);null!=r?this.Me.pushPromise(this.Ae.send(r,this.Re).then((e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:ql.FAILED,error:e.error}):"retryable"===e.status?t({code:ql.FAILED,error:new Ru("Export failed with retryable status")}):t({code:ql.FAILED,error:new Ru("Export failed with unknown error")});else{if(null!=e.data)try{this.Ne.handleResponse(this.Te.deserializeResponse(e.data))}catch(t){this._e.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:ql.SUCCESS})}}),(e=>t({code:ql.FAILED,error:e})))):t({code:ql.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Me.awaitAll()}shutdown(){var e=this;return t((function*(){e._e.debug("shutdown started"),yield e.forceFlush(),e.Ae.shutdown()}))()}}function kc(e,t,r){return n={transport:r,serializer:t,promiseHandler:Fu(e)},i={timeout:e.timeoutMillis},new Sc(n.transport,n.serializer,Ic(),n.promiseHandler,i.timeout);var n,i}function xc(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Ac(e){for(var t=new Uint8Array(e.length/2),r=0,n=0;n<e.length;n+=2){var i=xc(e.charCodeAt(n)),o=xc(e.charCodeAt(n+1));t[r++]=i<<4|o}return t}function Tc(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Nc(e){var t,r=Tc(e);return t=r,{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var Mc="undefined"!=typeof BigInt?function(e){return Tc(e).toString()}:function(e){return e[0]*zl+e[1]};function Rc(e){return e}function _c(e){if(void 0!==e)return Ac(e)}var Ec={encodeHrTime:Nc,encodeSpanContext:Ac,encodeOptionalSpanContext:_c};function Fc(e,t){return{key:e,value:Oc(t)}}function Oc(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Oc)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return Fc(t,r)}))}}:{}}function Lc(e,t){var r=function(e){var t,r;if(void 0===e)return Ec;var n=null===(t=e.useLongBits)||void 0===t||t,i=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:n?Nc:Mc,encodeSpanContext:i?Rc:Ac,encodeOptionalSpanContext:i?Rc:_c}}(t);return{resourceLogs:Bc(e,r)}}function Bc(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:a=""}}=r,s=t.get(n);s||(s=new Map,t.set(n,s));var u=i+"@"+o+":"+a,l=s.get(u);l||(l=[],s.set(u,l)),l.push(r)}return t}(e);return Array.from(r,(e=>{var[r,n]=e,i=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>Fc(e,t[e])))),droppedAttributesCount:0},n=e.schemaUrl;return n&&""!==n&&(r.schemaUrl=n),r}(r);return{resource:i,scopeLogs:Array.from(n,(e=>{var r,[,n]=e;return{scope:(r=n[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:n.map((e=>function(e,t){var r,n,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Oc(e.body),eventName:e.eventName,attributes:Zc(e.attributes),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.traceId),spanId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.spanId)}}(e,t))),schemaUrl:n[0].instrumentationScope.schemaUrl}})),schemaUrl:i.schemaUrl}}))}function Zc(e){return Object.keys(e).map((t=>Fc(t,e[t])))}var Pc=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Dc{static FromAttributeList(e,t){var r=new Dc({},t);return r.Ee=jc(e),r.Fe=e.filter((e=>{var[t,r]=e;return Pc(r)})).length>0,r}constructor(e,t){var r;this.Ee=void 0,this.Fe=!1,this.Oe=void 0,this.Le=void 0;var n=null!==(r=e.attributes)&&void 0!==r?r:{};this.Ee=Object.entries(n).map((e=>{var[t,r]=e;return Pc(r)&&(this.Fe=!0),[t,r]})),this.Ee=jc(this.Ee),this.Oe=function(e){if("string"==typeof e||void 0===e)return e;return void El.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this.Fe}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;t<e.Ee.length;t++){var[r,n]=e.Ee[t];e.Ee[t]=[r,Pc(n)?yield n:n]}e.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&El.error("Accessing resource attributes before async attributes settled"),this.Le)return this.Le;var e={};for(var[t,r]of this.Ee){var n;if(Pc(r))El.debug("Unsettled resource attribute "+t+" skipped");else if(null!=r)null!==(n=e[t])&&void 0!==n||(e[t]=r)}return this.Fe||(this.Le=e),e}getRawAttributes(){return this.Ee}get schemaUrl(){return this.Oe}merge(e){if(null==e)return this;var t=function(e,t){var r=null==e?void 0:e.schemaUrl,n=null==t?void 0:t.schemaUrl,i=void 0===r||""===r,o=void 0===n||""===n;if(i)return n;if(o)return r;if(r===n)return r;return void El.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}(this,e),r=t?{schemaUrl:t}:void 0;return Dc.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}}function qc(e,t){return Dc.FromAttributeList(Object.entries(e),t)}function jc(e){return e.map((e=>{var[t,r]=e;return Pc(r)?[t,r.catch((e=>{El.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Vc={serializeRequest:e=>{var t=Lc(e,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Hc{constructor(e){this.Ae=void 0,this.Ae=e}retry(e,t,r){return new Promise(((n,i)=>{setTimeout((()=>{this.Ae.send(e,t).then(n,i)}),r)}))}send(e,r){var n=this;return t((function*(){for(var t=Date.now()+r,i=yield n.Ae.send(e,r),o=5,a=1e3;"retryable"===i.status&&o>0;){var s;o--;var u=Math.max(Math.min(a,5e3)+(.4*Math.random()-.2),0);a*=1.5;var l=null!==(s=i.retryInMillis)&&void 0!==s?s:u,c=t-Date.now();if(l>c)return i;i=yield n.retry(e,c,l)}return i}))()}shutdown(){return this.Ae.shutdown()}}function Yc(e){return new Hc(e.transport)}function Gc(e){return[429,502,503,504].includes(e)}function Wc(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}class zc{constructor(e){this.Be=void 0,this.Be=e}send(e,r){var n=this;return t((function*(){var t=yield n.Be.headers(),i=yield new Promise((i=>{var o=new XMLHttpRequest;o.timeout=r,o.open("POST",n.Be.url),Object.entries(t).forEach((e=>{var[t,r]=e;o.setRequestHeader(t,r)})),o.ontimeout=e=>{i({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(El.debug("XHR success"),i({status:"success"})):o.status&&Gc(o.status)?i({status:"retryable",retryInMillis:Wc(o.getResponseHeader("Retry-After"))}):0!==o.status&&i({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{i({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{i({status:"failure",error:new Error("XHR request errored")})},o.send(e)}));return i}))()}shutdown(){}}class Xc{constructor(e){this.Ze=void 0,this.Ze=e}send(e){var r=this;return t((function*(){var t=(yield r.Ze.headers())["Content-Type"];return new Promise((n=>{navigator.sendBeacon(r.Ze.url,new Blob([e],{type:t}))?(El.debug("SendBeacon success"),n({status:"success"})):n({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Uc{constructor(e){this.Be=void 0,this.Be=e}send(e,r){var n=this;return t((function*(){var t=new AbortController,i=setTimeout((()=>t.abort()),r);try{var o,a=!!globalThis.location,s=new URL(n.Be.url),u=yield fetch(s.href,{method:"POST",headers:yield n.Be.headers(),body:e,signal:t.signal,keepalive:a,mode:a?(null==(o=globalThis.location)?void 0:o.origin)===s.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(El.debug("response success"),{status:"success"}):Gc(u.status)?{status:"retryable",retryInMillis:Wc(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(i)}}))()}shutdown(){}}function Kc(e,t){return kc(e,t,Yc({transport:(r=e,new zc(r))}));var r}function Jc(e,t){return kc(e,t,Yc({transport:(r=e,new Uc(r))}));var r}function Qc(e,t){return kc(e,t,Yc({transport:(r={url:e.url,headers:e.headers},new Xc(r))}));var r}function $c(e,n,i){return t((function*(){var t=r({},yield i()),o={};return null!=n&&Object.assign(o,yield n()),null!=e&&Object.assign(o,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,n]=e;void 0!==n?t[r]=String(n):El.warn('Header "'+r+'" has invalid value ('+n+") and will be ignored")})),t}(yield e())),Object.assign(o,t)}))}function ed(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function td(e,t,n){var i,o;return r({},function(e,t,r){var n,i,o,a,s,u;return{timeoutMillis:_u(null!==(n=null!==(i=e.timeoutMillis)&&void 0!==i?i:t.timeoutMillis)&&void 0!==n?n:r.timeoutMillis),concurrencyLimit:null!==(o=null!==(a=e.concurrencyLimit)&&void 0!==a?a:t.concurrencyLimit)&&void 0!==o?o:r.concurrencyLimit,compression:null!==(s=null!==(u=e.compression)&&void 0!==u?u:t.compression)&&void 0!==s?s:r.compression}}(e,t,n),{headers:$c(e.headers,t.headers,n.headers),url:null!==(i=null!==(o=ed(e.url))&&void 0!==o?o:t.url)&&void 0!==i?i:n.url})}function rd(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function nd(e,n,i){return td({url:e.url,timeoutMillis:e.timeoutMillis,headers:rd(e),concurrencyLimit:e.concurrencyLimit},{},function(e,n){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(i=t((function*(){return e})),function(){return i.apply(this,arguments)}),url:"http://localhost:4318/"+n});var i}(i,n))}function id(e,t,r,n){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Jc:Kc:Qc)(nd(e,r,n),t)}class od extends Mu{constructor(e){void 0===e&&(e={}),super(id(e,Vc,"v1/logs",{"Content-Type":"application/json"}))}}class ad{set severityText(e){this.Pe()||(this.De=e)}get severityText(){return this.De}set severityNumber(e){this.Pe()||(this.qe=e)}get severityNumber(){return this.qe}set body(e){this.Pe()||(this.je=e)}get body(){return this.je}get eventName(){return this.Ve}set eventName(e){this.Pe()||(this.Ve=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.De=void 0,this.qe=void 0,this.je=void 0,this.Ve=void 0,this.totalAttributesCount=0,this.He=!1,this.Ye=void 0;var{timestamp:n,observedTimestamp:i,eventName:o,severityNumber:a,severityText:s,body:u,attributes:l={},context:c}=r,d=Date.now();if(this.hrTime=Jl(null!=n?n:d),this.hrTimeObserved=Jl(null!=i?i:d),c){var h=Ol.getSpanContext(c);h&&Sl(h)&&(this.spanContext=h)}this.severityNumber=a,this.severityText=s,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this.Ye=e.logRecordLimits,this.Ve=o,this.setAttributes(l)}setAttribute(e,t){return this.Pe()||null===t?this:0===e.length?(El.warn("Invalid attribute key: "+e),this):Bl(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.Ye.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(1===this.droppedAttributesCount&&El.warn("Dropping extra attributes."),this):(Bl(t)?this.attributes[e]=this.Ge(t):this.attributes[e]=t,this)):(El.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}We(){this.He=!0}Ge(e){var t=this.Ye.attributeValueLengthLimit;return t<=0?(El.warn("Attribute value limit must be positive, got "+t),e):"string"==typeof e?this.ze(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this.ze(e,t):e)):e}ze(e,t){return e.length<=t?e:e.substring(0,t)}Pe(){return this.He&&El.warn("Can not execute the operation on emitted log record"),this.He}}class sd{constructor(e,t){this.instrumentationScope=void 0,this.Xe=void 0,this.instrumentationScope=e,this.Xe=t}emit(e){var t=e.context||_l.active(),n=new ad(this.Xe,this.instrumentationScope,r({context:t},e));this.Xe.activeProcessor.onEmit(n,t),n.We()}}class ud{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class ld{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>gc(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class cd{constructor(e,t,r,n){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=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=n,n.length>0?(this.registeredLogRecordProcessors=n,this.activeProcessor=new ld(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ud}}class dd{constructor(e){var t,r,n;void 0===e&&(e={}),this.Ue=void 0,this.Xe=void 0;var i,o,a,s,u,l,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.shift(),i=new WeakMap;t.length>0;)n=dc(n,t.shift(),0,i);return n}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:qc({"service.name":"unknown_service",[Vl]:Gl[Vl],[Hl]:Gl[Hl],[Yl]:Gl[Yl]});this.Xe=new cd(h,d.forceFlushTimeoutMillis,(i=d.logRecordLimits,{attributeCountLimit:null!==(o=null!==(a=null!==(s=i.attributeCountLimit)&&void 0!==s?s:void 0)&&void 0!==a?a:void 0)&&void 0!==o?o:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(c=i.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(n=e)?void 0:n.processors)&&void 0!==r?r:[]),this.Ue=new wc(this.Ke,this)}getLogger(e,t,r){if(this.Ue.isCalled)return El.warn("A shutdown LoggerProvider cannot provide a Logger"),wu;e||El.warn("Logger requested without instrumentation scope name.");var n=e||"unknown",i=n+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Xe.loggers.has(i)||this.Xe.loggers.set(i,new sd({name:n,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this.Xe)),this.Xe.loggers.get(i)}forceFlush(){return this.Ue.isCalled?(El.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Ue.promise):this.Xe.activeProcessor.forceFlush()}shutdown(){return this.Ue.isCalled?(El.warn("shutdown may only be called once per LoggerProvider"),this.Ue.promise):this.Ue.call()}Ke(){return this.Xe.activeProcessor.shutdown()}}class hd{constructor(e,t){var r,n,i,o,a,s,u,l;this.Je=void 0,this.Qe=void 0,this.$e=void 0,this.et=void 0,this.tt=void 0,this.rt=!1,this.nt=[],this.it=void 0,this.Ue=void 0,this.Je=e,this.Qe=null!==(r=null!==(n=null==t?void 0:t.maxExportBatchSize)&&void 0!==n?n:void 0)&&void 0!==r?r:512,this.$e=null!==(i=null!==(o=null==t?void 0:t.maxQueueSize)&&void 0!==o?o:void 0)&&void 0!==i?i:2048,this.et=null!==(a=null!==(s=null==t?void 0:t.scheduledDelayMillis)&&void 0!==s?s:void 0)&&void 0!==a?a:5e3,this.tt=null!==(u=null!==(l=null==t?void 0:t.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.Ue=new wc(this.Ke,this),this.Qe>this.$e&&(El.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.Qe=this.$e)}onEmit(e){this.Ue.isCalled||this.ot(e)}forceFlush(){return this.Ue.isCalled?this.Ue.promise:this.st()}shutdown(){return this.Ue.call()}Ke(){var e=this;return t((function*(){e.onShutdown(),yield e.st(),yield e.Je.shutdown()}))()}ot(e){this.nt.length>=this.$e||(this.nt.push(e),this.ut())}st(){return new Promise(((e,t)=>{for(var r=[],n=Math.ceil(this.nt.length/this.Qe),i=0;i<n;i++)r.push(this.ct());Promise.all(r).then((()=>{e()})).catch(t)}))}ct(){return this.dt(),0===this.nt.length?Promise.resolve():new Promise(((e,t)=>{gc(this.xe(this.nt.splice(0,this.Qe)),this.tt).then((()=>e())).catch(t)}))}ut(){if(!this.rt){var e=()=>{this.rt=!0,this.ct().then((()=>{this.rt=!1,this.nt.length>0&&(this.dt(),this.ut())})).catch((e=>{this.rt=!1,Dl(e)}))};if(this.nt.length>=this.Qe)return e();void 0===this.it&&(this.it=setTimeout((()=>e()),this.et),"number"!=typeof this.it&&this.it.unref())}}dt(){void 0!==this.it&&(clearTimeout(this.it),this.it=void 0)}xe(e){var t=()=>Cc.xe(this.Je,e).then((e=>{var t;e.code!==ql.SUCCESS&&Dl(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Dl),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Dl)}}class vd extends hd{constructor(e,t){super(e,t),this.ht=void 0,this.vt=void 0,this.ft(t)}onShutdown(){"undefined"!=typeof document&&(this.ht&&document.removeEventListener("visibilitychange",this.ht),this.vt&&document.removeEventListener("pagehide",this.vt))}ft(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.ht=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.vt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.ht),document.addEventListener("pagehide",this.vt))}}var fd=1e4,pd=function(e,t,r,n,i){for(var o in void 0===t&&(t=""),void 0===r&&(r={}),void 0===n&&(n=50),void 0===i&&(i=fd),e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=e[o],s=t?t+"."+o:o;if(zr(a))pd(a,s,r,n,i);else{if(n-=1,i-=String(a).length,i-=s.length,n<=0||i<=0)return void(r.attributes_truncated=!0);r[s]=a}}return r},md={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.logs={initializeLogs:e=>{(e=>{var t={"service.name":"posthog-browser-logs",host:ui.location.host};if(e.sessionManager){var{sessionId:n,windowId:i}=e.sessionManager.checkAndGetSessionAndWindowId(!0);t=r({},t,{"session.id":n,"window.id":i})}Nu.setGlobalLoggerProvider(new dd({resource:qc(t),processors:[new vd(new od({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Nu.getLogger("console"),n={};if(e.sessionManager){var{sessionStartTimestamp:i,lastActivityTimestamp:o}=e.sessionManager.checkAndGetSessionAndWindowId(!0);n={sessionStartTimestamp:i.toString(),lastActivityTimestamp:o.toString()}}var a=function(i){var o=(e,t)=>t instanceof Error?r({},t,{name:t.name,message:t.message,stack:t.stack}):t,a=ui.console[i];ui.console[i]=(a=>function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(u.length>0){var c=u.map((e=>JSON.stringify(e,o))).join(" ");c.length>fd&&(c=c.slice(0,fd)+"...",n.body_truncated="true"),t.emit({severityText:md[i],body:c,attributes:r({"log.source":"console."+i,distinct_id:e.get_distinct_id(),"location.href":ui.location.href},n,zr(u[0])?pd(u[0]):{})}),a.apply(ui.console,u)}})(a)};for(var s of["debug","log","warn","error","info"])a(s)}},vi("[Error tracking]");var yd=vi("[ExceptionAutocapture]"),gd=new _n([new Gn,new ti,new zn,new Wn,new $n,new Qn,new Un,new ei],Yn()),bd={wrapOnError:e=>{var t=ri;t||yd.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=i[4],s=i[0],u=gd.buildFromUnknown(a||s,{mechanism:{handled:!1}});return e(u),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=ri;t||yd.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(n){var i,o=gd.buildFromUnknown(n,{mechanism:{handled:!1}});return e(o),null!==(i=null==r?void 0:r.apply(t,[n]))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||yd.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=n.join(" "),a=n.find((e=>e instanceof Error)),s=gd.buildFromUnknown(a||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return e(s),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.errorWrappingFunctions=bd,ui.posthogErrorWrappingFunctions=bd;var wd=(e,t,r,n)=>{var i;try{i=new URL(n.url).hostname}catch(e){return}if(!Yr(e)||e.includes(i)){if(r){var{sessionId:o,windowId:a}=r.checkAndGetSessionAndWindowId(!0);n.headers.set("X-POSTHOG-SESSION-ID",o),n.headers.set("X-POSTHOG-WINDOW-ID",a)}"$posthog_cookieless"!==t&&n.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{};var Cd={_patchFetch:(e,r,n)=>Ci(ri,"fetch",(i=>function(){var o=t((function*(t,o){var a=new Request(t,o);return wd(e,r,n,a),i(a)}));return function(e,t){return o.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ci(ri.XMLHttpRequest.prototype,"open",(n=>function(i,o,a,s,u){void 0===a&&(a=!0);var l=new Request(o);return wd(e,t,r,l),n.call(this,i,l.url,a,s,u)}))};ui.__PosthogExtensions__.tracingHeadersPatchFns=Cd,ui.postHogTracingHeadersPatchFns=Cd;var Id=-1,Sd=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Id=t.timeStamp,e(t))}),!0)},kd=(e,t,r,n)=>{var i,o;return a=>{t.value>=0&&(a||n)&&(((o=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},xd=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Ad=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Td=()=>{var e,t=Ad();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},Nd=function(e,t){void 0===t&&(t=-1);var r=Ad(),n="navigate";return Id>=0?n="back-forward-cache":r&&(document.prerendering||Td()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Md=new WeakMap;function Rd(e,t){return Md.get(e)||Md.set(e,new t),Md.get(e)}let _d=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var Ed,Fd=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},Od=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Ld=-1,Bd=new Set,Zd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Pd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Bd)t();isFinite(Ld)||(Ld="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Pd,!0))}},Dd=()=>{if(Ld<0){var e,t=Td(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;Ld=null!=r?r:Zd(),addEventListener("visibilitychange",Pd,!0),addEventListener("prerenderingchange",Pd,!0),Sd((()=>{setTimeout((()=>{Ld=Zd()}))}))}return{get firstHiddenTime(){return Ld},onHidden(e){Bd.add(e)}}},qd=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},jd=[1800,3e3],Vd=function(e,t){void 0===t&&(t={}),qd((()=>{var r,n=Dd(),i=Nd("FCP"),o=Fd("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Td(),0),i.entries.push(t),r(!0)))}));o&&(r=kd(e,i,jd,t.reportAllChanges),Sd((n=>{i=Nd("FCP"),r=kd(e,i,jd,t.reportAllChanges),xd((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Hd=[.1,.25],Yd=function(e,t){void 0===t&&(t={});var r=Dd();Vd(Od((()=>{var n,i=Nd("CLS",0),o=Rd(t,_d),a=e=>{for(var t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=Fd("layout-shift",a);s&&(n=kd(e,i,Hd,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Sd((()=>{o.i=0,i=Nd("CLS",0),n=kd(e,i,Hd,t.reportAllChanges),xd((()=>n()))})),setTimeout(n))})))},Gd=0,Wd=1/0,zd=0,Xd=e=>{for(var t of e)t.interactionId&&(Wd=Math.min(Wd,t.interactionId),zd=Math.max(zd,t.interactionId),Gd=zd?(zd-Wd)/7+1:0)},Ud=()=>{var e;return Ed?Gd:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Kd=0;let Jd=class{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Kd=Ud(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((Ud()-Kd)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>r.P){var i;if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var o=this.u.splice(10);for(var a of o)this.l.delete(a.id)}null==(i=this.p)||i.call(this,n)}}}};var Qd=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Od(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},$d=[200,500],eh=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Dd();qd((()=>{var n;"interactionCount"in performance||Ed||(Ed=Fd("event",Xd,{type:"event",buffered:!0,durationThreshold:0}));var i,o=Nd("INP"),a=Rd(t,Jd),s=e=>{Qd((()=>{for(var t of e)a.h(t);var r=a.L();r&&r.P!==o.value&&(o.value=r.P,o.entries=r.entries,i())}))},u=Fd("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=kd(e,o,$d,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),Sd((()=>{a.v(),o=Nd("INP"),i=kd(e,o,$d,t.reportAllChanges)})))}))}};let th=class{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var rh=[2500,4e3],nh=function(e,t){void 0===t&&(t={}),qd((()=>{var r,n=Dd(),i=Nd("LCP"),o=Rd(t,th),a=e=>{for(var a of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(a),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-Td(),0),i.entries=[a],r())},s=Fd("largest-contentful-paint",a);if(s){r=kd(e,i,rh,t.reportAllChanges);var u=Od((()=>{a(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Qd(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});Sd((n=>{i=Nd("LCP"),r=kd(e,i,rh,t.reportAllChanges),xd((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))};class ih{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],n=this.i.at(-1);this.o&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}}var oh=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ah=e=>{if("loading"===document.readyState)return"loading";var t=oh();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},sh=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},uh=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,n=e,i=n.id?"#"+n.id:[sh(n),...Array.from(n.classList).sort()].join(".");if(t.length+i.length>99)return t||i;if(t=t?i+">"+t:i,n.id)break;e=n.parentNode}}catch(e){}return t},lh=new WeakMap;function ch(e,t){return lh.get(e)||lh.set(e,new t),lh.get(e)}var dh,hh=-1,vh=()=>hh,fh=e=>{addEventListener("pageshow",(t=>{t.persisted&&(hh=t.timeStamp,e(t))}),!0)},ph=(e,t,r,n)=>{var i,o;return a=>{t.value>=0&&(a||n)&&(((o=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},mh=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},yh=()=>{var e,t=oh();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},gh=function(e,t){void 0===t&&(t=-1);var r=oh(),n="navigate";return vh()>=0?n="back-forward-cache":r&&(document.prerendering||yh()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},bh=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},wh=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Ch=-1,Ih=new Set,Sh=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kh=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Ih)t();isFinite(Ch)||(Ch="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",kh,!0))}},xh=()=>{if(Ch<0){var e,t=yh(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;Ch=null!=r?r:Sh(),addEventListener("visibilitychange",kh,!0),addEventListener("prerenderingchange",kh,!0),fh((()=>{setTimeout((()=>{Ch=Sh()}))}))}return{get firstHiddenTime(){return Ch},onHidden(e){Ih.add(e)}}},Ah=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Th=[1800,3e3],Nh=function(e,t){void 0===t&&(t={}),Ah((()=>{var r,n=xh(),i=gh("FCP"),o=bh("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-yh(),0),i.entries.push(t),r(!0)))}));o&&(r=ph(e,i,Th,t.reportAllChanges),fh((n=>{i=gh("FCP"),r=ph(e,i,Th,t.reportAllChanges),mh((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Mh=[.1,.25],Rh=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],_h=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),ih),n=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var i=Rh(e.sources),o=null==i?void 0:i.node;if(o){var a,s=null!==(a=null==t.generateTarget?void 0:t.generateTarget(o))&&void 0!==a?a:uh(o);n.set(i,s)}}},function(e,t){void 0===t&&(t={});var r=xh();Nh(wh((()=>{var n,i=gh("CLS",0),o=ch(t,ih),a=e=>{for(var t of e)o.u(t);o.o>i.value&&(i.value=o.o,i.entries=o.i,n())},s=bh("layout-shift",a);s&&(n=ph(e,i,Mh,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),fh((()=>{o.o=0,i=gh("CLS",0),n=ph(e,i,Mh,t.reportAllChanges),mh((()=>n()))})),setTimeout(n))})))}((t=>{var r=(e=>{var t={};if(e.entries.length){var r,i=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=i&&null!=(r=i.sources)&&r.length){var o=Rh(i.sources);o&&(t={largestShiftTarget:n.get(o),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:o,largestShiftEntry:i,loadState:ah(i.startTime)})}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)},Eh=function(e,t){void 0===t&&(t={}),Nh((t=>{var r=(e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ah(vh())};if(e.entries.length){var r=oh(),n=e.entries.at(-1);if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:ah(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)},Fh=0,Oh=1/0,Lh=0,Bh=e=>{for(var t of e)t.interactionId&&(Oh=Math.min(Oh,t.interactionId),Lh=Math.max(Lh,t.interactionId),Fh=Lh?(Lh-Oh)/7+1:0)},Zh=()=>{var e;return dh?Fh:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Ph=0;class Dh{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Ph=Zh(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((Zh()-Ph)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),n=this.h.get(e.interactionId);if(n||this.l.length<10||e.duration>r.T){var i;if(n?e.duration>n.T?(n.entries=[e],n.T=e.duration):e.duration===n.T&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],T:e.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var o=this.l.splice(10);for(var a of o)this.h.delete(a.id)}null==(i=this.p)||i.call(this,n)}}}}var qh=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=wh(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},jh=[200,500],Vh=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),Dh),n=[],i=[],o=0,a=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(qh(c),u=!0)},c=()=>{var e=r.l.map((e=>a.get(e.entries[0]))),t=i.length-50;i=i.filter(((r,n)=>n>=t||e.includes(r)));var s=new Set;for(var l of i){var c=d(l.startTime,l.processingEnd);for(var h of c)s.add(h)}var v=n.length-1-50;n=n.filter(((e,t)=>e.startTime>o&&t>v||s.has(e))),u=!1};r.m=e=>{var t,r=e.startTime+e.duration;o=Math.max(o,e.processingEnd);for(var n=i.length-1;n>=0;n--){var s=i[n];if(Math.abs(r-s.renderTime)<=8){(t=s).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},i.push(t)),(e.interactionId||"first-input"===e.entryType)&&a.set(e,t),l()},r.p=e=>{if(!s.get(e)){var r=e.entries[0].target;if(r){var n,i=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:uh(r);s.set(e,i)}}};var d=(e,t)=>{var r=[];for(var i of n)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;r.push(i)}return r},h=e=>{var t=e.entries[0],n=a.get(t),i=t.processingStart,o=Math.max(t.startTime+t.duration,i),u=Math.min(n.processingEnd,o),l=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(t.startTime,u),h=r.h.get(t.interactionId),v={interactionTarget:s.get(h),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:o,processedEventEntries:l,longAnimationFrameEntries:c,inputDelay:i-t.startTime,processingDuration:u-i,presentationDelay:o-u,loadState:ah(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,n,i=e.interactionTime,o=e.inputDelay,a=e.processingDuration,s=0,u=0,l=0,c=0;for(var d of e.longAnimationFrameEntries)for(var h of(u=u+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var v=h.startTime+h.duration;if(!(v<i)){var f=v-Math.max(i,h.startTime),p=h.duration?f/h.duration*h.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>c&&(n=h.startTime<i+o?"input-delay":h.startTime>=i+o+a?"presentation-delay":"processing-duration",r=h,c=f)}}var m=e.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(l=e.nextPaintTime-y),r&&n&&(e.longestScript={entry:r,subpart:n,intersectingDuration:c}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-i-s-u-l}})(v),Object.assign(e,{attribution:v})};bh("long-animation-frame",(e=>{n=n.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=xh();Ah((()=>{var n;"interactionCount"in performance||dh||(dh=bh("event",Bh,{type:"event",buffered:!0,durationThreshold:0}));var i,o=gh("INP"),a=ch(t,Dh),s=e=>{qh((()=>{for(var t of e)a.u(t);var r=a.M();r&&r.T!==o.value&&(o.value=r.T,o.entries=r.entries,i())}))},u=bh("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=ph(e,o,jh,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),fh((()=>{a.v(),o=gh("INP"),i=ph(e,o,jh,t.reportAllChanges)})))}))}}((t=>{var r=h(t);e(r)}),t)};class Hh{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}}var Yh=[2500,4e3],Gh=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),Hh),n=new WeakMap;r.m=e=>{var r=e.element;if(r){var i,o=null!==(i=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==i?i:uh(r);n.set(e,o)}},function(e,t){void 0===t&&(t={}),Ah((()=>{var r,n=xh(),i=gh("LCP"),o=ch(t,Hh),a=e=>{for(var a of(t.reportAllChanges||(e=e.slice(-1)),e))o.u(a),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-yh(),0),i.entries=[a],r())},s=bh("largest-contentful-paint",a);if(s){r=ph(e,i,Yh,t.reportAllChanges);var u=wh((()=>{a(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(qh(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});fh((n=>{i=gh("LCP"),r=ph(e,i,Yh,t.reportAllChanges),mh((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))}((t=>{var r=(e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=oh();if(r){var i=r.activationStart||0,o=e.entries.at(-1),a=o.url&&performance.getEntriesByType("resource").filter((e=>e.name===o.url))[0],s=Math.max(0,r.responseStart-i),u=Math.max(s,a?(a.requestStart||a.startTime)-i:0),l=Math.min(e.value,Math.max(u,a?a.responseEnd-i:0));t={target:n.get(o),timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:r,lcpEntry:o},o.url&&(t.url=o.url),a&&(t.lcpResourceEntry=a)}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)};function Wh(e,t){return t.length>e?t.slice(0,e)+"...":t}function zh(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Si(t));return t}function Xh(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Ni.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Wh(1024,Pi(e)):o.$el_text=Wh(1024,Ti(e)));var a=Ai(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),mi(e.attributes,(function(r){var i;if((!Ri(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&Zi(r.value)&&(i=r.name,!Ur(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var a=r.value;"class"===r.name&&(a=xi(a).join(" ")),o["attr__"+r.name]=Wh(1024,a)}}));for(var s=1,u=1,l=e;l=zh(l);)s++,l.tagName===e.tagName&&u++;return o.nth_child=s,o.nth_of_type=u,o}function Uh(e,t){for(var r,n,i,{e:o,maskAllElementAttributes:a,maskAllText:s,elementAttributeIgnoreList:u}=t,l=[e],c=e;c.parentNode&&!ki(c,"body");)(i=c.parentNode)&&11===i.nodeType?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,h,v,f=[],p={},m=!1,y=!1;if(mi(l,(e=>{var t=Mi(e);"a"===e.tagName.toLowerCase()&&(m=e.getAttribute("href"),m=t&&m&&Zi(m)&&m),Pr(Ai(e),"ph-no-capture")&&(y=!0),f.push(Xh(e,a,s,u));var r=function(e){if(!Mi(e))return{};var t={};return mi(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&Zi(n)&&(t[r]=n)}})),t}(e);yi(p,r)})),y)return{props:{},explicitNoCapture:y};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=Pi(e):f[0].$el_text=Ti(e)),m){var g,b;f[0].attr__href=m;var w=null==(h=m,v=null==ai?void 0:ai.createElement("a"),g=Xr(v)?null:(v.href=h,v))?void 0:g.host,C=null==ri||null==(b=ri.location)?void 0:b.host;w&&C&&w!==C&&(d=m)}return{props:yi({$event_type:o.type,$ce_version:1},{$elements:f},{$elements_chain:qi(f)},null!=(r=f[0])&&r.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===o.type?{$external_click_url:d}:{},p)}}ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.loadWebVitalsCallbacks=function(e){void 0===e&&(e=!0);var t=e?{onLCP:Gh,onCLS:_h,onFCP:Eh,onINP:Vh}:{onLCP:nh,onCLS:Yd,onFCP:Vd,onINP:eh};return ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.postHogWebVitalsCallbacks=t,ui.postHogWebVitalsCallbacks=t,t},vi("[AutoCapture]");var Kh={};function Jh(e){return function(e,t){var r=Kh[e];if(r)return r;var n=t[e];if(Wr(n)&&!li())return Kh[e]=n.bind(t);var i=t.document;if(i&&Gr(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),i.head.removeChild(o)}catch(t){hi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&Gr(n)?Kh[e]=n.bind(t):n}("MutationObserver",e)}function Qh(e){var t=function(e){return Xr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}function $h(e,t){return Qr(e)&&e>=t}class ev{yt(e){var t,r,n,i,o,a=this.bt((null==e?void 0:e.__onCapture)||this.wt.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:a.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:a.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:a.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:a.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==o?o:a.capture_clicks_with_modifier_keys,__onCapture:a.__onCapture}}constructor(e,t){this.Ct=[],this.bt=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.It=e=>{var t=Qh(e);Kr(t)||this.St(t)||this.Ct.push(t),this.Ct.length&&Xr(this.kt)&&(this.kt=ui.setTimeout((()=>{this.xt()}),1e3))},this.At=()=>{var e=Date.now();e%50==0&&this.Ct.forEach((t=>{Xr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Tt=()=>{this.Nt=Date.now()},this.instance=e,this.Mt=this.yt(t),this._onCapture=this.Mt.__onCapture}start(e){this.Rt(),this._t(),this.Et(),this.Ft(e)}Ft(e){if(!this.Ot){var t=Jh(ui);this.Ot=new t((e=>{this.Lt(e)})),this.Ot.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Ot)||e.disconnect(),this.Ot=void 0,ui.removeEventListener("click",this.It),ui.removeEventListener("scroll",this.At,{capture:!0}),ui.removeEventListener("selectionchange",this.Tt)}Lt(e){this.Bt=Date.now()}Rt(){bi(ui,"click",this.It)}_t(){bi(ui,"scroll",this.At,{capture:!0})}Et(){bi(ui,"selectionchange",this.Tt)}St(e){if(!e)return!0;if(!this.Mt.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t,r;if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var n=this.Ct.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!n||!(!ki(e.node,"html")&&Si(e.node)&&!Ni.includes(e.node.tagName.toLowerCase()))}xt(){if(this.Ct.length){clearTimeout(this.kt),this.kt=void 0;var e=this.Ct;for(var t of(this.Ct=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Bt&&t.timestamp<=this.Bt?this.Bt-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Nt&&t.timestamp<=this.Nt?this.Nt-t.timestamp:void 0;var n=$h(t.scrollDelayMs,this.Mt.scroll_threshold_ms),i=$h(t.selectionChangedDelayMs,this.Mt.selection_change_threshold_ms),o=$h(t.mutationDelayMs,this.Mt.mutation_threshold_ms),a=$h(t.absoluteDelayMs,1.1*this.Mt.mutation_threshold_ms),s=Qr(t.scrollDelayMs)&&t.scrollDelayMs<this.Mt.scroll_threshold_ms,u=Qr(t.mutationDelayMs)&&t.mutationDelayMs<this.Mt.mutation_threshold_ms,l=Qr(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.Mt.selection_change_threshold_ms;s||u||l||(n||o||a||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:a,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this.Mt.mutation_threshold_ms&&this.Ct.push(t))}this.Ct.length&&Xr(this.kt)&&(this.kt=ui.setTimeout((()=>{this.xt()}),1e3))}}wt(e,t){this.instance.capture("$dead_click",r({},t,Uh(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Mt.element_attribute_ignorelist}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new ev(e,t)}();
1
+ !function(){"use strict";function e(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(l||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var h={};function v(e){if(h[e])return h[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return h[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?h[e]=l:t.prototype}catch(e){return t.prototype}}var f={};function p(e,t,r){var n,i=e+"."+String(r);if(f[i])return f[i].call(t);var o=v(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(f[i]=a,a.call(t)):t[r]}var m={};function y(e,t,r){var n=e+"."+String(r);if(m[n])return m[n].bind(t);var i=v(e)[r];return"function"!=typeof i?t[r]:(m[n]=i,i.bind(t))}var g={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return y("Node",e,"contains")(t)},getRootNode:function(e){return y("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(e){var t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function C(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>S(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?L(i,t):i}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:a}=e,s=o||"",u=i&&T(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function T(e){return e.toLowerCase()}var N="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function R(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var _=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,E=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,O=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(_,((e,r,n,i,o,a)=>{var s,u=n||o||a,l=r||i||"";if(!u)return e;if(E.test(u)||F.test(u))return"url("+l+u+l+")";if(O.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+l+c.join("/")+l+")"}))}var B,Z,P=1,D=new RegExp("[^a-z0-9-_:]"),q=-2;function j(){return P++}var V=/^[^ \t\n\r\u000c]+/,H=/^[, \t\n\r\u000c]+/;var Y=new WeakMap;function G(e,t){return t&&""!==t.trim()?z(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function z(e,t){var r=Y.get(e);if(r||(r=e.createElement("a"),Y.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?G(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(H),!(r>=t.length);){var o=n(V);if(","===o.slice(-1))o=G(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=G(e,o);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?L(n,z(e)):"object"===t&&"data"===r?G(e,n):n:G(e,n):n}function U(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(g.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&K(g.parentNode(e),t,r)}function J(e,t,r,n){var i;if(b(e)){if(i=e,!g.childNodes(i).length)return!1}else{if(null===g.parentElement(e))return!1;i=g.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(K(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Q(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,dataURLOptions:h={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,y=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:l.Document,childNodes:[],compatMode:e.compatMode}:{type:l.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return D.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];U(y,S.name,S.value)||(b[S.name]=X(n,y,T(S.name),S.value))}if("link"===y&&a){var x=function(e){return null==e?void 0:e.href}(e);if(x){var R=k(n,x);if(!R&&x.includes(".css"))R=k(n,window.location.origin+"/"+x.replace(window.location.href,""));var _=null;R&&(_=I(R)),_&&(delete b.rel,delete b.href,b._cssText=_)}}if("style"===y&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){var E=I(e.sheet);E&&(b._cssText=E)}if("input"===y||"textarea"===y||"select"===y){var F=e.value,O=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&F?b.value=A({element:e,type:M(e),tagName:y,value:F,maskInputOptions:s,maskInputFn:u}):O&&(b.checked=O)}"option"===y&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("dialog"===y&&e.open)try{b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){b.rr_open_mode="modal",b.ph_rr_could_not_detect_modal=!0}if("canvas"===y&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=N in i?i[N]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var L=e.toDataURL(c.type,c.quality),P=n.createElement("canvas");P.width=e.width,P.height=e.height,L!==P.toDataURL(c.type,c.quality)&&(b.rr_dataURL=L)}if("img"===y&&d){B||(B=n.createElement("canvas"),Z=B.getContext("2d"));var q=e,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",V=q.crossOrigin,H=()=>{q.removeEventListener("load",H);try{B.width=q.naturalWidth,B.height=q.naturalHeight,Z.drawImage(q,0,0),b.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H));console.warn("Cannot inline img src="+j+"! Error: "+e)}"anonymous"===q.crossOrigin&&(V?b.crossOrigin=V:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H)}if("audio"===y||"video"===y){var Y=b;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(m){var{width:G,height:z}=e.getBoundingClientRect();b={class:b.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==y||v(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(y)&&(r=!0)}catch(e){}return{type:l.Element,tagName:y,attributes:b,childNodes:[],isSVG:W(e)||void 0,needBlock:m,rootId:p,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:h,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,a=g.parentNode(e),s=a&&a.tagName,u=g.textContent(e),c="STYLE"===s||void 0,d="SCRIPT"===s||void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=I(a.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=L(u,z(t.doc))}d&&(u="SCRIPT_PLACEHOLDER");!c&&!d&&u&&n&&(u=i?i(u,g.parentElement(e)):u.replace(/[\S]/g,"*"));return{type:l.Text,textContent:u||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:l.Comment,textContent:g.textContent(e)||"",rootId:y};default:return!1}}function ee(e){return null==e?"":e.toLowerCase()}function te(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:_=!0}=t;M||(M=J(e,a,s,void 0===M));var E,F=Q(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:y,keepIframeSrcFn:T,newlyAddedElement:N});if(!F)return console.warn(e,"not serialized"),null;E=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===l.Comment)return!0;if(e.type===l.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===R(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ee(e.attributes.name)||"icon"===ee(e.attributes.rel)||"apple-touch-icon"===ee(e.attributes.rel)||"shortcut icon"===ee(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ee(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ee(e.attributes.name)||"googlebot"===ee(e.attributes.name)||"bingbot"===ee(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ee(e.attributes.name)||"generator"===ee(e.attributes.name)||"framework"===ee(e.attributes.name)||"publisher"===ee(e.attributes.name)||"progid"===ee(e.attributes.name)||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ee(e.attributes.name)||"yandex-verification"===ee(e.attributes.name)||"csrf-token"===ee(e.attributes.name)||"p:domain_verify"===ee(e.attributes.name)||"verify-v1"===ee(e.attributes.name)||"verification"===ee(e.attributes.name)||"shopify-checkout-api-token"===ee(e.attributes.name)))return!0}}return!1}(F,f)&&(_||F.type!==l.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?j():q;var O=Object.assign(F,{id:E});if(n.add(e,O),E===q)return null;I&&I(e);var L=!u;if(O.type===l.Element){L=L&&!O.needBlock,delete O.needBlock;var B=g.shadowRoot(e);B&&C(B)&&(O.isShadowHost=!0)}if((O.type===l.Document||O.type===l.Element)&&L){f.headWhitespace&&O.type===l.Element&&"head"===O.tagName&&(_=!1);var Z={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T};if(O.type===l.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var P of Array.from(g.childNodes(e))){var D=te(P,Z);D&&O.childNodes.push(D)}var V=null;if(b(e)&&(V=g.shadowRoot(e)))for(var H of Array.from(g.childNodes(V))){var Y=te(H,Z);Y&&(C(V)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=g.parentNode(e);return G&&w(G)&&C(G)&&(O.isShadow=!0),O.type===l.Element&&"iframe"===O.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(n.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&S){var r=te(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});r&&S(e,r)}}),k),O.type===l.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===R(O.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(x){var t=te(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});t&&x(e,t)}}),A),O}let re=class e{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in ne?ne[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ie?ie[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return oe[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?oe[e]=l:r}catch(e){return r}}var se={};function ue(e,t,r){var n,i=e+"."+String(r);if(se[i])return se[i].call(t);var o=ae(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(se[i]=a,a.call(t)):t[r]}var le={};function ce(e,t,r){var n=e+"."+String(r);if(le[n])return le[n].bind(t);var i=ae(e)[r];return"function"!=typeof i?t[r]:(le[n]=i,i.bind(t))}function de(){return ae("MutationObserver").constructor}var he={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return ce("Node",e,"contains")(t)},getRootNode:function(e){return ce("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:de};function ve(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var fe="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.",pe={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function me(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}}function ye(e,t,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function ge(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pe=new Proxy(pe,{get:(e,t,r)=>("map"===t&&console.error(fe),Reflect.get(e,t,r))}));var be=Date.now;function we(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=he.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=he.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:he.parentElement(e):null}function ke(e,t,r,n){if(!e)return!1;var i=Se(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(K(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===q}function Ae(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=he.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Ae(n,t))}function Te(e){return Boolean(e.changedTouches)}function Ne(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Re(e){return!!e&&(e instanceof re&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(he.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let _e=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ee(e){var t,r=null;return"getRootNode"in e&&(null==(t=he.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&he.host(he.getRootNode(e))&&(r=he.host(he.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ee(r);)r=t;return r}(e);return he.contains(t,r)}function Oe(e){var t=e.ownerDocument;return!!t&&(he.contains(t,e)||Fe(e))}var Le=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Le||{}),Be=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Be||{}),Ze=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ze||{}),Pe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pe||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),qe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qe||{});function je(e){return"__ln"in e}class Ve{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&je(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&je(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var He,Ye=(e,t)=>e+"@"+t;class Ge{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",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ve,n=e=>{for(var t=e,r=q;r===q;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=he.parentNode(i);if(o&&Oe(i)&&"TEXTAREA"!==o.tagName){var a=w(o)?this.mirror.getId(Ee(i)):this.mirror.getId(o),s=n(i);if(-1===a||-1===s)return r.addNode(i);var u=te(i,{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:e=>{Ne(e,this.mirror)&&this.iframeManager.addIframe(e),Me(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Re(i)&&this.shadowDomManager.addShadowRoot(he.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:a,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)ze(this.removes,o,this.mirror)&&!this.movedSet.has(he.parentNode(o))||i(o);for(var a of this.addedSet)Xe(this.droppedSet,a)||ze(this.removes,a,this.mirror)?Xe(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(he.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var v=this.mirror.getId(he.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,p=he.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=he.host(p);if(-1!==this.mirror.getId(m)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var y={texts:this.texts.map((e=>{var t=e.node,r=he.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(y.texts.length||y.attributes.length||y.removes.length||y.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(y))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(he.childNodes(e),(e=>he.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=he.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:J(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=M(r);i=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var a=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!U(r.tagName,n))if(a.attributes[n]=X(this.doc,T(r.tagName),T(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&s.setAttribute("style",e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?a.styleDiff[u]=""===c?l:[l,c]:a._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=w(e.target)?this.mirror.getId(he.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(We(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ae(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ye(r,n)]?We(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!w(e.target)||!C(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ye(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(he.childNodes(e).forEach((e=>this.genAdds(e))),Re(e)&&he.childNodes(he.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 We(e,t){e.delete(t),he.childNodes(t).forEach((t=>We(e,t)))}function ze(e,t,r){return 0!==e.length&&function(e,t,r){var n,i=he.parentNode(t),o=function(){var t=r.getId(i);if(e.some((e=>e.id===t)))return{v:!0};i=he.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(e,t,r)}function Xe(e,t){return 0!==e.size&&Ue(e,t)}function Ue(e,t){var r=he.parentNode(t);return!!r&&(!!e.has(r)||Ue(e,r))}var Ke=e=>{if(!He)return e;return function(){try{return e(...arguments)}catch(e){if(He&&!0===He(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function $e(e,t){var r=new Ge;Je.push(r),r.init(e);var n=new(de())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function et(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],c=null;return Object.keys(Ze).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=T(e),u=(e=>n=>{var s=Qe(n);if(!ke(s,o,a,!0)){var u=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=Pe.Mouse;break;case"touch":u=Pe.Touch;break;case"pen":u=Pe.Pen}u===Pe.Touch?Ze[e]===Ze.MouseDown?l="TouchStart":Ze[e]===Ze.MouseUp&&(l="TouchEnd"):Pe.Pen}else Te(n)&&(u=Pe.Touch);null!==u?(c=u,(l.startsWith("Touch")&&u===Pe.Touch||l.startsWith("Mouse")&&u===Pe.Mouse)&&(u=null)):Ze[e]===Ze.Click&&(u=c,c=null);var d=Te(n)?n.changedTouches[0]:n;if(d){var h=i.getId(s),{clientX:v,clientY:f}=d;Ke(t)(r({type:Ze[l],id:h,x:v,y:f},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(Ze[e]){case Ze.MouseDown:case Ze.MouseUp:s=s.replace("mouse","pointer");break;case Ze.TouchStart:case Ze.TouchEnd:return}l.push(ve(s,u,n))})),Ke((()=>{l.forEach((e=>e()))}))}function tt(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:a}=e;return ve("scroll",Ke(me(Ke((e=>{var a=Qe(e);if(a&&!ke(a,i,o,!0)){var s=n.getId(a);if(a===r&&r.defaultView){var u=we(r.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var rt=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function it(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ot(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function at(e,t){var r,n,i,{mirror:o,stylesheetManager:a}=e,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(he.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function st(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),a(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(n=$e(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=me(Ke((e=>{var r=Date.now()-o;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],o=null})),s),c=Ke(me(Ke((e=>{var t=Qe(e),{clientX:r,clientY:n}=Te(e)?e.changedTouches[0]:e;o||(o=be()),u.push({x:r,y:n,id:i.getId(t),timeOffset:be()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),a,{trailing:!1})),d=[ve("mousemove",c,n),ve("touchmove",c,n),ve("drag",c,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),a=et(e),s=tt(e),u=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return ve("resize",Ke(me(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),l=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function v(e){var t=Qe(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=he.parentElement(t)),t&&i&&!(rt.indexOf(i)<0)&&!ke(t,o,a,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,v=!1,p=M(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(l[i.toLowerCase()]||l[p])&&(d=A({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),f(t,h?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var m=t.name;"radio"===p&&m&&v&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,n){var o=nt.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){nt.set(e,n);var a=i.getId(e);Ke(t)(r({},n,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(v),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&p.push(...g.map((e=>ye(e[0],e[1],{set(){Ke(v)({target:this,isTrusted:!1})}},!1,m)))),Ke((()=>{p.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:a}=e,s=Ke((e=>me(Ke((o=>{var a=Qe(o);if(a&&!ke(a,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=a;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500))),u=[ve("play",s(qe.Play),a),ve("pause",s(qe.Pause),a),ve("seeked",s(qe.Seeked),a),ve("volumechange",s(qe.VolumeChange),a),ve("ratechange",s(qe.RateChange),a)];return Ke((()=>{u.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=ot(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var n=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:a}),e.apply(t,o)}))}));var c={};lt("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(lt("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),lt("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),lt("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=ot(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...it(t),s||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=ot(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...it(t),a]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=at(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:a}=t,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ke(((e,t,a)=>{var u,[l,c,d]=a;if(i.has(l))return s.apply(t,[l,c,d]);var{id:h,styleId:v}=ot(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:c,priority:d},index:it(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ke(((e,t,a)=>{var s,[l]=a;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=ot(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,o.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:it(t.parentRule)}),e.apply(t,a)}))}),Ke((()=>{a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:i}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,r){var n=new a(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ge(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=a})),i.push(s),Ke((()=>{i.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,a=!0,s=Ke((()=>{var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:h,endContainer:v,endOffset:f}=c;ke(d,n,i,!0)||ke(v,n,i,!0)||s.push({start:r.getId(d),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:s})}}));return s(),ve("selectionchange",s)}(e),m=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?ge(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),y=[];for(var g of e.plugins)y.push(g.observer(g.callback,i,g.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==n||n.disconnect(),o(),a(),s(),u(),l(),c(),d(),h(),v(),f(),p(),m(),y.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function lt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ct{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class dt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ct(j)),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=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Le.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Le.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Le.Meta:case Le.Load:case Le.DomContentLoaded:return!1;case Le.Plugin:return t;case Le.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Le.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===l.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ht{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(C(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=$e(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(tt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(he.host(e))),this.restoreHandlers.push(at({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ge(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=he.shadowRoot(this);return o&&Oe(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pt=0;pt<64;pt++)ft[vt.charCodeAt(pt)]=pt;var mt=new Map;var yt=(e,t,r)=>{if(e&&(wt(e,t)||"object"==typeof e)){var n=function(e,t){var r=mt.get(e);return r||(r=new Map,mt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function gt(e,t,r){if(e instanceof Array)return e.map((e=>gt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=vt[r[t]>>2],i+=vt[(3&r[t])<<4|r[t+1]>>4],i+=vt[(15&r[t+1])<<2|r[t+2]>>6],i+=vt[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[gt(e.data,t,r),e.width,e.height]}:wt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>gt(e,t,r))),wt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,n){var i=[];try{var o=ge(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];if(!ke(this,t,r,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,r,n,i,o){var a=[],s=Object.getOwnPropertyNames(e),u=function(s){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return 0;try{if("function"!=typeof e[s])return 0;var u=ge(e,s,(function(e){return function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];var c=e.apply(this,u);if(yt(c,o,this),"tagName"in this.canvas&&!ke(this.canvas,n,i,!0)){var d=bt(u,o,this),h={type:t,property:s,args:d};r(this.canvas,h)}return c}}));a.push(u)}catch(n){var l=ye(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(l)}};for(var l of s)u(l);return a}var St,kt,xt,At,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Nt="undefined"!=typeof window&&window.Blob&&new Blob([(St=Tt,Uint8Array.from(atob(St),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Mt(e){var t;try{if(!(t=Nt&&(window.URL||window.webkitURL).createObjectURL(Nt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Rt{constructor(e){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",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{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(e,r,n,i,o){var a=this,s=Ct(r,n,i,!0),u=new Map,l=new Mt;l.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var c,d=1e3/e,h=0,v=e=>{var s,f;h&&e-h<d?c=requestAnimationFrame(v):(h=e,(s=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,n,i,!0)||s.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),s).forEach(function(){var e=t((function*(e){var t,r=a.mirror.getId(e);if(!u.get(r)&&0!==e.width&&0!==e.height){if(u.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,s=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:s});l.postMessage({id:r,bitmap:c,width:i,height:s,dataURLOptions:o.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(v))};c=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ct(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=ge(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return ke(this.canvas,r,n,!0)||setTimeout((()=>{var r=bt(s,t,this);e(this.canvas,{type:De["2D"],property:o,args:r})}),0),i.apply(this,s)}}));i.push(a)}catch(r){var s=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:De["2D"],property:o,args:[t],setter:!0})}});i.push(s)}};for(var s of o)a(s);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,De.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class _t{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new _e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),n.styleIds.push(t)};for(var a of e)o(a);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ot=document.createElement("iframe");document.body.appendChild(Ot),Array.from=(null==(n=Ot.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ot)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt,Bt,Zt=new x;function Pt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:m,hooks:y,packFn:g,sampling:b={},dataURLOptions:w={},mousemoveWait:C,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:N=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:_=(()=>!1),ignoreCSSAttributes:E=new Set([]),errorHandler:F}=e;He=F;var O=!k||window.parent===window,L=!1;if(!O)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!L)return()=>{};void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),Zt.reset();var B,Z=!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}:void 0!==v?v:{password:!0},P=!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(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var D=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&!L&&(e=g(e)),e};kt=(e,r)=>{var o,a=e;if(a.timestamp=be(),!(null==(o=Je[0])?void 0:o.isFrozen())||a.type===Le.FullSnapshot||a.type===Le.IncrementalSnapshot&&a.data.source===Be.Mutation||Je.forEach((e=>e.unfreeze())),O)null==t||t(q(a),r);else if(L){var s={type:"rrweb",event:q(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(s,"*")}if(a.type===Le.FullSnapshot)B=a,D=0;else if(a.type===Le.IncrementalSnapshot){if(a.data.source===Be.Mutation&&a.data.isAttachIframe)return;D++;var u=i&&D>=i,l=n&&a.timestamp-B.timestamp>n;(u||l)&&xt(!0)}};var j=e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.Mutation},e)})},V=e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Scroll},e)}),H=e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.CanvasMutation},e)}),Y=new _t({mutationCb:j,adoptedStyleSheetCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.AdoptedStyleSheet},e)})}),G=new dt({mirror:Zt,mutationCb:j,stylesheetManager:Y,recordCrossOriginIframes:k,wrappedEmit:kt});for(var W of R||[])W.getMirror&&W.getMirror({nodeMirror:Zt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var z=new Et;At=new Rt({recordCanvas:S,mutationCb:H,win:window,blockClass:o,blockSelector:a,mirror:Zt,sampling:b.canvas,dataURLOptions:w});var X=new ht({mutationCb:j,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:Z,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:S,inlineImages:M,sampling:b,slimDOMOptions:P,iframeManager:G,stylesheetManager:Y,canvasManager:At,keepIframeSrcFn:_,processedNodeManager:z},mirror:Zt});xt=function(e){if(void 0===e&&(e=!1),I){kt({type:Le.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Y.reset(),X.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C=(()=>!1)}=t||{};return te(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,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:m,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:Zt,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:Z,maskTextFn:m,maskInputFn:p,slimDOM:P,dataURLOptions:w,recordCanvas:S,inlineImages:M,onSerialize:e=>{Ne(e,Zt)&&G.addIframe(e),Me(e,Zt)&&Y.trackLinkElement(e),Re(e)&&X.addShadowRoot(he.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:_});if(!t)return console.warn("Failed to snapshot the document");kt({type:Le.FullSnapshot,data:{node:t,initialOffset:we(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Zt.getId(document))}};try{var U=[],K=e=>{var t;return Ke(st)({mutationCb:j,mousemoveCb:(e,t)=>kt({type:Le.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.ViewportResize},e)}),inputCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Input},e)}),mediaInteractionCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.StyleDeclaration},e)}),canvasMutationCb:H,fontCb:e=>kt({type:Le.IncrementalSnapshot,data:r({source:Be.Font},e)}),selectionCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.Selection},e)})},customElementCb:e=>{kt({type:Le.IncrementalSnapshot,data:r({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:s,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:Z,inlineStylesheet:d,sampling:b,recordDOM:I,recordCanvas:S,inlineImages:M,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:_,blockSelector:a,slimDOMOptions:P,dataURLOptions:w,mirror:Zt,iframeManager:G,stylesheetManager:Y,shadowDomManager:X,processedNodeManager:z,canvasManager:At,ignoreCSSAttributes:E,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Le.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};G.addLoadListener((e=>{try{U.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),U.push(K(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(U.push(ve("DOMContentLoaded",(()=>{kt({type:Le.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&J()}))),U.push(ve("load",(()=>{kt({type:Le.Load,data:{}}),"load"===A&&J()}),window))),()=>{U.forEach((e=>e())),z.destroy(),Ft=!1,He=void 0}}catch(e){console.warn(e)}}Pt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Le.Custom,data:{tag:e,payload:t}})},Pt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Pt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");xt(e)},Pt.mirror=Zt,(Bt=Lt||(Lt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var Dt,qt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Ut(e){if(Xt[e])return Xt[e];var t=globalThis[e],r=t.prototype,n=e in Wt?Wt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in zt?zt[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return Xt[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?Xt[e]=l:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var n,i=e+"."+String(r);if(Kt[i])return Kt[i].call(t);var o=Ut(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(Kt[i]=a,a.call(t)):t[r]}var Qt={};function $t(e,t,r){var n=e+"."+String(r);if(Qt[n])return Qt[n].bind(t);var i=Ut(e)[r];return"function"!=typeof i?t[r]:(Qt[n]=i,i.bind(t))}var er={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return $t("Node",e,"contains")(t)},getRootNode:function(e){return $t("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ut("MutationObserver").constructor}};class tr{constructor(){Gt(this,"idNodeMap",new Map),Gt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function rr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&rr(er.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&rr(er.parentNode(e),t,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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var ir={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function sr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,n=e in ir?ir[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in or?or[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return ar[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?ar[e]=l:r}catch(e){return r}}var ur={};function lr(e,t,r){var n,i=e+"."+String(r);if(ur[i])return ur[i].call(t);var o=sr(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(ur[i]=a,a.call(t)):t[r]}var cr={};function dr(e,t,r){var n=e+"."+String(r);if(cr[n])return cr[n].bind(t);var i=sr(e)[r];return"function"!=typeof i?t[r]:(cr[n]=i,i.bind(t))}var hr={childNodes:function(e){return lr("Node",e,"childNodes")},parentNode:function(e){return lr("Node",e,"parentNode")},parentElement:function(e){return lr("Node",e,"parentElement")},textContent:function(e){return lr("Node",e,"textContent")},contains:function(e,t){return dr("Node",e,"contains")(t)},getRootNode:function(e){return dr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?lr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?lr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return lr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return lr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return sr("MutationObserver").constructor}};var vr="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.",fr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fr=new Proxy(fr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var pr=Date.now;function mr(e){return e?e.nodeType===e.ELEMENT_NODE?e:hr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(pr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=hr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&hr.host(hr.getRootNode(e))&&(r=hr.host(hr.getRootNode(e))),r}function gr(e){for(var t,r=e;t=yr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=gr(e);return hr.contains(t,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ht(this,"id",1),Ht(this,"styleIDMap",new WeakMap),Ht(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return fr},closestElementOfNode:mr,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=o.getBoundingClientRect(),s=e(o,r),u=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:u,absoluteScale:s.absoluteScale*u}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:gr,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=hr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=hr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(hr.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>e(t,r,a||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(hr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&er.host(n)||null,Boolean(i&&"shadowRoot"in i&&er.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var a=hr.parentNode(t);return(!a||a.nodeType!==t.DOCUMENT_NODE)&&(!a||e(a,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=mr(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(rr(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return pr},on:function(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:a}=i;if(o&&o in t){var s=t[o];if(s.parent){var u=s.parent.children.indexOf(s);s.parent.children.splice(u,0,r(i,s.parent))}else{var l=n.indexOf(s);n.splice(l,0,r(i,null))}}else if(a in t){var c=t[a];c.children.push(r(i,c))}else n.push(r(i,null))}return n},shadowHostInDom:br,throttle:function(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.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([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==(Dt=xr.contentWindow)?void 0:Dt.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new tr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(e){jt(this,"fileName"),jt(this,"functionName"),jt(this,"lineNumber"),jt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Nr=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Rr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Nr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Nr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ar({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Mr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ar({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ar({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new Ar({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new Ar({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var a=n.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&i.push(a)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Er(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Er(e[n])&&Fr(e[n],t-1))return!0;return!1}function Or(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Er(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Er(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=_r(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}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 Br(e,t,r){var n,i=r?Object.assign({},Lr,r):Lr,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=t.error,o=Rr.parse(n).map((e=>e.toString())),a=[Or(r,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Or("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Or("Uncaught (in promise)",i.stringifyOptions),Or(t.reason,i.stringifyOptions)]);var o=Rr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(h(n,d));return()=>{u.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?wr.patch(t,r,(t=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Rr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Or(e,i.stringifyOptions)));++a<i.lengthThreshold?e({level:r,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Or("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})):()=>{}}}var Zr=e=>({name:"rrweb/console@1",observer:Br,options:e});function Pr(e,t){return-1!==e.indexOf(t)}var Dr=function(e){return e.trim()},qr=Array.isArray,jr=Object.prototype,Vr=jr.hasOwnProperty,Hr=jr.toString,Yr=qr||function(e){return"[object Array]"===Hr.call(e)},Gr=e=>"function"==typeof e,Wr=e=>Gr(e)&&-1!==e.toString().indexOf("[native code]"),zr=e=>e===Object(e)&&!Yr(e),Xr=e=>void 0===e,Ur=e=>"[object String]"==Hr.call(e),Kr=e=>null===e,Jr=e=>Xr(e)||Kr(e),Qr=e=>"[object Number]"==Hr.call(e)&&e==e,$r=e=>"[object Boolean]"===Hr.call(e),en=e=>e instanceof FormData;function tn(e){return null===e||"object"!=typeof e}function rn(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function nn(e){return!Xr(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var on,an,sn,un="Mobile",ln="Android",cn="Tablet",dn=ln+" "+cn,hn="iPad",vn="Apple Watch",fn="BlackBerry",pn="Nintendo",mn="PlayStation",yn="Xbox",gn="Windows Phone",bn="Nokia",wn="Ouya",Cn="Generic",In=Cn+" "+un.toLowerCase(),Sn=Cn+" "+cn.toLowerCase(),kn=new RegExp(yn,"i"),xn=new RegExp(mn+" \\w+","i"),An=new RegExp(pn+" \\w+","i"),Tn=new RegExp(fn+"|PlayBook|BB10","i"),Nn=function(e){var t=function(e){return An.test(e)?pn:xn.test(e)?mn:kn.test(e)?yn:new RegExp(wn,"i").test(e)?wn:new RegExp("("+gn+"|WPDesktop)","i").test(e)?gn:/iPad/.test(e)?hn:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?vn:Tn.test(e)?fn:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(bn,"i").test(e)?bn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(un).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ln:dn:new RegExp("(pda|"+un+")","i").test(e)?In:new RegExp(cn,"i").test(e)&&!new RegExp(cn+" pc","i").test(e)?Sn:""}(e);return t===hn||t===dn||"Kobo"===t||"Kindle Fire"===t||t===Sn?cn:t===pn||t===yn||t===mn||t===wn?"Console":t===vn?"Wearable":t?un:"Desktop"},Mn=e=>e instanceof Error;function Rn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return sn&&r.length===an||(an=r.length,sn=r.reduce(((r,n)=>{on||(on={});var i=on[n];if(i)r[i[0]]=i[1];else for(var o=e(n),a=o.length-1;a>=0;a--){var s=o[a],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,on[n]=[u,l];break}}return r}),{})),sn}}class _n{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(),o=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Yr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),r({},e,{cause:n,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var n of r.modifiers)t=yield n(t);return t}))()}convertToExceptionList(e,t){var n,i,o,a={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(o=e.synthetic)&&void 0!==o&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:Rn(this.stackParser)}}buildCoercingContext(e,t,n){void 0===n&&(n=0);var i=(r,n)=>{if(n<=4){var i=this.buildCoercingContext(e,t,n);return this.applyCoercers(r,i)}};return r({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,n),next:e=>i(e,n+1)})}}var En="?";function Fn(e,t,r,n,i){var o={platform:e,filename:t,function:"<anonymous>"===r?En:r,in_app:!0};return Xr(n)||(o.lineno=n),Xr(i)||(o.colno=i),o}var On=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:En,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ln=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Bn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Zn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Pn=(e,t)=>{var r=Ln.exec(e);if(r){var[,n,i,o]=r;return Fn(t,n,En,+i,+o)}var a=Bn.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var s=Zn.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[u,l]=On(a[1]||En,a[2]);return Fn(t,l,u,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jn=(e,t)=>{var r=Dn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=qn.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],o=r[1]||En;return[o,i]=On(o,i),Fn(t,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Vn=/\(error: (.*)\)/,Hn=50;function Yn(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var o=[],a=t.split("\n"),s=i;s<a.length;s++){var u=a[s];if(!(u.length>1024)){var l=Vn.test(u)?u.replace(Vn,"$1"):u;if(!l.match(/\S*Error: /)){for(var c of n){var d=c(l,e);if(d){o.push(d);break}}if(o.length>=Hn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Hn).map((e=>{return r({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||En});var n}))}(o)}}("web:javascript",Pn,jn)}class Gn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Ur(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return rn(e,"DOMException")}isDOMError(e){return rn(e,"DOMError")}}class Wn{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class zn{constructor(){}match(e){return rn(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,n=t.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Xn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(e){return"string"==typeof e}coerce(e,t){var r,[n,i]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(Xn);return n&&(t=n[1],r=n[2]),[t,r]}}var Kn=["fatal","error","warning","log","info","debug"];function Jn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:i.slice(0,t)+"..."}return""}class Qn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return nn(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Jn(e)}isSeverityLevel(e){return Ur(e)&&!(e=>Ur(e)&&0===e.trim().length)(e)&&Kn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(Mn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class $n{match(e){return nn(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+Jn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class ei{match(e){return tn(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class ti{match(e){return rn(e,"PromiseRejectionEvent")}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return tn(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){if(tn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var ri="undefined"!=typeof window?window:void 0,ni="undefined"!=typeof globalThis?globalThis:ri;"undefined"==typeof self&&(ni.self=ni),"undefined"==typeof File&&(ni.File=function(){});var ii=Array.prototype.forEach,oi=null==ni?void 0:ni.navigator,ai=null==ni?void 0:ni.document;null==ni||ni.location,null==ni||ni.fetch,null!=ni&&ni.XMLHttpRequest&&"withCredentials"in new ni.XMLHttpRequest&&ni.XMLHttpRequest,null==ni||ni.AbortController;var si=null==oi?void 0:oi.userAgent,ui=null!=ri?ri:{},li=()=>!!ri.Zone,ci=e=>e instanceof Document,di=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,n={C:function(t){if(ri&&(ui.POSTHOG_DEBUG||r)&&!Xr(ri.console)&&ri.console){for(var n=("__rrweb_original__"in ri.console[t]?ri.console[t].__rrweb_original__:ri.console[t]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];n(e,...o)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.C("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>di(e+" "+t,r)};return n},hi=di("[PostHog.js]"),vi=hi.createLogger,fi={};function pi(e,t,r){if(Yr(e))if(ii&&e.forEach===ii)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===fi)return}function mi(e,t,r){if(!Jr(e)){if(Yr(e))return pi(e,t,r);if(en(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===fi)return}else for(var i in e)if(Vr.call(e,i)&&t.call(r,e[i],i)===fi)return}}var yi=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return pi(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e};function gi(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function bi(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var wi=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return mi(e,(function(e,t){Xr(e)||Xr(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function Ci(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return Gr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Ii(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}function Si(e){return!!e&&1===e.nodeType}function ki(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function xi(e){return e?Dr(e).split(/\s+/):[]}function Ai(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return xi(t)}function Ti(e){var t="";return Mi(e)&&!Ri(e)&&e.childNodes&&e.childNodes.length&&mi(e.childNodes,(function(e){var r;(function(e){return!!e&&3===e.nodeType})(e)&&e.textContent&&(t+=null!==(r=function(e){return Jr(e)?null:Dr(e).split(/(\s+)/).filter((e=>Zi(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),Dr(t)}var Ni=["a","button","form","input","select","textarea","label"];function Mi(e){for(var t=e;t.parentNode&&!ki(t,"body");t=t.parentNode){var r=Ai(t);if(Pr(r,"ph-sensitive")||Pr(r,"ph-no-capture"))return!1}if(Pr(Ai(e),"ph-include"))return!0;var n=e.type||"";if(Ur(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Ur(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ri(e){return!!(ki(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ki(e,"select")||ki(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var _i="(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})",Ei=new RegExp("^(?:"+_i+")$"),Fi=new RegExp(_i),Oi="\\d{3}-?\\d{2}-?\\d{4}",Li=new RegExp("^("+Oi+")$"),Bi=new RegExp("("+Oi+")");function Zi(e,t){if(void 0===t&&(t=!0),Jr(e))return!1;if(Ur(e)){if(e=Dr(e),(t?Ei:Fi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Li:Bi).test(e))return!1}return!0}function Pi(e){var t=Ti(e);return Zi(t=(t+" "+Di(e)).trim())?t:""}function Di(e){var t="";return e&&e.childNodes&&e.childNodes.length&&mi(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Ti(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Di(e)).trim())}catch(e){hi.error("[AutoCapture]",e)}})),t}function qi(e){return function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+="."+o.replace(/"/g,"");var a=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return gi(a).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[ji(t.toString())]=ji(r.toString())})),i+=":",i+=gi(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Vi(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return gi(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function ji(e){return e.replace(/"|\\"/g,'\\"')}function Vi(e){var t=e.attr__class;return t?Yr(t)?t:xi(t):void 0}var Hi={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,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"]},Yi=vi("[Recorder]"),Gi=e=>"navigation"===e.entryType,Wi=e=>"resource"===e.entryType;function zi(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Gi(e)||Wi(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>eo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>Gi(e)||Wi(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>eo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Xi(e,t){return!!t&&($r(t)||t[e])}function Ui(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if($r(r))return!0;if(Yr(r))return o(r);var a=r[t];return $r(a)?a:o(a)}function Ki(e,t,r,n,i,o){return Ji.apply(this,arguments)}function Ji(){return Ji=t((function*(e,t,r,n,i,o){if(void 0===o&&(o=0),o>10)return Yi.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var a=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Wi(e)&&e.initiatorType===t&&(Xr(n)||e.startTime>=n)&&(Xr(i)||e.startTime<=i)));return a||(yield new Promise((e=>setTimeout(e,50*o))),Ki(e,t,r,n,i,o+1))})),Ji.apply(this,arguments)}function Qi(e){var{body:t,options:r,url:n}=e;if(Jr(t))return null;var{hostname:i,isHostDenied:o}=Ii(n,r);if(o)return i+" is in deny list";if(Ur(t))return t;if(ci(t))return t.textContent;if(en(t))return wi(t);if(zr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var $i=e=>!Kr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function eo(e){var{entry:t,method:n,status:i,networkRequest:o,isInitial:a,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(s||0)),v=[r({},t?t.toJSON():{name:l},{startTime:Xr(s)?void 0:Math.round(s),endTime:Xr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if($i(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var to=["video/","audio/"];function ro(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function no(){return no=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Ii(n,r);return o?Promise.resolve(i+" is in deny list"):ro(t)})),no.apply(this,arguments)}function io(){return io=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),a=to.some((e=>null==o?void 0:o.startsWith(e)));if(o&&a)return"Content-Type "+o+" is not supported";var{hostname:s,isHostDenied:u}=Ii(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return Kr(i)?ro(t):Promise.resolve(i)})),io.apply(this,arguments)}function oo(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Xi("request",n.recordHeaders),o=Xi("response",n.recordHeaders),a=Ci(r,"fetch",(a=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),h={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),i&&(h.requestHeaders=v),Ui({type:"request",headers:v,url:t,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return no.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=yield a(d),c=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),o&&(h.responseHeaders=f),Ui({type:"response",headers:f,url:t,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return io.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Ki(r,"fetch",d.url,l,c).then((t=>{var r,n=eo({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{a()}}var ao=null;function so(e,t,n){if(!("performance"in t))return()=>{};if(ao)return Yi.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},Hi,n):Hi,o=t=>{var n=[];t.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},a=zi(o,t,i),s=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Xi("request",r.recordHeaders),i=Xi("response",r.recordHeaders),o=Ci(t.XMLHttpRequest.prototype,"open",(o=>function(a,s,u,l,c){void 0===u&&(u=!0);var d,h,v=this,f=new Request(s),p={},m={},y=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=v.send.bind(v);v.send=e=>(Ui({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=Qi({body:e,options:r,url:s})),d=t.performance.now(),g(e));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(),h=t.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Ui({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=Qi({body:v.response,options:r,url:s})),Ki(t,"xmlhttprequest",f.url,d,h).then((t=>{var r=eo({entry:t,method:a,status:null==v?void 0:v.status,networkRequest:p,start:d,end:h,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),o.call(v,a,s.toString(),u,l,c)}));return()=>{o()}}(o,t,i),u=oo(o,t,i)),ao=()=>{a(),s(),u(),ao=null}}var uo=e=>({name:"rrweb/network@1",observer:so,options:e});ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Zr,getRecordNetworkPlugin:uo},ui.__PosthogExtensions__.rrweb={record:Pt,version:"v2"},ui.rrweb={record:Pt,version:"v2"},ui.rrwebConsoleRecord={getRecordConsolePlugin:Zr},ui.getRecordNetworkPlugin=uo;var lo,co,ho,vo,fo,po,mo,yo,go,bo,wo,Co,Io={},So=[],ko=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xo=Array.isArray;function Ao(e,t){for(var r in t)e[r]=t[r];return e}function To(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function No(e,t,r){var n,i,o,a={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?lo.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Mo(e,a,n,i,null)}function Mo(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++ho:i,__i:-1,__u:0};return null==i&&null!=co.vnode&&co.vnode(o),o}function Ro(e){return e.children}function _o(e,t){this.props=e,this.context=t}function Eo(e,t){if(null==t)return e.__?Eo(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Eo(e):null}function Fo(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Fo(e)}}function Oo(e){(!e.__d&&(e.__d=!0)&&vo.push(e)&&!$.__r++||fo!=co.debounceRendering)&&((fo=co.debounceRendering)||po)($)}function $(){for(var e,t,r,n,i,o,a,s=1;vo.length;)vo.length>s&&vo.sort(mo),e=vo.shift(),s=vo.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ao({},n)).__v=n.__v+1,co.vnode&&co.vnode(r),jo(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,null==i?Eo(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Ho(o,r,a),n.__e=n.__=null,r.__e!=i&&Fo(r)));$.__r=0}function Lo(e,t,r,n,i,o,a,s,u,l,c){var d,h,v,f,p,m,y,g=n&&n.__k||So,b=t.length;for(u=function(e,t,r,n,i){var o,a,s,u,l,c=r.length,d=c,h=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[o]=Mo(null,a,null,null,null):xo(a)?a=e.__k[o]=Mo(Ro,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[o]=Mo(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,u=o+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=Zo(a,r,u,d))&&(d--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(i>c?h--:i<c&&h++),"function"!=typeof a.type&&(a.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,a.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(s=r[o])&&0==(2&s.__u)&&(s.__e==n&&(n=Eo(s)),Wo(s,s));return n}(r,t,g,u,b),d=0;d<b;d++)null!=(v=r.__k[d])&&(h=-1==v.__i?Io:g[v.__i]||Io,v.__i=d,m=jo(e,v,h,i,o,a,s,u,l,c),f=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&Go(h.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(y=!!(4&v.__u))||h.__k===v.__k?u=Bo(v,u,e,y):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Bo(e,t,r,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=Bo(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Eo(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Zo(e,t,r,n){var i,o,a,s=e.key,u=e.type,l=t[r],c=null!=l&&0==(2&l.__u);if(null===l&&null==s||c&&s==l.key&&u==l.type)return r;if(n>(c?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;)if(null!=(l=t[a=i>=0?i--:o++])&&0==(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function Po(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||ko.test(t)?r:r+"px"}function Do(e,t,r,n,i){var o,a;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Po(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Po(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(yo,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=go,e.addEventListener(t,o?wo:bo,o)):e.removeEventListener(t,o?wo:bo,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function qo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=go++;else if(t.t<r.u)return;return r(co.event?co.event(t):t)}}}function jo(e,t,r,n,i,o,a,s,u,l){var c,d,h,v,f,p,m,y,g,b,w,$,C,I,S,k,x,A=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(c=co.__b)&&c(t);e:if("function"==typeof A)try{if(y=t.props,g="prototype"in A&&A.prototype.render,b=(c=A.contextType)&&n[c.__c],w=c?b?b.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:(g?t.__c=d=new A(y,w):(t.__c=d=new _o(y,w),d.constructor=A,d.render=zo),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),g&&null==d.__s&&(d.__s=d.state),g&&null!=A.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ao({},d.__s)),Ao(d.__s,A.getDerivedStateFromProps(y,d.__s))),v=d.props,f=d.state,d.__v=t,h)g&&null==A.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),g&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(g&&null==A.getDerivedStateFromProps&&y!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){for(t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),g&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,C=co.__r,I=0,g){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(n=Ao(Ao({},n),d.getChildContext())),g&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),k=c,null!=c&&c.type===Ro&&null==c.key&&(k=Yo(c.props.children)),s=Lo(e,xo(k)?k:[k],t,r,n,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=o)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(x=o.length;x--;)To(o[x]);Vo(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Vo(t);co.__e(e,t,r)}else null==o&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,n,i,o,a,s,u){var l,c,d,h,v,f,p,m=r.props||Io,y=t.props,g=t.type;if("svg"==g?i="http://www.w3.org/2000/svg":"math"==g?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!g&&(g?v.localName==g:3==v.nodeType)){e=v,o[l]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(i,g,y.is&&y),s&&(co.__m&&co.__m(t,o),s=!1),o=null}if(null==g)m===y||s&&e.data==y||(e.data=y);else{if(o=o&&lo.call(e.childNodes),!s&&null!=o)for(m={},l=0;l<e.attributes.length;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)if(v=m[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=v;else if(!(l in y)){if("value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y)continue;Do(e,l,null,v,i)}for(l in y)v=y[l],"children"==l?h=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||Do(e,l,v,m[l],i);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Lo("template"==t.type?e.content:e,xo(h)?h:[h],t,r,n,"foreignObject"==g?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Eo(r,0),s,u),null!=o)for(l=o.length;l--;)To(o[l]);s||(l="value","progress"==g&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==g&&!f||"option"==g&&f!=m[l])&&Do(e,l,f,m[l],i),l="checked",null!=p&&p!=e[l]&&Do(e,l,p,m[l],i))}return e}(r.__e,t,r,n,i,o,a,u,l);return(c=co.diffed)&&c(t),128&t.__u?void 0:s}function Vo(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Vo)}function Ho(e,t,r){for(var n=0;n<r.length;n++)Go(r[n],r[++n],r[++n]);co.__c&&co.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){co.__e(e,t.__v)}}))}function Yo(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:xo(e)?e.map(Yo):Ao({},e)}function Go(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){co.__e(e,r)}}function Wo(e,t,r){var n,i;if(co.unmount&&co.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Go(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){co.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Wo(n[i],t,r||"function"!=typeof e.type);r||To(e.__e),e.__c=e.__=e.__e=void 0}function zo(e,t,r){return this.constructor(e,r)}function Xo(e,t,r){var n,i,o;t==document&&(t=document.documentElement),co.__&&co.__(e,t),n=!1?null:t.__k,i=[],o=[],jo(t,e=t.__k=No(Ro,null,[e]),n||Io,Io,t.namespaceURI,n?null:t.firstChild?lo.call(t.childNodes):null,i,n?n.__e:t.firstChild,false,o),Ho(i,e,o)}function Uo(e,t,r){var n,i,o,a,s=Ao({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&null!=a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?lo.call(arguments,2):r),Mo(e.type,s,n||e.key,i||e.ref,null)}lo=So.slice,co={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},ho=0,_o.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ao({},this.state),"function"==typeof e&&(e=e(Ao({},r),this.props)),e&&Ao(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Oo(this))},_o.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Oo(this))},_o.prototype.render=Ro,vo=[],po="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mo=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,yo=/(PointerCapture)$|Capture$/i,go=0,bo=qo(!1),wo=qo(!0),Co=0;var Ko,Jo,Qo,$o,ea=0,ta=[],ra=co,na=ra.__b,ia=ra.__r,oa=ra.diffed,aa=ra.__c,sa=ra.unmount,ua=ra.__;function la(e,t){ra.__h&&ra.__h(Jo,e,ea||t),ea=0;var r=Jo.__H||(Jo.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ca(e){return ea=1,function(e,t,r){var n=la(Ko++,2);if(n.t=e,!n.__c&&(n.__=[Ca(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Jo,!Jo.__f)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=n.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),o&&o.call(this,e,t,r)||a};Jo.__f=!0;var o=Jo.shouldComponentUpdate,a=Jo.componentWillUpdate;Jo.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},Jo.shouldComponentUpdate=i}return n.__N||n.__}(Ca,e)}function da(e,t){var r=la(Ko++,3);!ra.__s&&wa(r.__H,t)&&(r.__=e,r.u=t,Jo.__H.__h.push(r))}function ha(e){return ea=5,va((function(){return{current:e}}),[])}function va(e,t){var r=la(Ko++,7);return wa(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function fa(e){var t=Jo.context[e.__c],r=la(Ko++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Jo)),t.props.value):e.__}function pa(){for(var e;e=ta.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ga),e.__H.__h.forEach(ba),e.__H.__h=[]}catch(t){e.__H.__h=[],ra.__e(t,e.__v)}}ra.__b=function(e){Jo=null,na&&na(e)},ra.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ua&&ua(e,t)},ra.__r=function(e){ia&&ia(e),Ko=0;var t=(Jo=e.__c).__H;t&&(Qo===Jo?(t.__h=[],Jo.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(ga),t.__h.forEach(ba),t.__h=[],Ko=0)),Qo=Jo},ra.diffed=function(e){oa&&oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ta.push(t)&&$o===ra.requestAnimationFrame||(($o=ra.requestAnimationFrame)||ya)(pa)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Qo=Jo=null},ra.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ga),e.__h=e.__h.filter((function(e){return!e.__||ba(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ra.__e(r,e.__v)}})),aa&&aa(e,t)},ra.unmount=function(e){sa&&sa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{ga(e)}catch(e){t=e}})),r.__H=void 0,t&&ra.__e(t,r.__v))};var ma="function"==typeof requestAnimationFrame;function ya(e){var t,r=function(){clearTimeout(n),ma&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);ma&&(t=requestAnimationFrame(r))}function ga(e){var t=Jo,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Jo=t}function ba(e){var t=Jo;e.__c=e.__(),Jo=t}function wa(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Ca(e,t){return"function"==typeof t?t(e):t}var Ia=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Sa=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),ka=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),xa=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Aa=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ta=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Na=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Ma=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),Ra=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),_a=vi("[Surveys]");var Ea="inProgressSurvey_",Fa=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Oa=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},La=e=>Oa("seenSurvey_",e),Ba=e=>{localStorage.getItem(La(e))||localStorage.setItem(La(e),"true")},Za=[xa.Popover,xa.Widget,xa.API];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});var Pa="0123456789abcdef";class Da{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Da(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Pa.charAt(this.bytes[t]>>>4)+Pa.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Da(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class qa{constructor(){this.I=0,this.S=0,this.k=new Ha}generate(){var e=this.generateOrAbort();if(Xr(e)){this.I=0;var t=this.generateOrAbort();if(Xr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(!(e+1e4>this.I))return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Da.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var ja,Va=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ri&&!Xr(ri.crypto)&&crypto.getRandomValues&&(Va=e=>crypto.getRandomValues(e));class Ha{constructor(){this.N=new Uint32Array(8),this.R=1/0}nextUint32(){return this.R>=this.N.length&&(Va(this.N),this.R=0),this.N[this.R++]}}var Ya=()=>Ga().toString(),Ga=()=>(ja||(ja=new qa)).generate();null!=oi&&oi.sendBeacon;var Wa=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},za={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Wa(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Wa(t,e))))),icontains:(e,t)=>t.map(Xa).some((t=>e.map(Xa).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Xa).every((t=>e.map(Xa).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Xa=e=>e.toLowerCase(),Ua=vi("[Stylesheet Loader]"),Ka=ri,Ja=ai;function Qa(e){return"$survey_response_"+e}var $a="#020617",es={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:Sa.Right,widgetType:Ia.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:$a,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function ts(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function rs(e){var t;void 0===e&&(e=es.backgroundColor),"#"===e[0]&&(t=ts(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=ts(r)),!t)return $a;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?$a:"white"}return $a}function ns(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(Ua.error("prepare_external_dependency_stylesheet returned null"),null)})(Ja,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var is=(e,t,n)=>{var i=xs(e),o=Ja.querySelector("."+i);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var a=Ja.createElement("div");((e,t,n)=>{var i=r({},es,n),o=e.style,a=![Sa.Center,Sa.Left,Sa.Right].includes(i.position)||t===xa.Widget&&(null==n?void 0:n.widgetType)===Ia.Tab;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),o.setProperty("--ph-survey-box-padding",i.boxPadding),o.setProperty("--ph-survey-max-width",i.maxWidth),o.setProperty("--ph-survey-z-index",i.zIndex),o.setProperty("--ph-survey-border-color",i.borderColor),a?(o.setProperty("--ph-survey-border-radius",i.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",i.borderRadius+" "+i.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",i.backgroundColor),o.setProperty("--ph-survey-box-shadow",i.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||rs(i.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",rs(i.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||rs(i.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),o.setProperty("--ph-widget-color",i.widgetColor),o.setProperty("--ph-widget-text-color",rs(i.widgetColor)),o.setProperty("--ph-widget-z-index",i.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=s||i.inputBackground;s||"white"!==i.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||rs(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var s=a.attachShadow({mode:"open"}),u=ns(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return Ja.body.appendChild(a),{shadow:s,isNewlyCreated:!0}},os=(e,t)=>{if(!t)return null;var r=e[Qa(t)];return Yr(r)?[...r]:r},as=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:o,isSurveyCompleted:a,properties:s}=e;o?(Ba(n),o.capture(Ma.SENT,r({[Ra.SURVEY_NAME]:n.name,[Ra.SURVEY_ID]:n.id,[Ra.SURVEY_ITERATION]:n.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:n.current_iteration_start_date,[Ra.SURVEY_QUESTIONS]:n.questions.map((e=>({id:e.id,question:e.question,response:os(t,e.id)}))),[Ra.SURVEY_SUBMISSION_ID]:i,[Ra.SURVEY_COMPLETED]:a,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,s,{$set:{[Fa(n,"responded")]:!0}})),a&&(Ka.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),ks(n))):_a.error("[survey sent] event not captured, PostHog instance not found.")},ss=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!Jr(e))).length>0,us=(e,t,n)=>r({[Ra.SURVEY_NAME]:e.name,[Ra.SURVEY_ID]:e.id,[Ra.SURVEY_ITERATION]:e.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ra.SURVEY_PARTIALLY_COMPLETED]:ss(t),sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},null==t?void 0:t.responses,{[Ra.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[Ra.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:os((null==t?void 0:t.responses)||{},e.id)})))}),ls=(e,t,n)=>{if(t){if(!n){var i=Is(e);t.capture(Ma.DISMISSED,r({},us(e,i,t),{$set:{[Fa(e,"dismissed")]:!0}})),ks(e),Ba(e),Ka.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else _a.error("[survey dismissed] event not captured, PostHog instance not found.")},cs=(e,t)=>{if(t){var r=(e=>Oa("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var n=Is(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Ma.ABANDONED,us(e,n,t),{transport:"sendBeacon"})}}else _a.error("[survey abandoned] event not captured, PostHog instance not found.")},ds=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),hs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,vs=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?hs(e.questions,ds(e.questions)):e.questions,fs=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Na.Always||Ss(e)},ps=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Oo(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Co++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),ms=()=>fa(ps),ys=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return Uo(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function gs(e){return null!=e?e:"icontains"}function bs(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==Ka||null==(r=Ka.location)?void 0:r.href;if(!i)return!1;var o=[e.conditions.url],a=gs(null==(n=e.conditions)?void 0:n.urlMatchType);return za[a](o,[i])}var ws=e=>{var t=""+Ea+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ea+e.id+"_"+e.current_iteration),t},Cs=(e,t)=>{try{localStorage.setItem(ws(e),JSON.stringify(t))}catch(e){_a.error("Error setting in-progress survey state in localStorage",e)}},Is=e=>{try{var t=localStorage.getItem(ws(e));if(t)return JSON.parse(t)}catch(e){_a.error("Error getting in-progress survey state from localStorage",e)}return null},Ss=e=>{var t=Is(e);return!Jr(null==t?void 0:t.surveySubmissionId)},ks=e=>{try{localStorage.removeItem(ws(e))}catch(e){_a.error("Error clearing in-progress survey state from localStorage",e)}};function xs(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function As(e,t,r){if(void 0===t&&(t=Sa.Right),e===xa.ExternalSurvey)return{};switch(t){case Sa.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Sa.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Sa.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Sa.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Sa.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Sa.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Sa.Left:return{left:"30px"};case Sa.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Sa.Right:return{right:e===xa.Widget&&r===Ia.Tab?"60px":"30px"}}}var Ts=0;function Ns(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ts,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return co.vnode&&co.vnode(l),l}var Ms=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Rs=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),_s=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Es=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Fs=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ns("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"})}),Os=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ns("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"})}),Ls=Ns("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ns("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"})}),Bs=Ns("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[Ns("title",{id:"close-survey-title",children:"Close survey"}),Ns("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"currentColor"})]}),Zs=Ns("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ns("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ns("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ns("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ns("g",{mask:"url(#mask0_2415_6911)",children:[Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"}),Ns("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"})]})]}),Ns("defs",{children:Ns("clipPath",{id:"clip0_2415_6911",children:Ns("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Ps(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Ns("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Zs]})}function Ds(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:a,skipSubmitButton:s}=e,{isPreviewMode:u}=fa(ps);return Ns("div",{className:"bottom-section",children:[!s&&Ns("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==ri||ri.open(o)),u?null==a||a():i()},children:t}),!n.whiteLabel&&Ns(Ps,{urlParams:{utm_source:"survey-footer"}})]})}function qs(e){var{question:t,forceDisableHtml:r,htmlFor:n}=e;return Ns("div",{class:"question-header",children:[Ns(t.type===Aa.Open?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&ys({component:No("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function js(e){var{onClick:t}=e,{isPreviewMode:r}=fa(ps);return Ns("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ns("span",{style:{color:"black"},children:Bs})})}Ns("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ns("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 Vs=ri;function Hs(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:o,onClose:a}=e,{isPopup:s}=fa(ps);return da((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),a())};return bi(Vs,"keydown",e),()=>{Vs.removeEventListener("keydown",e)}}),[a]),Ns("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Ns(js,{onClick:()=>a()}),Ns("h3",{className:"thank-you-message-header",children:t}),r&&ys({component:No("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&Ns(Ds,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})}var Ys=e=>Yr(e)&&e.every((e=>Ur(e)));function Gs(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o,displayQuestionIndex:a,initialValue:s}=e,{isPreviewMode:u}=ms(),l=ha(null),[c,d]=ca((()=>Ur(s)?s:""));da((()=>{setTimeout((()=>{var e;u||(null==(e=l.current)||e.focus())}),100)}),[u]);var h="surveyQuestion"+a;return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:t,forceDisableHtml:r,htmlFor:h}),Ns("textarea",{ref:l,id:h,rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c})]}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:!c&&!t.optional,appearance:n,onSubmit:()=>i(c),onPreviewSubmit:()=>o(c)})]})}function Ws(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return Ns(Ro,{children:[Ns("div",{className:"question-container",children:Ns(qs,{question:t,forceDisableHtml:r})}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function zs(e){var t,{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l=r.scale,c=10===r.scale?0:1,[d,h]=ca((()=>Qr(u)?u:Yr(u)&&u.length>0&&Qr(parseInt(u[0]))?parseInt(u[0]):Ur(u)&&Qr(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=ms(),p=e=>f?s(e):a(e);return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:r,forceDisableHtml:n}),Ns("div",{className:"rating-section",children:[Ns("div",{className:"rating-options",children:["emoji"===r.display&&Ns("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=$s[r.scale])?void 0:t.map(((e,t)=>Ns("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick:()=>{var e=t+1;h(e),r.skipSubmitButton&&p(e)},children:e},t)))}),"number"===r.display&&Ns("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-c+1)+", minmax(0, 1fr))"},children:eu(r.scale).map(((e,t)=>Ns(Xs,{displayQuestionIndex:i,active:d===e,appearance:o,num:e,setActiveNumber:e=>{h(e),r.skipSubmitButton&&p(e)}},t)))})]}),!v&&Ns("div",{className:"rating-text",children:[Ns("div",{children:r.lowerBoundLabel}),Ns("div",{children:r.upperBoundLabel})]})]})]}),Ns(Ds,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Kr(d)&&!r.optional,appearance:o,onSubmit:()=>a(d),onPreviewSubmit:()=>s(d),skipSubmitButton:r.skipSubmitButton})]})}function Xs(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return Ns("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{i(t)},children:t})}function Us(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l=ha(null),c=va((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=hs(t,ds(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[d,h]=ca((()=>((e,t)=>Ur(e)||Ys(e)?e:t===Aa.SingleChoice?null:[])(u,t.type))),[v,f]=ca((()=>((e,t)=>{if(Ur(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Ys(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,c))),{isPreviewMode:p}=ms(),m=t.type===Aa.SingleChoice,y=t.type===Aa.MultipleChoice,g=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(e,t)=>{if(t){var n=!v.isSelected;return f((e=>r({},e,{isSelected:n,inputValue:n?e.inputValue:""}))),m&&h(""),void(n&&setTimeout((()=>{var e;return null==(e=l.current)?void 0:e.focus()}),75))}if(m)return h(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(g&&(a(e),p&&s(e)));y&&Yr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),m&&h(t)},C=e=>{e.stopPropagation(),"Enter"!==e.key||I()||(e.preventDefault(),S()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),m&&h(null))},I=()=>!t.optional&&(!!Kr(d)||(!(!Yr(d)||v.isSelected||0!==d.length)||!(!v.isSelected||""!==v.inputValue.trim()))),S=()=>{v.isSelected&&y?Yr(d)&&(p?s([...d,v.inputValue]):a([...d,v.inputValue])):p?s(d):a(d)};return Ns(Ro,{children:[Ns("div",{className:"question-container",children:[Ns(qs,{question:t,forceDisableHtml:n}),Ns("fieldset",{className:"multiple-choice-options limit-height",children:[Ns("legend",{className:"sr-only",children:y?" Select all that apply":" Select one"}),c.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,o="surveyQuestion"+i+"Choice"+r,a=o+"Open",s=n?v.isSelected:m?d===e:Yr(d)&&d.includes(e);return Ns("label",{className:n?"choice-option-open":"",children:[Ns("div",{className:"response-choice",children:[Ns("input",{type:m?"radio":"checkbox",name:o,checked:s,onChange:()=>b(e,n),id:o,"aria-controls":a}),Ns("span",{children:n?e+":":e})]}),n&&Ns("input",{type:"text",ref:l,id:a,name:"question"+i+"Open",value:v.inputValue,onKeyDown:C,onInput:w,onClick:t=>{v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Ns(Ds,{text:t.buttonText||"Submit",submitDisabled:I(),appearance:o,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:g})]})}var Ks=[1,2,3,4,5],Js=[1,2,3,4,5,6,7],Qs=[0,1,2,3,4,5,6,7,8,9,10],$s={2:[Os,Ls],3:[_s,Rs,Ms],5:[Es,_s,Rs,Ms,Fs]};function eu(e){switch(e){case 5:default:return Ks;case 7:return Js;case 10:return Qs}}var tu=vi("[Surveys]");function ru(e,t,r){var n,i=e.questions[t],o=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?Ta.End:o;if(i.branching.type===Ta.End)return Ta.End;if(i.branching.type===Ta.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ta.ResponseBased){if(i.type===Aa.SingleChoice){var a,s=i.choices.indexOf(""+r);if(-1===s&&i.hasOpenChoice&&(s=i.choices.length-1),null!=(a=i.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(s)){var u=i.branching.responseValues[s];return Number.isInteger(u)?u:u===Ta.End?Ta.End:o}}else if(i.type===Aa.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(e<1||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===Ta.End?Ta.End:o}}return o}return tu.warn("Falling back to next question index due to unexpected branching type"),o}var nu=ri,iu=ai,ou="ph:show_survey_widget",au="PHWidgetSurveyClickListener",su=250,uu=20,lu=12;function cu(e,t){try{var r=e.getBoundingClientRect(),n=nu.innerHeight,i=nu.innerWidth,o=su,a=r.left+r.width/2-t/2;a+t>i-uu&&(a=i-t-uu),a<uu&&(a=uu);var s=lu,u=n-r.bottom,l=r.top,c=u<o&&l>u;return{position:"fixed",top:c?"auto":r.bottom+s+"px",left:a+"px",right:"auto",bottom:c?n-r.top+s+"px":"auto",zIndex:es.zIndex}}catch(e){return _a.warn("Failed to calculate trigger position:",e),null}}class du{constructor(e){var t=this;this.F=new Map,this.O=new Map,this.B=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Ss(t)&&cs(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var n,i,o,a,s=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this.Z(s.id);var{properties:u,initialResponses:l}=null!=t?t:{},c=!!(l&&Object.keys(l).length>0)&&this.D(s,l,u);if(!c||null!=(n=s.appearance)&&n.displayThankYouMessage){this.q(s);var d={};if((null==(i=s.appearance)?void 0:i.position)===Sa.NextToTrigger&&null!=(o=s.appearance)&&o.widgetSelector){var h,v=iu.querySelector(s.appearance.widgetSelector);if(v)d=cu(v,parseInt((null==(h=s.appearance)?void 0:h.maxWidth)||es.maxWidth))||{}}var f=(null==(a=s.appearance)?void 0:a.surveyPopupDelaySeconds)||0,{shadow:p}=is(s,this._posthog);if(f<=0)return Xo(Ns(pu,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.j,properties:u,style:d,isSurveyCompleted:c}),p);var m=setTimeout((()=>{if(this.F.delete(s.id),!bs(s))return this.j(s);Xo(Ns(pu,{posthog:this._posthog,survey:r({},s,{appearance:r({},s.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.j,properties:u,style:d,isSurveyCompleted:c}),p)}),1e3*f);this.F.set(s.id,m)}},this.V=e=>{var{shadow:t,isNewlyCreated:r}=is(e,this._posthog);r&&Xo(Ns(yu,{posthog:this._posthog,survey:e},e.id),t)},this.H=e=>{this.Y(e);var t=this.O.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(au),this.O.delete(e.id),_a.info("Removed click listener for survey "+e.id))},this.G=(e,t)=>{var r=iu.querySelector(t),n=this.O.get(e.id);if(r){if(this.V(e),n){if(r===n.element)return;_a.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.H(e)}if(!r.hasAttribute(au)){var i=t=>{var r,n;t.stopPropagation();var i=(null==(r=e.appearance)?void 0:r.position)===Sa.NextToTrigger?cu(t.currentTarget,parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||es.maxWidth)):{};nu.dispatchEvent(new CustomEvent(ou,{detail:{surveyId:e.id,position:i}}))};bi(r,"click",i),r.setAttribute(au,"true"),this.O.set(e.id,{element:r,listener:i,survey:e}),_a.info("Attached click listener for feedback button survey "+e.id)}}else n&&this.H(e)},this.renderPopover=e=>{var{shadow:t}=is(e,this._posthog);Xo(Ns(pu,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.j}),t)},this.renderSurvey=(e,t,r)=>{var n;null!=(n=this._posthog.config)&&null!=(n=n.surveys)&&n.prefillFromUrl&&this.W(e),Xo(Ns(pu,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.j,isPopup:!1,properties:r}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||n.surveys.getSurveys((r=>{var n=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.X(e)&&t.U(e)&&t.K(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===xa.Popover||e.type===xa.Widget)),n=t.J(r),i=new Set;n.forEach((e=>{if(e.type===xa.Widget){var r,n,o,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Ia.Tab)return void t.V(e);if((null==(n=e.appearance)?void 0:n.widgetType)===Ia.Selector&&null!=(o=e.appearance)&&o.widgetSelector)i.add(e.id),t.G(e,null==(a=e.appearance)?void 0:a.widgetSelector)}Kr(t.$)&&e.type===xa.Popover&&t.handlePopoverSurvey(e)})),t.O.forEach((e=>{var{survey:r}=e;i.has(r.id)||t.H(r)}))}),e)},this.q=e=>{Kr(this.$)||_a.error("Survey "+this.$+" already in focus. Cannot add survey "+e.id+"."),this.$=e.id},this.j=e=>{this.$!==e.id&&_a.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.Z(e.id),this.$=null,this.Y(e)},this._posthog=e,this.$=null}Z(e){var t=this.F.get(e);t&&(clearTimeout(t),this.F.delete(e))}cancelSurvey(e){this.F.has(e)&&(_a.info("Cancelled pending survey "+e),this.Z(e),this.$===e&&(this.$=null))}J(e){return e.sort(((e,t)=>{var r,n,i=Ss(e),o=Ss(t);if(i&&!o)return-1;if(!i&&o)return 1;var a=e.schedule===Na.Always,s=t.schedule===Na.Always;return a&&!s?1:!a&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}W(e){if(!this.B.has(e.id)){var{params:t}=function(e){var t={},r=!1,n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};var i=n.split("&");for(var o of i){var[a,s]=o.split("=");if(a&&!Xr(s)){var u=decodeURIComponent(a),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var c=u.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(l)}}else r=!0}}return{params:t,autoSubmit:r}}(nu.location.search);if(0!==Object.keys(t).length){_a.info("[Survey Prefill] Detected URL prefill parameters");var r=this.ee(e,t);if(r){var{responses:n,submissionId:i,isSurveyCompleted:o,skippedResponses:a}=r;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&as({responses:o?n:a,survey:e,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:o}),this.B.add(e.id)}}}}D(e,t,r){var n={};for(var[i,o]of Object.entries(t)){n[parseInt(i)]=Yr(o)?o.map(String):[String(o)]}_a.info("[Survey] Processing initial responses");var a=this.ee(e,n);if(!a)return!1;var{responses:s,submissionId:u,isSurveyCompleted:l}=a;return as({responses:s,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}ee(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,n)=>{if(t[n]&&e.id){var i=t[n],o=Qa(e.id);try{switch(e.type){case Aa.SingleChoice:if(!e.choices||0===e.choices.length)return void hi.warn("[Survey Prefill] Question "+n+" has no choices");var a=parseInt(i[0],10);if(isNaN(a)||a<0||a>=e.choices.length)return void hi.warn("[Survey Prefill] Invalid choice index for q"+n+": "+i[0]);r[o]=e.choices[a];break;case Aa.MultipleChoice:if(!e.choices||0===e.choices.length)return void hi.warn("[Survey Prefill] Question "+n+" has no choices");var s=i.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===s.length)return void hi.warn("[Survey Prefill] No valid choices for q"+n);var u=[...new Set(s.map((t=>e.choices[t])))];u.length<s.length&&hi.warn("[Survey Prefill] Removed duplicate choices for q"+n),r[o]=u;break;case Aa.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||l<0||l>c)return void hi.warn("[Survey Prefill] Invalid rating for q"+n+": "+i[0]+" (scale: 0-"+c+")");r[o]=l;break;default:hi.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){hi.error("[Survey Prefill] Error converting q"+n+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return _a.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Ya(),i=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var n=0,i={},o=e.questions.length+1;n<e.questions.length&&0<o&&t.includes(n);){var a=e.questions[n];if(!a||!("skipSubmitButton"in a)||!a.skipSubmitButton)break;if(a.id){var s=Qa(a.id);Xr(r[s])||(i[s]=r[s])}var u=ru(e,n,a.id?r[Qa(a.id)]:null);if(u===Ta.End)return{startQuestionIndex:e.questions.length,skippedResponses:i};n=u}return{startQuestionIndex:n,skippedResponses:i}}(e,i,r),s=o>=e.questions.length;return Cs(e,{surveySubmissionId:n,responses:r,lastQuestionIndex:o}),_a.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:s,skippedResponses:a}}catch(e){return _a.error("[Survey Prefill] Error handling prefill:",e),null}}te(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),n=!0;t&&(n=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&n}X(e){return!e.conditions||bs(e)&&function(e){var t,r,n;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!si)return!1;var i=Nn(si);return za[gs(null==(n=e.conditions)?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==Ja||!Ja.querySelector(e.conditions.selector))}(e)}re(e){return fs(e)||this.te(e.internal_targeting_flag_key)||Ss(e)}checkSurveyEligibility(e){var t,r,n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason="Survey is not running. It was completed on "+e.end_date,n;if(!Za.includes(e.type))return n.eligible=!1,n.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",n;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.te(e.linked_flag_key,i)?this.te(e.targeting_flag_key)?this.re(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(n/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(La(e))&&!fs(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n):(n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n):(n.eligible=!1,n.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",n)}U(e){var t;if(!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}K(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.te(r)}))}Y(e){try{var t=iu.querySelector(xs(e,!0));null!=t&&t.shadowRoot&&Xo(null,t.shadowRoot),null==t||t.remove()}catch(t){_a.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.q,removeSurveyFromFocus:this.j,surveyInFocus:this.$,surveyTimeouts:this.F,handleWidget:this.V,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.G,sortSurveysByAppearanceDelay:this.J,checkFlags:this.K.bind(this),isSurveyFeatureFlagEnabled:this.te.bind(this)}}}function hu(e,t){if(iu&&nu){var r,n=new du(e);if(e.config.disable_surveys_automatic_display)return _a.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===t)return _a.info("There are no surveys to load or Surveys is disabled in the project settings."),n;n.callSurveysAndEvaluateDisplayLogic(!0);var i=()=>{Xr(r)&&(r=setInterval((()=>{n.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return i(),bi(iu,"visibilitychange",(()=>{iu.hidden?Xr(r)||(clearInterval(r),r=void 0):(n.callSurveysAndEvaluateDisplayLogic(!1),i())})),n}}function vu(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;da((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,i=t.type===xa.Widget,o=bs(t),a=(null==(e=t.appearance)?void 0:e.widgetType)===Ia.Tab&&i;if(!o)return _a.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);a&&(_a.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};bi(nu,"popstate",o),bi(nu,"hashchange",o);var a=nu.history.pushState,s=nu.history.replaceState;return nu.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},nu.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},()=>{nu.removeEventListener("popstate",o),nu.removeEventListener("hashchange",o),nu.history.pushState=a,nu.history.replaceState=s}}}),[i,t,r,n])}function fu(e){switch(void 0===e&&(e=ka.Right),e){case ka.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case ka.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case ka.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case ka.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function pu(e){var t,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:y=(()=>{}),properties:g,isSurveyCompleted:b}=e,w=ha(null),C=Number.isInteger(h),I=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(e,t,r,n,i,o,a){var[s,u]=ca(n||0===r||e.type===xa.ExternalSurvey),[l,c]=ca(!1),d=()=>{var t=()=>{o&&i(e),u(!1)};iu.startViewTransition?iu.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},h=t=>{t.detail.surveyId===e.id&&d()};return da((()=>{if(t){if(!n){var i=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{d()}),5e3)}},o=()=>{bs(e)&&(u(!0),nu.dispatchEvent(new Event("PHSurveyShown")),t.capture(Ma.SHOWN,{[Ra.SURVEY_NAME]:e.name,[Ra.SURVEY_ID]:e.id,[Ra.SURVEY_ITERATION]:e.current_iteration,[Ra.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(bi(nu,"PHSurveyClosed",h),bi(nu,"PHSurveySent",i),r>0){var a=setTimeout(o,r);return()=>{clearTimeout(a),nu.removeEventListener("PHSurveyClosed",h),nu.removeEventListener("PHSurveySent",i)}}return o(),()=>{nu.removeEventListener("PHSurveyClosed",h),nu.removeEventListener("PHSurveySent",i)}}}else _a.error("usePopupVisibility hook called without a PostHog instance.")}),[]),vu({survey:e,removeSurveyFromFocus:i,setSurveyVisible:u,isPreviewMode:n}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:u,hidePopupWithViewTransition:d}}(u,c,I,C,v,f,w),A=k||h===u.questions.length||!0===b,T=va((()=>{var e=Is(u);return{isPreviewMode:C,previewPageIndex:h,onPopupSurveyDismissed:()=>{ls(u,c,C),m()},isPopup:f||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Ya(),onPreviewSubmit:p,posthog:c,properties:g}}),[C,h,f,c,u,m,p,g]);return S?Ns(ps.Provider,{value:T,children:Ns("div",{className:"ph-survey",style:r({},As(u.type,null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:w,children:A?Ns(Hs,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(a=u.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||es,onClose:()=>{x(),y()}}):Ns(mu,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function mu(e){var t,{survey:n,forceDisableHtml:i,posthog:o}=e,[a,s]=ca((()=>{var e=Is(n);return null!=e&&e.responses&&_a.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:v,properties:f}=fa(ps),[p,m]=ca((()=>{var e=Is(n);return u||(null==e?void 0:e.lastQuestionIndex)||0})),y=va((()=>vs(n)),[n]);da((()=>{v&&!Xr(u)&&m(u)}),[u,v]);var g=y.at(p);return g?Ns("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=n.appearance)?void 0:t.hideCancelButton)&&Ns(js,{onClick:()=>{l()}}),Ns("div",{className:"survey-box",children:gu({question:g,forceDisableHtml:i,displayQuestionIndex:p,appearance:n.appearance||es,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:i,questionId:u}=e;if(o)if(u){var l=Qa(u),c=r({},a,{[l]:t});s(c);var d=ru(n,i,t),v=d===Ta.End;v||(m(d),Cs(n,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(n.enable_partial_responses||v)&&as({responses:c,survey:n,surveySubmissionId:h,isSurveyCompleted:v,posthog:o,properties:f})}else _a.error("onNextButtonClick called without a questionId.");else _a.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:p,questionId:g.id}),onPreviewSubmit:d,initialValue:g.id?a[Qa(g.id)]:void 0})})]}):null}function yu(e){var t,r,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,readOnly:d}=e,[h,v]=ca(!0),[f,p]=ca(!1),[m,y]=ca({}),g=()=>{p(!f)};if(da((()=>{var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(_a.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),g())};return bi(nu,ou,t),()=>{nu.removeEventListener(ou,t)}}}else _a.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(n=u.appearance)?void 0:n.borderColor]),vu({survey:u,setSurveyVisible:v}),!h)return null;var b=()=>{u.schedule!==Na.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Ns(Ro,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&Ns("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===ka.Top?"widget-tab-top":""),onClick:g,disabled:d,style:fu(null==(a=u.appearance)?void 0:a.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),f&&Ns(pu,{posthog:c,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var gu=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l={forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{s(e)},onSubmit:e=>{a(e)},initialValue:u,displayQuestionIndex:i};switch(t.type){case Aa.Open:return No(Gs,r({},l,{question:t,key:t.id}));case Aa.Link:return No(Ws,r({},l,{question:t,key:t.id}));case Aa.Rating:return No(zs,r({},l,{question:t,key:t.id}));case Aa.SingleChoice:case Aa.MultipleChoice:return No(Us,r({},l,{question:t,key:t.id}));default:return _a.error("Unsupported question type: "+t.type),null}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.generateSurveys=hu,ui.extendPostHogWithSurveys=hu;class bu{emit(e){}}var wu=new bu;var Cu=new class{getLogger(e,t,r){return new bu}};class Iu{constructor(e,t,r,n){this.ne=e,this.name=t,this.version=r,this.options=n}emit(e){this.ie().emit(e)}ie(){if(this.oe)return this.oe;var e=this.ne.ae(this.name,this.version,this.options);return e?(this.oe=e,this.oe):wu}}class Su{getLogger(e,t,r){var n;return null!==(n=this.ae(e,t,r))&&void 0!==n?n:new Iu(this,e,t,r)}se(){var e;return null!==(e=this.oe)&&void 0!==e?e:Cu}ue(e){this.oe=e}ae(e,t,r){var n;return null===(n=this.oe)||void 0===n?void 0:n.getLogger(e,t,r)}}var ku="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},xu=Symbol.for("io.opentelemetry.js.api.logs"),Au=ku;class Tu{constructor(){this.le=new Su}static getInstance(){return this._instance||(this._instance=new Tu),this._instance}setGlobalLoggerProvider(e){return Au[xu]?this.getLoggerProvider():(Au[xu]=(t=1,r=e,n=Cu,e=>e===t?r:n),this.le.ue(e),e);var t,r,n}getLoggerProvider(){var e,t;return null!==(t=null===(e=Au[xu])||void 0===e?void 0:e.call(Au,1))&&void 0!==t?t:this.le}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Au[xu],this.le=new Su}}var Nu=Tu.getInstance();class Mu{constructor(e){this.oe=void 0,this.oe=e}export(e,t){this.oe.export(e,t)}forceFlush(){return this.oe.forceFlush()}shutdown(){return this.oe.shutdown()}}class Ru extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function _u(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Eu{constructor(e){this.ce=void 0,this.de=[],this.ce=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.de.push(e);var t=()=>{var t=this.de.indexOf(e);this.de.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this.de.length>=this.ce}awaitAll(){var e=this;return t((function*(){yield Promise.all(e.de)}))()}}function Fu(e){return new Eu(e.concurrencyLimit)}var Ou="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Lu="1.9.0",Bu=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Zu=function(e){var t=new Set([e]),r=new Set,n=e.match(Bu);if(!n)return function(){return!1};var i=+n[1],o=+n[2],a=+n[3];if(null!=n[4])return function(t){return t===e};function s(e){return r.add(e),!1}function u(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(Bu);if(!n)return s(e);var l=+n[1],c=+n[2],d=+n[3];return null!=n[4]||i!==l?s(e):0===i?o===c&&a<=d?u(e):s(e):o<=c?u(e):s(e)}}(Lu),Pu=Lu.split(".")[0],Du=Symbol.for("opentelemetry.js.api."+Pu),qu=Ou;function ju(e,t,r,n){var i;void 0===n&&(n=!1);var o=qu[Du]=null!==(i=qu[Du])&&void 0!==i?i:{version:Lu};if(!n&&o[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(o.version!==Lu){a=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+Lu);return r.error(a.stack||a.message),!1}return o[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Lu+"."),!0}function Vu(e){var t,r,n=null===(t=qu[Du])||void 0===t?void 0:t.version;if(n&&Zu(n))return null===(r=qu[Du])||void 0===r?void 0:r[e]}function Hu(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Lu+".");var r=qu[Du];r&&delete r[e]}var Yu,Gu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Wu=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},zu=function(){function e(e){this.he=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("debug",this.he,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("error",this.he,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("info",this.he,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("warn",this.he,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xu("verbose",this.he,e)},e}();function Xu(e,t,r){var n=Vu("diag");if(n)return r.unshift(t),n[e].apply(n,Wu([],Gu(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Yu||(Yu={}));var Uu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Ku=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Ju=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=Vu("diag");if(n)return n[e].apply(n,Ku([],Uu(t),!1))}}var t=this;t.setLogger=function(e,r){var n,i,o;if(void 0===r&&(r={logLevel:Yu.INFO}),e===t){var a=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(n=a.stack)&&void 0!==n?n:a.message),!1}"number"==typeof r&&(r={logLevel:r});var s=Vu("diag"),u=function(e,t){function r(r,n){var i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<Yu.NONE?e=Yu.NONE:e>Yu.ALL&&(e=Yu.ALL),t=t||{},{error:r("error",Yu.ERROR),warn:r("warn",Yu.WARN),info:r("info",Yu.INFO),debug:r("debug",Yu.DEBUG),verbose:r("verbose",Yu.VERBOSE)}}(null!==(i=r.logLevel)&&void 0!==i?i:Yu.INFO,e);if(s&&!r.suppressOverrideMessage){var l=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";s.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return ju("diag",u,t,!0)},t.disable=function(){Hu("diag",t)},t.createComponentLogger=function(e){return new zu(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Qu(e){return Symbol.for(e)}var $u,el=function e(t){var r=this;r.ve=t?new Map(t):new Map,r.getValue=function(e){return r.ve.get(e)},r.setValue=function(t,n){var i=new e(r.ve);return i.ve.set(t,n),i},r.deleteValue=function(t){var n=new e(r.ve);return n.ve.delete(t),n}},tl=new el,rl=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},nl=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},il=function(){function e(){}return e.prototype.active=function(){return tl},e.prototype.with=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return t.call.apply(t,nl([r],rl(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),ol=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},al=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},sl="context",ul=new il,ll=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return ju(sl,e,Ju.instance())},e.prototype.active=function(){return this.fe().active()},e.prototype.with=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return(n=this.fe()).with.apply(n,al([e,t,r],ol(i),!1))},e.prototype.bind=function(e,t){return this.fe().bind(e,t)},e.prototype.fe=function(){return Vu(sl)||ul},e.prototype.disable=function(){this.fe().disable(),Hu(sl,Ju.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}($u||($u={}));var cl="0000000000000000",dl="00000000000000000000000000000000",hl={traceId:dl,spanId:cl,traceFlags:$u.NONE},vl=function(){function e(e){void 0===e&&(e=hl),this.pe=e}return e.prototype.spanContext=function(){return this.pe},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),fl=Qu("OpenTelemetry Context Key SPAN");function pl(e){return e.getValue(fl)||void 0}function ml(){return pl(ll.getInstance().active())}function yl(e,t){return e.setValue(fl,t)}function gl(e){return e.deleteValue(fl)}function bl(e,t){return yl(e,new vl(t))}function wl(e){var t;return null===(t=pl(e))||void 0===t?void 0:t.spanContext()}var Cl=/^([0-9a-f]{32})$/i,Il=/^[0-9a-f]{16}$/i;function Sl(e){return r=e.traceId,Cl.test(r)&&r!==dl&&(t=e.spanId,Il.test(t)&&t!==cl);var t,r}function kl(e){return new vl(e)}var xl=ll.getInstance(),Al=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=xl.active()),Boolean(null==t?void 0:t.root))return new vl;var n,i=r&&wl(r);return"object"==typeof(n=i)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&Sl(i)?new vl(i):new vl},e.prototype.startActiveSpan=function(e,t,r,n){var i,o,a;if(!(arguments.length<2)){2===arguments.length?a=t:3===arguments.length?(i=t,a=r):(i=t,o=r,a=n);var s=null!=o?o:xl.active(),u=this.startSpan(e,i,s),l=yl(s,u);return xl.with(l,a,void 0,u)}},e}();var Tl=new Al,Nl=function(){function e(e,t,r,n){this.ne=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this.me().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){var i=this.me();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype.me=function(){if(this.oe)return this.oe;var e=this.ne.getDelegateTracer(this.name,this.version,this.options);return e?(this.oe=e,this.oe):Tl},e}(),Ml=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Al},e}()),Rl=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!==(n=this.getDelegateTracer(e,t,r))&&void 0!==n?n:new Nl(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this.oe)&&void 0!==e?e:Ml},e.prototype.setDelegate=function(e){this.oe=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null===(n=this.oe)||void 0===n?void 0:n.getTracer(e,t,r)},e}(),_l=ll.getInstance(),El=Ju.instance(),Fl="trace",Ol=function(){function e(){this.ye=new Rl,this.wrapSpanContext=kl,this.isSpanContextValid=Sl,this.deleteSpan=gl,this.getSpan=pl,this.getActiveSpan=ml,this.getSpanContext=wl,this.setSpan=yl,this.setSpanContext=bl}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=ju(Fl,this.ye,Ju.instance());return t&&this.ye.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Vu(Fl)||this.ye},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Hu(Fl,Ju.instance()),this.ye=new Rl},e}().getInstance(),Ll=Qu("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Bl(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var n=typeof r;if(n!==t){if(!t){if(Zl(n)){t=n;continue}return!1}return!1}}return!0}(e):Zl(typeof e))}function Zl(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}var Pl=e=>{El.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var n=r[e];n&&(t[e]=String(n))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))};function Dl(e){try{Pl(e)}catch(e){}}var ql,jl=performance,Vl="telemetry.sdk.language",Hl="telemetry.sdk.name",Yl="telemetry.sdk.version",Gl={[Hl]:"opentelemetry","process.runtime.name":"browser",[Vl]:"webjs",[Yl]:"2.2.0"},Wl=Math.pow(10,6),zl=Math.pow(10,9);function Xl(e){var t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Wl)]}function Ul(){var e=jl.timeOrigin;if("number"!=typeof e){var t=jl;e=t.timing&&t.timing.fetchStart}return e}function Kl(e){return function(e,t){var r=[e[0]+t[0],e[1]+t[1]];r[1]>=zl&&(r[1]-=zl,r[0]+=1);return r}(Xl(Ul()),Xl("number"==typeof e?e:jl.now()))}function Jl(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Ul()?Kl(e):Xl(e);if(e instanceof Date)return Xl(e.getTime());throw TypeError("Invalid input type");var t}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(ql||(ql={}));var Ql="[object Object]",$l="[object Null]",ec="[object Undefined]",tc=Function.prototype.toString,rc=tc.call(Object),nc=Object.getPrototypeOf,ic=Object.prototype,oc=ic.hasOwnProperty,ac=Symbol?Symbol.toStringTag:void 0,sc=ic.toString;function uc(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){if(null==e)return void 0===e?ec:$l;return ac&&ac in Object(e)?function(e){var t=oc.call(e,ac),r=e[ac],n=!1;try{e[ac]=void 0,n=!0}catch(e){}var i=sc.call(e);n&&(t?e[ac]=r:delete e[ac]);return i}(e):function(e){return sc.call(e)}(e)}(e)!==Ql)return!1;var t=nc(e);if(null===t)return!0;var r=oc.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&tc.call(r)===rc}var lc=20;function cc(e){return vc(e)?e.slice():e}function dc(e,t,r,n){var i;if(void 0===r&&(r=0),!(r>lc)){if(r++,mc(e)||mc(t)||fc(t))i=cc(t);else if(vc(e)){if(i=e.slice(),vc(t))for(var o=0,a=t.length;o<a;o++)i.push(cc(t[o]));else if(pc(t))for(var s=Object.keys(t),u=0,l=s.length;u<l;u++){var c=s[u];i[c]=cc(t[c])}}else if(pc(e))if(pc(t)){if(!function(e,t){if(!uc(e)||!uc(t))return!1;return!0}(e,t))return t;i=Object.assign({},e);for(var d=Object.keys(t),h=0,v=d.length;h<v;h++){var f=d[h],p=t[f];if(mc(p))void 0===p?delete i[f]:i[f]=p;else{var m=i[f],y=p;if(hc(e,f,n)||hc(t,f,n))delete i[f];else{if(pc(m)&&pc(y)){var g=n.get(m)||[],b=n.get(y)||[];g.push({obj:e,key:f}),b.push({obj:t,key:f}),n.set(m,g),n.set(y,b)}i[f]=dc(i[f],p,r,n)}}}}else i=t;return i}}function hc(e,t,r){for(var n=r.get(e[t])||[],i=0,o=n.length;i<o;i++){var a=n[i];if(a.key===t&&a.obj===e)return!0}return!1}function vc(e){return Array.isArray(e)}function fc(e){return"function"==typeof e}function pc(e){return!mc(e)&&!vc(e)&&!fc(e)&&"object"==typeof e}function mc(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class yc extends Error{constructor(e){super(e),Object.setPrototypeOf(this,yc.prototype)}}function gc(e,t){var r,n=new Promise((function(e,n){r=setTimeout((function(){n(new yc("Operation timed out."))}),t)}));return Promise.race([e,n]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class bc{constructor(){this.ge=void 0,this.be=void 0,this.we=void 0,this.ge=new Promise(((e,t)=>{this.be=e,this.we=t}))}get promise(){return this.ge}resolve(e){this.be(e)}reject(e){this.we(e)}}class wc{constructor(e,t){this.Ce=void 0,this.Ie=void 0,this.Se=!1,this.ke=new bc,this.Ce=e,this.Ie=t}get isCalled(){return this.Se}get promise(){return this.ke.promise}call(){if(!this.Se){this.Se=!0;try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Promise.resolve(this.Ce.call(this.Ie,...t)).then((e=>this.ke.resolve(e)),(e=>this.ke.reject(e)))}catch(e){this.ke.reject(e)}}return this.ke.promise}}var Cc={xe:function(e,t){return new Promise((r=>{_l.with(function(e){return e.setValue(Ll,!0)}(_l.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))}};function Ic(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&El.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Sc{constructor(e,t,r,n,i){this.Ae=void 0,this.Te=void 0,this.Ne=void 0,this.Me=void 0,this.Re=void 0,this._e=void 0,this.Ae=e,this.Te=t,this.Ne=r,this.Me=n,this.Re=i,this._e=El.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._e.debug("items to be sent",e),this.Me.hasReachedLimit())t({code:ql.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Te.serializeRequest(e);null!=r?this.Me.pushPromise(this.Ae.send(r,this.Re).then((e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:ql.FAILED,error:e.error}):"retryable"===e.status?t({code:ql.FAILED,error:new Ru("Export failed with retryable status")}):t({code:ql.FAILED,error:new Ru("Export failed with unknown error")});else{if(null!=e.data)try{this.Ne.handleResponse(this.Te.deserializeResponse(e.data))}catch(t){this._e.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:ql.SUCCESS})}}),(e=>t({code:ql.FAILED,error:e})))):t({code:ql.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Me.awaitAll()}shutdown(){var e=this;return t((function*(){e._e.debug("shutdown started"),yield e.forceFlush(),e.Ae.shutdown()}))()}}function kc(e,t,r){return n={transport:r,serializer:t,promiseHandler:Fu(e)},i={timeout:e.timeoutMillis},new Sc(n.transport,n.serializer,Ic(),n.promiseHandler,i.timeout);var n,i}function xc(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Ac(e){for(var t=new Uint8Array(e.length/2),r=0,n=0;n<e.length;n+=2){var i=xc(e.charCodeAt(n)),o=xc(e.charCodeAt(n+1));t[r++]=i<<4|o}return t}function Tc(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Nc(e){var t,r=Tc(e);return t=r,{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var Mc="undefined"!=typeof BigInt?function(e){return Tc(e).toString()}:function(e){return e[0]*zl+e[1]};function Rc(e){return e}function _c(e){if(void 0!==e)return Ac(e)}var Ec={encodeHrTime:Nc,encodeSpanContext:Ac,encodeOptionalSpanContext:_c};function Fc(e,t){return{key:e,value:Oc(t)}}function Oc(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Oc)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return Fc(t,r)}))}}:{}}function Lc(e,t){var r=function(e){var t,r;if(void 0===e)return Ec;var n=null===(t=e.useLongBits)||void 0===t||t,i=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:n?Nc:Mc,encodeSpanContext:i?Rc:Ac,encodeOptionalSpanContext:i?Rc:_c}}(t);return{resourceLogs:Bc(e,r)}}function Bc(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:a=""}}=r,s=t.get(n);s||(s=new Map,t.set(n,s));var u=i+"@"+o+":"+a,l=s.get(u);l||(l=[],s.set(u,l)),l.push(r)}return t}(e);return Array.from(r,(e=>{var[r,n]=e,i=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>Fc(e,t[e])))),droppedAttributesCount:0},n=e.schemaUrl;return n&&""!==n&&(r.schemaUrl=n),r}(r);return{resource:i,scopeLogs:Array.from(n,(e=>{var r,[,n]=e;return{scope:(r=n[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:n.map((e=>function(e,t){var r,n,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Oc(e.body),eventName:e.eventName,attributes:Zc(e.attributes),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.traceId),spanId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.spanId)}}(e,t))),schemaUrl:n[0].instrumentationScope.schemaUrl}})),schemaUrl:i.schemaUrl}}))}function Zc(e){return Object.keys(e).map((t=>Fc(t,e[t])))}var Pc=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Dc{static FromAttributeList(e,t){var r=new Dc({},t);return r.Ee=jc(e),r.Fe=e.filter((e=>{var[t,r]=e;return Pc(r)})).length>0,r}constructor(e,t){var r;this.Ee=void 0,this.Fe=!1,this.Oe=void 0,this.Le=void 0;var n=null!==(r=e.attributes)&&void 0!==r?r:{};this.Ee=Object.entries(n).map((e=>{var[t,r]=e;return Pc(r)&&(this.Fe=!0),[t,r]})),this.Ee=jc(this.Ee),this.Oe=function(e){if("string"==typeof e||void 0===e)return e;return void El.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this.Fe}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;t<e.Ee.length;t++){var[r,n]=e.Ee[t];e.Ee[t]=[r,Pc(n)?yield n:n]}e.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&El.error("Accessing resource attributes before async attributes settled"),this.Le)return this.Le;var e={};for(var[t,r]of this.Ee){var n;if(Pc(r))El.debug("Unsettled resource attribute "+t+" skipped");else if(null!=r)null!==(n=e[t])&&void 0!==n||(e[t]=r)}return this.Fe||(this.Le=e),e}getRawAttributes(){return this.Ee}get schemaUrl(){return this.Oe}merge(e){if(null==e)return this;var t=function(e,t){var r=null==e?void 0:e.schemaUrl,n=null==t?void 0:t.schemaUrl,i=void 0===r||""===r,o=void 0===n||""===n;if(i)return n;if(o)return r;if(r===n)return r;return void El.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}(this,e),r=t?{schemaUrl:t}:void 0;return Dc.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}}function qc(e,t){return Dc.FromAttributeList(Object.entries(e),t)}function jc(e){return e.map((e=>{var[t,r]=e;return Pc(r)?[t,r.catch((e=>{El.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Vc={serializeRequest:e=>{var t=Lc(e,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Hc{constructor(e){this.Ae=void 0,this.Ae=e}retry(e,t,r){return new Promise(((n,i)=>{setTimeout((()=>{this.Ae.send(e,t).then(n,i)}),r)}))}send(e,r){var n=this;return t((function*(){for(var t=Date.now()+r,i=yield n.Ae.send(e,r),o=5,a=1e3;"retryable"===i.status&&o>0;){var s;o--;var u=Math.max(Math.min(a,5e3)+(.4*Math.random()-.2),0);a*=1.5;var l=null!==(s=i.retryInMillis)&&void 0!==s?s:u,c=t-Date.now();if(l>c)return i;i=yield n.retry(e,c,l)}return i}))()}shutdown(){return this.Ae.shutdown()}}function Yc(e){return new Hc(e.transport)}function Gc(e){return[429,502,503,504].includes(e)}function Wc(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}class zc{constructor(e){this.Be=void 0,this.Be=e}send(e,r){var n=this;return t((function*(){var t=yield n.Be.headers(),i=yield new Promise((i=>{var o=new XMLHttpRequest;o.timeout=r,o.open("POST",n.Be.url),Object.entries(t).forEach((e=>{var[t,r]=e;o.setRequestHeader(t,r)})),o.ontimeout=e=>{i({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(El.debug("XHR success"),i({status:"success"})):o.status&&Gc(o.status)?i({status:"retryable",retryInMillis:Wc(o.getResponseHeader("Retry-After"))}):0!==o.status&&i({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{i({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{i({status:"failure",error:new Error("XHR request errored")})},o.send(e)}));return i}))()}shutdown(){}}class Xc{constructor(e){this.Ze=void 0,this.Ze=e}send(e){var r=this;return t((function*(){var t=(yield r.Ze.headers())["Content-Type"];return new Promise((n=>{navigator.sendBeacon(r.Ze.url,new Blob([e],{type:t}))?(El.debug("SendBeacon success"),n({status:"success"})):n({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Uc{constructor(e){this.Be=void 0,this.Be=e}send(e,r){var n=this;return t((function*(){var t=new AbortController,i=setTimeout((()=>t.abort()),r);try{var o,a=!!globalThis.location,s=new URL(n.Be.url),u=yield fetch(s.href,{method:"POST",headers:yield n.Be.headers(),body:e,signal:t.signal,keepalive:a,mode:a?(null==(o=globalThis.location)?void 0:o.origin)===s.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(El.debug("response success"),{status:"success"}):Gc(u.status)?{status:"retryable",retryInMillis:Wc(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(i)}}))()}shutdown(){}}function Kc(e,t){return kc(e,t,Yc({transport:(r=e,new zc(r))}));var r}function Jc(e,t){return kc(e,t,Yc({transport:(r=e,new Uc(r))}));var r}function Qc(e,t){return kc(e,t,Yc({transport:(r={url:e.url,headers:e.headers},new Xc(r))}));var r}function $c(e,n,i){return t((function*(){var t=r({},yield i()),o={};return null!=n&&Object.assign(o,yield n()),null!=e&&Object.assign(o,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,n]=e;void 0!==n?t[r]=String(n):El.warn('Header "'+r+'" has invalid value ('+n+") and will be ignored")})),t}(yield e())),Object.assign(o,t)}))}function ed(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function td(e,t,n){var i,o;return r({},function(e,t,r){var n,i,o,a,s,u;return{timeoutMillis:_u(null!==(n=null!==(i=e.timeoutMillis)&&void 0!==i?i:t.timeoutMillis)&&void 0!==n?n:r.timeoutMillis),concurrencyLimit:null!==(o=null!==(a=e.concurrencyLimit)&&void 0!==a?a:t.concurrencyLimit)&&void 0!==o?o:r.concurrencyLimit,compression:null!==(s=null!==(u=e.compression)&&void 0!==u?u:t.compression)&&void 0!==s?s:r.compression}}(e,t,n),{headers:$c(e.headers,t.headers,n.headers),url:null!==(i=null!==(o=ed(e.url))&&void 0!==o?o:t.url)&&void 0!==i?i:n.url})}function rd(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function nd(e,n,i){return td({url:e.url,timeoutMillis:e.timeoutMillis,headers:rd(e),concurrencyLimit:e.concurrencyLimit},{},function(e,n){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(i=t((function*(){return e})),function(){return i.apply(this,arguments)}),url:"http://localhost:4318/"+n});var i}(i,n))}function id(e,t,r,n){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Jc:Kc:Qc)(nd(e,r,n),t)}class od extends Mu{constructor(e){void 0===e&&(e={}),super(id(e,Vc,"v1/logs",{"Content-Type":"application/json"}))}}class ad{set severityText(e){this.Pe()||(this.De=e)}get severityText(){return this.De}set severityNumber(e){this.Pe()||(this.qe=e)}get severityNumber(){return this.qe}set body(e){this.Pe()||(this.je=e)}get body(){return this.je}get eventName(){return this.Ve}set eventName(e){this.Pe()||(this.Ve=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.De=void 0,this.qe=void 0,this.je=void 0,this.Ve=void 0,this.totalAttributesCount=0,this.He=!1,this.Ye=void 0;var{timestamp:n,observedTimestamp:i,eventName:o,severityNumber:a,severityText:s,body:u,attributes:l={},context:c}=r,d=Date.now();if(this.hrTime=Jl(null!=n?n:d),this.hrTimeObserved=Jl(null!=i?i:d),c){var h=Ol.getSpanContext(c);h&&Sl(h)&&(this.spanContext=h)}this.severityNumber=a,this.severityText=s,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this.Ye=e.logRecordLimits,this.Ve=o,this.setAttributes(l)}setAttribute(e,t){return this.Pe()||null===t?this:0===e.length?(El.warn("Invalid attribute key: "+e),this):Bl(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.Ye.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(1===this.droppedAttributesCount&&El.warn("Dropping extra attributes."),this):(Bl(t)?this.attributes[e]=this.Ge(t):this.attributes[e]=t,this)):(El.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}We(){this.He=!0}Ge(e){var t=this.Ye.attributeValueLengthLimit;return t<=0?(El.warn("Attribute value limit must be positive, got "+t),e):"string"==typeof e?this.ze(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this.ze(e,t):e)):e}ze(e,t){return e.length<=t?e:e.substring(0,t)}Pe(){return this.He&&El.warn("Can not execute the operation on emitted log record"),this.He}}class sd{constructor(e,t){this.instrumentationScope=void 0,this.Xe=void 0,this.instrumentationScope=e,this.Xe=t}emit(e){var t=e.context||_l.active(),n=new ad(this.Xe,this.instrumentationScope,r({context:t},e));this.Xe.activeProcessor.onEmit(n,t),n.We()}}class ud{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class ld{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>gc(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class cd{constructor(e,t,r,n){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=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=n,n.length>0?(this.registeredLogRecordProcessors=n,this.activeProcessor=new ld(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ud}}class dd{constructor(e){var t,r,n;void 0===e&&(e={}),this.Ue=void 0,this.Xe=void 0;var i,o,a,s,u,l,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.shift(),i=new WeakMap;t.length>0;)n=dc(n,t.shift(),0,i);return n}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:qc({"service.name":"unknown_service",[Vl]:Gl[Vl],[Hl]:Gl[Hl],[Yl]:Gl[Yl]});this.Xe=new cd(h,d.forceFlushTimeoutMillis,(i=d.logRecordLimits,{attributeCountLimit:null!==(o=null!==(a=null!==(s=i.attributeCountLimit)&&void 0!==s?s:void 0)&&void 0!==a?a:void 0)&&void 0!==o?o:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(c=i.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(n=e)?void 0:n.processors)&&void 0!==r?r:[]),this.Ue=new wc(this.Ke,this)}getLogger(e,t,r){if(this.Ue.isCalled)return El.warn("A shutdown LoggerProvider cannot provide a Logger"),wu;e||El.warn("Logger requested without instrumentation scope name.");var n=e||"unknown",i=n+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Xe.loggers.has(i)||this.Xe.loggers.set(i,new sd({name:n,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this.Xe)),this.Xe.loggers.get(i)}forceFlush(){return this.Ue.isCalled?(El.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.Ue.promise):this.Xe.activeProcessor.forceFlush()}shutdown(){return this.Ue.isCalled?(El.warn("shutdown may only be called once per LoggerProvider"),this.Ue.promise):this.Ue.call()}Ke(){return this.Xe.activeProcessor.shutdown()}}class hd{constructor(e,t){var r,n,i,o,a,s,u,l;this.Je=void 0,this.Qe=void 0,this.$e=void 0,this.et=void 0,this.tt=void 0,this.rt=!1,this.nt=[],this.it=void 0,this.Ue=void 0,this.Je=e,this.Qe=null!==(r=null!==(n=null==t?void 0:t.maxExportBatchSize)&&void 0!==n?n:void 0)&&void 0!==r?r:512,this.$e=null!==(i=null!==(o=null==t?void 0:t.maxQueueSize)&&void 0!==o?o:void 0)&&void 0!==i?i:2048,this.et=null!==(a=null!==(s=null==t?void 0:t.scheduledDelayMillis)&&void 0!==s?s:void 0)&&void 0!==a?a:5e3,this.tt=null!==(u=null!==(l=null==t?void 0:t.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.Ue=new wc(this.Ke,this),this.Qe>this.$e&&(El.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.Qe=this.$e)}onEmit(e){this.Ue.isCalled||this.ot(e)}forceFlush(){return this.Ue.isCalled?this.Ue.promise:this.st()}shutdown(){return this.Ue.call()}Ke(){var e=this;return t((function*(){e.onShutdown(),yield e.st(),yield e.Je.shutdown()}))()}ot(e){this.nt.length>=this.$e||(this.nt.push(e),this.ut())}st(){return new Promise(((e,t)=>{for(var r=[],n=Math.ceil(this.nt.length/this.Qe),i=0;i<n;i++)r.push(this.ct());Promise.all(r).then((()=>{e()})).catch(t)}))}ct(){return this.dt(),0===this.nt.length?Promise.resolve():new Promise(((e,t)=>{gc(this.xe(this.nt.splice(0,this.Qe)),this.tt).then((()=>e())).catch(t)}))}ut(){if(!this.rt){var e=()=>{this.rt=!0,this.ct().then((()=>{this.rt=!1,this.nt.length>0&&(this.dt(),this.ut())})).catch((e=>{this.rt=!1,Dl(e)}))};if(this.nt.length>=this.Qe)return e();void 0===this.it&&(this.it=setTimeout((()=>e()),this.et),"number"!=typeof this.it&&this.it.unref())}}dt(){void 0!==this.it&&(clearTimeout(this.it),this.it=void 0)}xe(e){var t=()=>Cc.xe(this.Je,e).then((e=>{var t;e.code!==ql.SUCCESS&&Dl(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Dl),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Dl)}}class vd extends hd{constructor(e,t){super(e,t),this.ht=void 0,this.vt=void 0,this.ft(t)}onShutdown(){"undefined"!=typeof document&&(this.ht&&document.removeEventListener("visibilitychange",this.ht),this.vt&&document.removeEventListener("pagehide",this.vt))}ft(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.ht=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.vt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.ht),document.addEventListener("pagehide",this.vt))}}var fd=1e4,pd=function(e,t,r,n,i){for(var o in void 0===t&&(t=""),void 0===r&&(r={}),void 0===n&&(n=50),void 0===i&&(i=fd),e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=e[o],s=t?t+"."+o:o;if(zr(a))pd(a,s,r,n,i);else{if(n-=1,i-=String(a).length,i-=s.length,n<=0||i<=0)return void(r.attributes_truncated=!0);r[s]=a}}return r},md={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.logs={initializeLogs:e=>{(e=>{var t={"service.name":"posthog-browser-logs",host:ui.location.host};if(e.sessionManager){var{sessionId:n,windowId:i}=e.sessionManager.checkAndGetSessionAndWindowId(!0);t=r({},t,{"session.id":n,"window.id":i})}Nu.setGlobalLoggerProvider(new dd({resource:qc(t),processors:[new vd(new od({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Nu.getLogger("console"),n={};if(e.sessionManager){var{sessionStartTimestamp:i,lastActivityTimestamp:o}=e.sessionManager.checkAndGetSessionAndWindowId(!0);n={sessionStartTimestamp:i.toString(),lastActivityTimestamp:o.toString()}}var a=function(i){var o=(e,t)=>t instanceof Error?r({},t,{name:t.name,message:t.message,stack:t.stack}):t,a=ui.console[i];ui.console[i]=(a=>function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(u.length>0){var c=u.map((e=>JSON.stringify(e,o))).join(" ");c.length>fd&&(c=c.slice(0,fd)+"...",n.body_truncated="true"),t.emit({severityText:md[i],body:c,attributes:r({"log.source":"console."+i,distinct_id:e.get_distinct_id(),"location.href":ui.location.href},n,zr(u[0])?pd(u[0]):{})}),a.apply(ui.console,u)}})(a)};for(var s of["debug","log","warn","error","info"])a(s)}},vi("[Error tracking]");var yd=vi("[ExceptionAutocapture]"),gd=new _n([new Gn,new ti,new zn,new Wn,new $n,new Qn,new Un,new ei],Yn()),bd={wrapOnError:e=>{var t=ri;t||yd.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=i[4],s=i[0],u=gd.buildFromUnknown(a||s,{mechanism:{handled:!1}});return e(u),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=ri;t||yd.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(n){var i,o=gd.buildFromUnknown(n,{mechanism:{handled:!1}});return e(o),null!==(i=null==r?void 0:r.apply(t,[n]))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||yd.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=n.join(" "),a=n.find((e=>e instanceof Error)),s=gd.buildFromUnknown(a||o,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return e(s),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.errorWrappingFunctions=bd,ui.posthogErrorWrappingFunctions=bd;var wd=(e,t,r,n)=>{var i;try{i=new URL(n.url).hostname}catch(e){return}if(!Yr(e)||e.includes(i)){if(r){var{sessionId:o,windowId:a}=r.checkAndGetSessionAndWindowId(!0);n.headers.set("X-POSTHOG-SESSION-ID",o),n.headers.set("X-POSTHOG-WINDOW-ID",a)}"$posthog_cookieless"!==t&&n.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ui.__PosthogExtensions__=ui.__PosthogExtensions__||{};var Cd={_patchFetch:(e,r,n)=>Ci(ri,"fetch",(i=>function(){var o=t((function*(t,o){var a=new Request(t,o);return wd(e,r,n,a),i(a)}));return function(e,t){return o.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ci(ri.XMLHttpRequest.prototype,"open",(n=>function(i,o,a,s,u){void 0===a&&(a=!0);var l=new Request(o);return wd(e,t,r,l),n.call(this,i,l.url,a,s,u)}))};ui.__PosthogExtensions__.tracingHeadersPatchFns=Cd,ui.postHogTracingHeadersPatchFns=Cd;var Id=-1,Sd=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Id=t.timeStamp,e(t))}),!0)},kd=(e,t,r,n)=>{var i,o;return a=>{t.value>=0&&(a||n)&&(((o=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},xd=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Ad=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Td=()=>{var e,t=Ad();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},Nd=function(e,t){void 0===t&&(t=-1);var r=Ad(),n="navigate";return Id>=0?n="back-forward-cache":r&&(document.prerendering||Td()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Md=new WeakMap;function Rd(e,t){return Md.get(e)||Md.set(e,new t),Md.get(e)}let _d=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var Ed,Fd=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},Od=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Ld=-1,Bd=new Set,Zd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Pd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Bd)t();isFinite(Ld)||(Ld="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Pd,!0))}},Dd=()=>{if(Ld<0){var e,t=Td(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;Ld=null!=r?r:Zd(),addEventListener("visibilitychange",Pd,!0),addEventListener("prerenderingchange",Pd,!0),Sd((()=>{setTimeout((()=>{Ld=Zd()}))}))}return{get firstHiddenTime(){return Ld},onHidden(e){Bd.add(e)}}},qd=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},jd=[1800,3e3],Vd=function(e,t){void 0===t&&(t={}),qd((()=>{var r,n=Dd(),i=Nd("FCP"),o=Fd("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Td(),0),i.entries.push(t),r(!0)))}));o&&(r=kd(e,i,jd,t.reportAllChanges),Sd((n=>{i=Nd("FCP"),r=kd(e,i,jd,t.reportAllChanges),xd((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Hd=[.1,.25],Yd=function(e,t){void 0===t&&(t={});var r=Dd();Vd(Od((()=>{var n,i=Nd("CLS",0),o=Rd(t,_d),a=e=>{for(var t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=Fd("layout-shift",a);s&&(n=kd(e,i,Hd,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Sd((()=>{o.i=0,i=Nd("CLS",0),n=kd(e,i,Hd,t.reportAllChanges),xd((()=>n()))})),setTimeout(n))})))},Gd=0,Wd=1/0,zd=0,Xd=e=>{for(var t of e)t.interactionId&&(Wd=Math.min(Wd,t.interactionId),zd=Math.max(zd,t.interactionId),Gd=zd?(zd-Wd)/7+1:0)},Ud=()=>{var e;return Ed?Gd:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Kd=0;let Jd=class{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Kd=Ud(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((Ud()-Kd)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>r.P){var i;if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var o=this.u.splice(10);for(var a of o)this.l.delete(a.id)}null==(i=this.p)||i.call(this,n)}}}};var Qd=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Od(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},$d=[200,500],eh=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Dd();qd((()=>{var n;"interactionCount"in performance||Ed||(Ed=Fd("event",Xd,{type:"event",buffered:!0,durationThreshold:0}));var i,o=Nd("INP"),a=Rd(t,Jd),s=e=>{Qd((()=>{for(var t of e)a.h(t);var r=a.L();r&&r.P!==o.value&&(o.value=r.P,o.entries=r.entries,i())}))},u=Fd("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=kd(e,o,$d,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),Sd((()=>{a.v(),o=Nd("INP"),i=kd(e,o,$d,t.reportAllChanges)})))}))}};let th=class{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var rh=[2500,4e3],nh=function(e,t){void 0===t&&(t={}),qd((()=>{var r,n=Dd(),i=Nd("LCP"),o=Rd(t,th),a=e=>{for(var a of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(a),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-Td(),0),i.entries=[a],r())},s=Fd("largest-contentful-paint",a);if(s){r=kd(e,i,rh,t.reportAllChanges);var u=Od((()=>{a(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Qd(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});Sd((n=>{i=Nd("LCP"),r=kd(e,i,rh,t.reportAllChanges),xd((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))};class ih{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],n=this.i.at(-1);this.o&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}}var oh=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ah=e=>{if("loading"===document.readyState)return"loading";var t=oh();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},sh=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},uh=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,n=e,i=n.id?"#"+n.id:[sh(n),...Array.from(n.classList).sort()].join(".");if(t.length+i.length>99)return t||i;if(t=t?i+">"+t:i,n.id)break;e=n.parentNode}}catch(e){}return t},lh=new WeakMap;function ch(e,t){return lh.get(e)||lh.set(e,new t),lh.get(e)}var dh,hh=-1,vh=()=>hh,fh=e=>{addEventListener("pageshow",(t=>{t.persisted&&(hh=t.timeStamp,e(t))}),!0)},ph=(e,t,r,n)=>{var i,o;return a=>{t.value>=0&&(a||n)&&(((o=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},mh=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},yh=()=>{var e,t=oh();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},gh=function(e,t){void 0===t&&(t=-1);var r=oh(),n="navigate";return vh()>=0?n="back-forward-cache":r&&(document.prerendering||yh()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},bh=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},wh=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Ch=-1,Ih=new Set,Sh=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kh=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Ih)t();isFinite(Ch)||(Ch="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",kh,!0))}},xh=()=>{if(Ch<0){var e,t=yh(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;Ch=null!=r?r:Sh(),addEventListener("visibilitychange",kh,!0),addEventListener("prerenderingchange",kh,!0),fh((()=>{setTimeout((()=>{Ch=Sh()}))}))}return{get firstHiddenTime(){return Ch},onHidden(e){Ih.add(e)}}},Ah=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Th=[1800,3e3],Nh=function(e,t){void 0===t&&(t={}),Ah((()=>{var r,n=xh(),i=gh("FCP"),o=bh("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-yh(),0),i.entries.push(t),r(!0)))}));o&&(r=ph(e,i,Th,t.reportAllChanges),fh((n=>{i=gh("FCP"),r=ph(e,i,Th,t.reportAllChanges),mh((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Mh=[.1,.25],Rh=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],_h=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),ih),n=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var i=Rh(e.sources),o=null==i?void 0:i.node;if(o){var a,s=null!==(a=null==t.generateTarget?void 0:t.generateTarget(o))&&void 0!==a?a:uh(o);n.set(i,s)}}},function(e,t){void 0===t&&(t={});var r=xh();Nh(wh((()=>{var n,i=gh("CLS",0),o=ch(t,ih),a=e=>{for(var t of e)o.u(t);o.o>i.value&&(i.value=o.o,i.entries=o.i,n())},s=bh("layout-shift",a);s&&(n=ph(e,i,Mh,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),fh((()=>{o.o=0,i=gh("CLS",0),n=ph(e,i,Mh,t.reportAllChanges),mh((()=>n()))})),setTimeout(n))})))}((t=>{var r=(e=>{var t={};if(e.entries.length){var r,i=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=i&&null!=(r=i.sources)&&r.length){var o=Rh(i.sources);o&&(t={largestShiftTarget:n.get(o),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:o,largestShiftEntry:i,loadState:ah(i.startTime)})}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)},Eh=function(e,t){void 0===t&&(t={}),Nh((t=>{var r=(e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ah(vh())};if(e.entries.length){var r=oh(),n=e.entries.at(-1);if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:ah(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)},Fh=0,Oh=1/0,Lh=0,Bh=e=>{for(var t of e)t.interactionId&&(Oh=Math.min(Oh,t.interactionId),Lh=Math.max(Lh,t.interactionId),Fh=Lh?(Lh-Oh)/7+1:0)},Zh=()=>{var e;return dh?Fh:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Ph=0;class Dh{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Ph=Zh(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((Zh()-Ph)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),n=this.h.get(e.interactionId);if(n||this.l.length<10||e.duration>r.T){var i;if(n?e.duration>n.T?(n.entries=[e],n.T=e.duration):e.duration===n.T&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],T:e.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var o=this.l.splice(10);for(var a of o)this.h.delete(a.id)}null==(i=this.p)||i.call(this,n)}}}}var qh=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=wh(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},jh=[200,500],Vh=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),Dh),n=[],i=[],o=0,a=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(qh(c),u=!0)},c=()=>{var e=r.l.map((e=>a.get(e.entries[0]))),t=i.length-50;i=i.filter(((r,n)=>n>=t||e.includes(r)));var s=new Set;for(var l of i){var c=d(l.startTime,l.processingEnd);for(var h of c)s.add(h)}var v=n.length-1-50;n=n.filter(((e,t)=>e.startTime>o&&t>v||s.has(e))),u=!1};r.m=e=>{var t,r=e.startTime+e.duration;o=Math.max(o,e.processingEnd);for(var n=i.length-1;n>=0;n--){var s=i[n];if(Math.abs(r-s.renderTime)<=8){(t=s).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},i.push(t)),(e.interactionId||"first-input"===e.entryType)&&a.set(e,t),l()},r.p=e=>{if(!s.get(e)){var r=e.entries[0].target;if(r){var n,i=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:uh(r);s.set(e,i)}}};var d=(e,t)=>{var r=[];for(var i of n)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;r.push(i)}return r},h=e=>{var t=e.entries[0],n=a.get(t),i=t.processingStart,o=Math.max(t.startTime+t.duration,i),u=Math.min(n.processingEnd,o),l=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(t.startTime,u),h=r.h.get(t.interactionId),v={interactionTarget:s.get(h),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:o,processedEventEntries:l,longAnimationFrameEntries:c,inputDelay:i-t.startTime,processingDuration:u-i,presentationDelay:o-u,loadState:ah(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,n,i=e.interactionTime,o=e.inputDelay,a=e.processingDuration,s=0,u=0,l=0,c=0;for(var d of e.longAnimationFrameEntries)for(var h of(u=u+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var v=h.startTime+h.duration;if(!(v<i)){var f=v-Math.max(i,h.startTime),p=h.duration?f/h.duration*h.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>c&&(n=h.startTime<i+o?"input-delay":h.startTime>=i+o+a?"presentation-delay":"processing-duration",r=h,c=f)}}var m=e.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(l=e.nextPaintTime-y),r&&n&&(e.longestScript={entry:r,subpart:n,intersectingDuration:c}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-i-s-u-l}})(v),Object.assign(e,{attribution:v})};bh("long-animation-frame",(e=>{n=n.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=xh();Ah((()=>{var n;"interactionCount"in performance||dh||(dh=bh("event",Bh,{type:"event",buffered:!0,durationThreshold:0}));var i,o=gh("INP"),a=ch(t,Dh),s=e=>{qh((()=>{for(var t of e)a.u(t);var r=a.M();r&&r.T!==o.value&&(o.value=r.T,o.entries=r.entries,i())}))},u=bh("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=ph(e,o,jh,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),fh((()=>{a.v(),o=gh("INP"),i=ph(e,o,jh,t.reportAllChanges)})))}))}}((t=>{var r=h(t);e(r)}),t)};class Hh{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}}var Yh=[2500,4e3],Gh=function(e,t){void 0===t&&(t={});var r=ch(t=Object.assign({},t),Hh),n=new WeakMap;r.m=e=>{var r=e.element;if(r){var i,o=null!==(i=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==i?i:uh(r);n.set(e,o)}},function(e,t){void 0===t&&(t={}),Ah((()=>{var r,n=xh(),i=gh("LCP"),o=ch(t,Hh),a=e=>{for(var a of(t.reportAllChanges||(e=e.slice(-1)),e))o.u(a),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-yh(),0),i.entries=[a],r())},s=bh("largest-contentful-paint",a);if(s){r=ph(e,i,Yh,t.reportAllChanges);var u=wh((()=>{a(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(qh(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});fh((n=>{i=gh("LCP"),r=ph(e,i,Yh,t.reportAllChanges),mh((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))}((t=>{var r=(e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=oh();if(r){var i=r.activationStart||0,o=e.entries.at(-1),a=o.url&&performance.getEntriesByType("resource").filter((e=>e.name===o.url))[0],s=Math.max(0,r.responseStart-i),u=Math.max(s,a?(a.requestStart||a.startTime)-i:0),l=Math.min(e.value,Math.max(u,a?a.responseEnd-i:0));t={target:n.get(o),timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:r,lcpEntry:o},o.url&&(t.url=o.url),a&&(t.lcpResourceEntry=a)}}return Object.assign(e,{attribution:t})})(t);e(r)}),t)};function Wh(e,t){return t.length>e?t.slice(0,e)+"...":t}function zh(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Si(t));return t}function Xh(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Ni.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Wh(1024,Pi(e)):o.$el_text=Wh(1024,Ti(e)));var a=Ai(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),mi(e.attributes,(function(r){var i;if((!Ri(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&Zi(r.value)&&(i=r.name,!Ur(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var a=r.value;"class"===r.name&&(a=xi(a).join(" ")),o["attr__"+r.name]=Wh(1024,a)}}));for(var s=1,u=1,l=e;l=zh(l);)s++,l.tagName===e.tagName&&u++;return o.nth_child=s,o.nth_of_type=u,o}function Uh(e,t){for(var r,n,i,{e:o,maskAllElementAttributes:a,maskAllText:s,elementAttributeIgnoreList:u}=t,l=[e],c=e;c.parentNode&&!ki(c,"body");)(i=c.parentNode)&&11===i.nodeType?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,h,v,f=[],p={},m=!1,y=!1;if(mi(l,(e=>{var t=Mi(e);"a"===e.tagName.toLowerCase()&&(m=e.getAttribute("href"),m=t&&m&&Zi(m)&&m),Pr(Ai(e),"ph-no-capture")&&(y=!0),f.push(Xh(e,a,s,u));var r=function(e){if(!Mi(e))return{};var t={};return mi(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&Zi(n)&&(t[r]=n)}})),t}(e);yi(p,r)})),y)return{props:{},explicitNoCapture:y};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=Pi(e):f[0].$el_text=Ti(e)),m){var g,b;f[0].attr__href=m;var w=null==(h=m,v=null==ai?void 0:ai.createElement("a"),g=Xr(v)?null:(v.href=h,v))?void 0:g.host,C=null==ri||null==(b=ri.location)?void 0:b.host;w&&C&&w!==C&&(d=m)}return{props:yi({$event_type:o.type,$ce_version:1},{$elements:f},{$elements_chain:qi(f)},null!=(r=f[0])&&r.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===o.type?{$external_click_url:d}:{},p)}}ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.loadWebVitalsCallbacks=function(e){void 0===e&&(e=!0);var t=e?{onLCP:Gh,onCLS:_h,onFCP:Eh,onINP:Vh}:{onLCP:nh,onCLS:Yd,onFCP:Vd,onINP:eh};return ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.postHogWebVitalsCallbacks=t,ui.postHogWebVitalsCallbacks=t,t},vi("[AutoCapture]");var Kh={};function Jh(e){return function(e,t){var r=Kh[e];if(r)return r;var n=t[e];if(Wr(n)&&!li())return Kh[e]=n.bind(t);var i=t.document;if(i&&Gr(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),i.head.removeChild(o)}catch(t){hi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&Gr(n)?Kh[e]=n.bind(t):n}("MutationObserver",e)}function Qh(e){var t=function(e){return Xr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}function $h(e,t){return Qr(e)&&e>=t}class ev{yt(e){var t,r,n,i,o,a=this.bt((null==e?void 0:e.__onCapture)||this.wt.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:a.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:a.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:a.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:a.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==o?o:a.capture_clicks_with_modifier_keys,__onCapture:a.__onCapture}}constructor(e,t){this.Ct=[],this.bt=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.It=e=>{var t=Qh(e);Kr(t)||this.St(t)||this.Ct.push(t),this.Ct.length&&Xr(this.kt)&&(this.kt=ui.setTimeout((()=>{this.xt()}),1e3))},this.At=()=>{var e=Date.now();e%50==0&&this.Ct.forEach((t=>{Xr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Tt=()=>{this.Nt=Date.now()},this.instance=e,this.Mt=this.yt(t),this._onCapture=this.Mt.__onCapture}start(e){this.Rt(),this._t(),this.Et(),this.Ft(e)}Ft(e){if(!this.Ot){var t=Jh(ui);this.Ot=new t((e=>{this.Lt(e)})),this.Ot.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Ot)||e.disconnect(),this.Ot=void 0,ui.removeEventListener("click",this.It),ui.removeEventListener("scroll",this.At,{capture:!0}),ui.removeEventListener("selectionchange",this.Tt)}Lt(e){this.Bt=Date.now()}Rt(){bi(ui,"click",this.It)}_t(){bi(ui,"scroll",this.At,{capture:!0})}Et(){bi(ui,"selectionchange",this.Tt)}St(e){if(!e)return!0;if(!this.Mt.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t,r;if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var n=this.Ct.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!n||!(!ki(e.node,"html")&&Si(e.node)&&!Ni.includes(e.node.tagName.toLowerCase()))}xt(){if(this.Ct.length){clearTimeout(this.kt),this.kt=void 0;var e=this.Ct;for(var t of(this.Ct=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Bt&&t.timestamp<=this.Bt?this.Bt-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Nt&&t.timestamp<=this.Nt?this.Nt-t.timestamp:void 0;var n=$h(t.scrollDelayMs,this.Mt.scroll_threshold_ms),i=$h(t.selectionChangedDelayMs,this.Mt.selection_change_threshold_ms),o=$h(t.mutationDelayMs,this.Mt.mutation_threshold_ms),a=$h(t.absoluteDelayMs,1.1*this.Mt.mutation_threshold_ms),s=Qr(t.scrollDelayMs)&&t.scrollDelayMs<this.Mt.scroll_threshold_ms,u=Qr(t.mutationDelayMs)&&t.mutationDelayMs<this.Mt.mutation_threshold_ms,l=Qr(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.Mt.selection_change_threshold_ms;s||u||l||(n||o||a||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:a,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this.Mt.mutation_threshold_ms&&this.Ct.push(t))}this.Ct.length&&Xr(this.kt)&&(this.kt=ui.setTimeout((()=>{this.xt()}),1e3))}}wt(e,t){this.instance.capture("$dead_click",r({},t,Uh(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Mt.element_attribute_ignorelist}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ui.__PosthogExtensions__=ui.__PosthogExtensions__||{},ui.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new ev(e,t)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map