!function(){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(t){for(var r=1;arguments.length>r;r++){var e=arguments[r];for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t.apply(null,arguments)}var r="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:r;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.document;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var n=null!=r?r:{};function a(t,r){return-1!==t.indexOf(r)}var s=function(t){return t.trim()},l=Object.prototype,o=l.hasOwnProperty,u=l.toString,c=Array.isArray||function(t){return"[object Array]"===u.call(t)},v=t=>"function"==typeof t,h=t=>void 0===t,f=t=>"[object String]"==u.call(t),d=t=>null===t,_=t=>h(t)||d(t),b=t=>"[object Number]"==u.call(t)&&t==t,m=t=>t instanceof FormData;function p(t){return t?t.split("#")[0]:t}var g=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,a={k(e){if(r&&(n.POSTHOG_DEBUG||i)&&!h(r.console)&&r.console){for(var a=("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e]),s=arguments.length,l=new Array(s>1?s-1:0),o=1;s>o;o++)l[o-1]=arguments[o];a(t,...l)}},debug(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("debug",...r)},info(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("log",...r)},warn(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("warn",...r)},error(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("error",...r)},critical(){for(var r=arguments.length,e=new Array(r),i=0;r>i;i++)e[i]=arguments[i];console.error(t,...e)},uninitializedWarning(t){a.error("You must initialize PostHog before calling "+t)},createLogger:(r,e)=>g(t+" "+r,e)};return a},y=g("[PostHog.js]"),k=y.createLogger;function w(t,r){if(!_(t))if(c(t))t.forEach(r);else if(m(t))t.forEach(((t,e)=>r(t,e)));else for(var e in t)o.call(t,e)&&r(t[e],e)}var A=function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;r>i;i++)e[i-1]=arguments[i];for(var n of e)for(var a in n)void 0!==n[a]&&(t[a]=n[a]);return t};function x(t){for(var r=Object.keys(t),e=r.length,i=new Array(e);e--;)i[e]=[r[e],t[r[e]]];return i}function C(t,r,e,i){var{capture:n=!1,passive:a=!0}=null!=i?i:{};null==t||t.addEventListener(r,e,{capture:n,passive:a})}var E=1,O=3,j=11;function D(t){return!!t&&t.nodeType===E}function L(t,r){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===r.toLowerCase()}function T(t){return!!t&&t.nodeType===j&&D(t.host)}function R(t){return t?s(t).split(/\s+/):[]}function H(t){var r="";switch(typeof t.className){case"string":r=t.className;break;case"object":r=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:r=""}return R(r)}function M(t){var r="";return B(t)&&!F(t)&&t.childNodes&&t.childNodes.length&&w(t.childNodes,(function(t){var e,i;(function(t){return!!t&&t.nodeType===O})(t)&&t.textContent&&(r+=null!==(e=_(i=t.textContent)?null:s(i).split(/(\s+)/).filter((t=>Z(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))&&void 0!==e?e:"")})),s(r)}var I=["a","button","form","input","select","textarea","label"];function S(t){var r=t.parentNode;return!(!r||!D(r))&&r}var U=[".ph-no-deadclick",".ph-no-capture"];var z=t=>!t||L(t,"html")||!D(t),P=(t,e)=>{if(!r||z(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!L(a,"body");)if(T(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var s=S(a);if(!s)break;if(I.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var l=r.getComputedStyle(s);l&&"pointer"===l.getPropertyValue("cursor")&&(i=!0)}catch(t){}n.push(s),a=s}return{parentIsUsefulElement:i,targetElementList:n}};function B(t){for(var r=t;r.parentNode&&!L(r,"body");r=r.parentNode){var e=H(r);if(a(e,"ph-sensitive")||a(e,"ph-no-capture"))return!1}if(a(H(t),"ph-include"))return!0;var i=t.type||"";if(f(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!f(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function F(t){return!!(L(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||L(t,"select")||L(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var N="(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})",V=new RegExp("^(?:"+N+")$"),W=new RegExp(N),q="\\d{3}-?\\d{2}-?\\d{4}",G=new RegExp("^("+q+")$"),Y=new RegExp("("+q+")");function Z(t,r){if(void 0===r&&(r=!0),_(t))return!1;if(f(t)){if(t=s(t),(r?V:W).test((t||"").replace(/[- ]/g,"")))return!1;if((r?G:Y).test(t))return!1}return!0}function J(t){var r=M(t);return Z(r=(r+" "+K(t)).trim())?r:""}function K(t){var r="";return t&&t.childNodes&&t.childNodes.length&&w(t.childNodes,(function(t){var e;if(t&&"span"===(null==(e=t.tagName)?void 0:e.toLowerCase()))try{var i=M(t);r=(r+" "+i).trim(),t.childNodes&&t.childNodes.length&&(r=(r+" "+K(t)).trim())}catch(t){y.error("[AutoCapture]",t)}})),r}function Q(t){return t.replace(/"|\\"/g,'\\"')}function X(t){var r=t.attr__class;return r?c(r)?r:R(r):void 0}function tt(t,r){return r.length>t?r.slice(0,t)+"...":r}function rt(t){if(t.previousElementSibling)return t.previousElementSibling;var r=t;do{r=r.previousSibling}while(r&&!D(r));return r}function et(e,n){var s,l,{e:o,maskAllElementAttributes:u,maskAllText:c,elementAttributeIgnoreList:v,disableCaptureUrlHashes:d}=n;if(!D(e))return{props:{}};for(var _=[e],b=e;b.parentNode&&!L(b,"body");)if(T(b.parentNode))_.push(b.parentNode.host),b=b.parentNode.host;else{if(!D(b.parentNode))break;_.push(b.parentNode),b=b.parentNode}var m,g,y,k,C=[],E={},O=!1,j=!1;if(w(_,(t=>{var r=B(t);if(L(t,"a")){var e=t.getAttribute("href");O=!!(r&&e&&Z(e))&&(d?p(e):e)}a(H(t),"ph-no-capture")&&(j=!0),C.push(function(t,r,e,i,n){void 0===n&&(n=!1);var a=t.tagName.toLowerCase(),s={tag_name:a};I.indexOf(a)>-1&&!e&&(s.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?tt(1024,J(t)):tt(1024,M(t)));var l=H(t);l.length>0&&(s.classes=l.filter((function(t){return""!==t}))),w(t.attributes,(function(e){var a;if((!F(t)||-1!==["name","id","class","aria-label"].indexOf(e.name))&&(null==i||!i.includes(e.name))&&!r&&Z(e.value)&&(!f(a=e.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var l=e.value;"class"===e.name&&(l=R(l).join(" ")),s["attr__"+e.name]=tt(1024,"href"===e.name&&n?p(l):l)}}));for(var o=1,u=1,c=t;c=rt(c);)o++,c.tagName===t.tagName&&u++;return s.nth_child=o,s.nth_of_type=u,s}(t,u,c,v,d));var i=function(t){if(!B(t))return{};var r={};return w(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var e=t.name.replace("data-ph-capture-attribute-",""),i=t.value;e&&i&&Z(i)&&(r[e]=i)}})),r}(t);A(E,i)})),j)return{props:{},explicitNoCapture:j};if(c||(C[0].$el_text=L(e,"a")||L(e,"button")?J(e):M(e)),O){var S,U;C[0].attr__href=O;var z=null==(g=O,y=null==i?void 0:i.createElement("a"),S=h(y)?null:(y.href=g,y))?void 0:S.host,P=null==r||null==(U=r.location)?void 0:U.host;z&&P&&z!==P&&(m=O)}return{props:A({$event_type:o.type,$ce_version:1},{$elements:C},{$elements_chain:(k=C,function(r){return r.map((r=>{var e,i,n="";if(r.tag_name&&(n+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))n+="."+a.replace(/"/g,"");var s=t({},r.text?{text:r.text}:{},{"nth-child":null!==(e=r.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=r.nth_of_type)&&void 0!==i?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),l={};return x(s).sort(((t,r)=>{var[e]=t,[i]=r;return e.localeCompare(i)})).forEach((t=>{var[r,e]=t;return l[Q(r.toString())]=Q(e.toString())})),(n+=":")+x(l).map((t=>{var[r,e]=t;return r+'="'+e+'"'})).join("")})).join(";")}(function(t){return t.map((t=>{var r,e,i={text:null==(r=t.$el_text)?void 0:r.slice(0,400),tag_name:t.tag_name,href:null==(e=t.attr__href)?void 0:e.slice(0,2048),attr_class:X(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return x(t).filter((t=>{var[r]=t;return 0===r.indexOf("attr__")})).forEach((t=>{var[r,e]=t;return i.attributes[r]=e})),i}))}(k)))},null!=(s=C[0])&&s.$el_text?{$el_text:null==(l=C[0])?void 0:l.$el_text}:{},m&&"click"===o.type?{$external_click_url:m}:{},E)}}k("[AutoCapture]");var it={};function nt(t){return function(t,e){var i=it[t];if(i)return i;var n,a=e[t];if(v(n=a)&&-1!==n.toString().indexOf("[native code]")&&!r.Zone)return it[t]=a.bind(e);var s=e.document;if(s&&v(s.createElement))try{var l=s.createElement("iframe");l.hidden=!0,s.head.appendChild(l);var o=l.contentWindow;o&&o[t]&&(a=o[t]),s.head.removeChild(l)}catch(r){y.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",r)}return a&&v(a)?it[t]=a.bind(e):a}("MutationObserver",t)}function at(t,r){return b(t)&&t>=r}class st{ce(t){var r,e,i,n,a,s=this.de((null==t?void 0:t.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(r=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==r?r:s.element_attribute_ignorelist,scroll_threshold_ms:null!==(e=null==t?void 0:t.scroll_threshold_ms)&&void 0!==e?e:s.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:s.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:s.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==a?a:s.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:s.__onCapture}}constructor(t,r){this.ve=[],this.de=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.fe=t=>{var r=function(t){var r,e,i=h((r=t).target)?r.srcElement||null:null!=(e=r.target)&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;return i?{node:i,originalEvent:t,timestamp:Date.now()}:null}(t);d(r)||this.pe(r)||this.ve.push(r),this.ve.length&&h(this.me)&&(this.me=n.setTimeout((()=>{this.ye()}),1e3))},this.ge=()=>{var t=Date.now();t%50==0&&this.ve.forEach((r=>{h(r.scrollDelayMs)&&(r.scrollDelayMs=t-r.timestamp)}))},this.be=()=>{this.we=Date.now()},this.ke=()=>{"visible"===(null==i?void 0:i.visibilityState)&&(this.xe=Date.now())},this.instance=t,this.Se=this.ce(r),this._onCapture=this.Se.__onCapture}start(t){this.Ce(),this.Ie(),this.Me(),this.Te(),this._e(t)}_e(t){if(!this.Re){var r=nt(n);this.Re=new r((t=>{this.Le(t)})),this.Re.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Re)||t.disconnect(),this.Re=void 0,n.removeEventListener("click",this.fe),n.removeEventListener("scroll",this.ge,{capture:!0}),n.removeEventListener("selectionchange",this.be),null==i||i.removeEventListener("visibilitychange",this.ke)}Le(t){this.Oe=Date.now()}Ce(){C(n,"click",this.fe)}Ie(){C(n,"scroll",this.ge,{capture:!0})}Me(){C(n,"selectionchange",this.be)}Te(){C(i,"visibilitychange",this.ke)}pe(t){return!(t&&(this.Se.capture_clicks_with_modifier_keys||!((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))&&!((i=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===i.id||null!=i.closest&&i.closest(".toolbar-global-fade-container")))&&!this.ve.some((r=>r.node===t.node&&1e3>Math.abs(r.timestamp-t.timestamp)))&&!L(t.node,"html")&&D(t.node)&&!function(t){if(!r||z(t))return!1;var{targetElementList:e}=P(t);return e.some((t=>L(t,"a")))}(t.node)&&function(t,e){var i;if(!r||z(t))return!1;var n="[object Boolean]"===u.call(e)?U:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:U,{targetElementList:a}=P(t);return!function(t,r){if(h(r))return!0;var e,i=function(t){if(r.some((r=>function(t,r){var e=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!e&&e.call(t,r)}catch(t){return!1}}(t,r))))return{v:!0}};for(var n of t)if(e=i(n))return e.v;return!1}(a,n)}(t.node,{css_selector_ignorelist:this.Se.css_selector_ignorelist}));var e,i}ye(){if(this.ve.length){clearTimeout(this.me),this.me=void 0;var t=this.ve;for(var r of(this.ve=[],t)){var e;r.mutationDelayMs=null!==(e=r.mutationDelayMs)&&void 0!==e?e:this.Oe&&this.Oe>=r.timestamp?this.Oe-r.timestamp:void 0,r.absoluteDelayMs=Date.now()-r.timestamp,r.selectionChangedDelayMs=this.we&&this.we>=r.timestamp?this.we-r.timestamp:void 0,r.visibilityChangedDelayMs=this.xe?Math.abs(r.timestamp-this.xe):void 0;var i=at(r.scrollDelayMs,this.Se.scroll_threshold_ms),a=at(r.selectionChangedDelayMs,this.Se.selection_change_threshold_ms),s=at(r.mutationDelayMs,this.Se.mutation_threshold_ms),l=at(r.absoluteDelayMs,1.1*this.Se.mutation_threshold_ms),o=b(r.scrollDelayMs)&&this.Se.scroll_threshold_ms>r.scrollDelayMs,u=b(r.mutationDelayMs)&&this.Se.mutation_threshold_ms>r.mutationDelayMs,c=b(r.selectionChangedDelayMs)&&this.Se.selection_change_threshold_ms>r.selectionChangedDelayMs,v=b(r.visibilityChangedDelayMs)&&this.Se.selection_change_threshold_ms>r.visibilityChangedDelayMs;if(!(o||u||c||v)){var f=at(r.visibilityChangedDelayMs,this.Se.selection_change_threshold_ms);i||s||l||a||f?this._onCapture(r,{$dead_click_last_mutation_timestamp:this.Oe,$dead_click_event_timestamp:r.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:l,$dead_click_selection_changed_timeout:a,$dead_click_visibility_changed_timeout:f}):this.Se.mutation_threshold_ms>r.absoluteDelayMs&&this.ve.push(r)}}this.ve.length&&h(this.me)&&(this.me=n.setTimeout((()=>{this.ye()}),1e3))}}he(r,e){this.instance.capture("$dead_click",t({},e,et(r.node,{e:r.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{$dead_click_scroll_delay_ms:r.scrollDelayMs,$dead_click_mutation_delay_ms:r.mutationDelayMs,$dead_click_absolute_delay_ms:r.absoluteDelayMs,$dead_click_selection_changed_delay_ms:r.selectionChangedDelayMs,$dead_click_visibility_changed_delay_ms:r.visibilityChangedDelayMs}),{timestamp:new Date(r.timestamp)})}}n.__PosthogExtensions__=n.__PosthogExtensions__||{},n.__PosthogExtensions__.initDeadClicksAutocapture=(t,r)=>new st(t,r)}(); //# sourceMappingURL=dead-clicks-autocapture.js.map