1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{3454:function(c,u,h){"use strict";var d,v;c.exports=(null==(d=h.g.process)?void 0:d.env)&&"object"==typeof(null==(v=h.g.process)?void 0:v.env)?h.g.process:h(7663)},6840:function(c,u,h){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return h(5913)}])},7893:function(c,u,h){"use strict";h.d(u,{aK:function(){return getReferringUrlForHubspot},v4:function(){return trackVisitedPage}});let d="cs-last-page";function isExcludedReferringPath(c){if(!c)return!0;let u=function(c){try{if(c.startsWith("http://")||c.startsWith("https://"))return new URL(c).pathname.replace(/\/+$/,"")||"/"}catch(c){}let u=c.split("?")[0].split("#")[0];return u.replace(/\/+$/,"")||"/"}(c);return!!("/demo"===u||u.endsWith("/demo")||u.includes("thank-you"))}function trackVisitedPage(){let c=window.location.pathname.replace(/\/+$/,"")||"/";if(isExcludedReferringPath(c))return;let u=window.location.origin+c;sessionStorage.setItem(d,u)}function getReferringUrlForHubspot(){let c=sessionStorage.getItem(d)||"";if(c)return c;let u=document.referrer||"";return!u||isExcludedReferringPath(u)?"":u}},597:function(c,u,h){var d=h(3454);h(1479);var v=h(7294),m=v&&"object"==typeof v&&"default"in v?v:{default:v};function _defineProperties(c,u){for(var h=0;h<u.length;h++){var d=u[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}var b=void 0!==d&&d.env&&!0,isString=function(c){return"[object String]"===Object.prototype.toString.call(c)},S=function(){function StyleSheet(c){var u=void 0===c?{}:c,h=u.name,d=void 0===h?"stylesheet":h,v=u.optimizeForSpeed,m=void 0===v?b:v;invariant$1(isString(d),"`name` must be a string"),this._name=d,this._deletedRulePlaceholder="#"+d+"-deleted-rule____{}",invariant$1("boolean"==typeof m,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=m,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var S=document.querySelector('meta[property="csp-nonce"]');this._nonce=S?S.getAttribute("content"):null}var c,u=StyleSheet.prototype;return u.setOptimizeForSpeed=function(c){invariant$1("boolean"==typeof c,"`setOptimizeForSpeed` accepts a boolean"),invariant$1(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=c,this.inject()},u.isOptimizeForSpeed=function(){return this._optimizeForSpeed},u.inject=function(){var c=this;if(invariant$1(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(b||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(u,h){return"number"==typeof h?c._serverSheet.cssRules[h]={cssText:u}:c._serverSheet.cssRules.push({cssText:u}),h},deleteRule:function(u){c._serverSheet.cssRules[u]=null}}},u.getSheetForTag=function(c){if(c.sheet)return c.sheet;for(var u=0;u<document.styleSheets.length;u++)if(document.styleSheets[u].ownerNode===c)return document.styleSheets[u]},u.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},u.insertRule=function(c,u){if(invariant$1(isString(c),"`insertRule` accepts only strings"),this._optimizeForSpeed){var h=this.getSheet();"number"!=typeof u&&(u=h.cssRules.length);try{h.insertRule(c,u)}catch(u){return b||console.warn("StyleSheet: illegal rule: \n\n"+c+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var d=this._tags[u];this._tags.push(this.makeStyleTag(this._name,c,d))}return this._rulesCount++},u.replaceRule=function(c,u){if(this._optimizeForSpeed){var h=this.getSheet();if(u.trim()||(u=this._deletedRulePlaceholder),!h.cssRules[c])return c;h.deleteRule(c);try{h.insertRule(u,c)}catch(d){b||console.warn("StyleSheet: illegal rule: \n\n"+u+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),h.insertRule(this._deletedRulePlaceholder,c)}}else{var d=this._tags[c];invariant$1(d,"old rule at index `"+c+"` not found"),d.textContent=u}return c},u.deleteRule=function(c){if(this._optimizeForSpeed)this.replaceRule(c,"");else{var u=this._tags[c];invariant$1(u,"rule at index `"+c+"` not found"),u.parentNode.removeChild(u),this._tags[c]=null}},u.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(c){return c&&c.parentNode.removeChild(c)}),this._tags=[]},u.cssRules=function(){var c=this;return this._tags.reduce(function(u,h){return h?u=u.concat(Array.prototype.map.call(c.getSheetForTag(h).cssRules,function(u){return u.cssText===c._deletedRulePlaceholder?null:u})):u.push(null),u},[])},u.makeStyleTag=function(c,u,h){u&&invariant$1(isString(u),"makeStyleTag accepts only strings as second parameter");var d=document.createElement("style");this._nonce&&d.setAttribute("nonce",this._nonce),d.type="text/css",d.setAttribute("data-"+c,""),u&&d.appendChild(document.createTextNode(u));var v=document.head||document.getElementsByTagName("head")[0];return h?v.insertBefore(d,h):v.appendChild(d),d},_defineProperties(StyleSheet.prototype,[{key:"length",get:function(){return this._rulesCount}}]),c&&_defineProperties(StyleSheet,c),StyleSheet}();function invariant$1(c,u){if(!c)throw Error("StyleSheet: "+u+".")}var stringHash=function(c){for(var u=5381,h=c.length;h;)u=33*u^c.charCodeAt(--h);return u>>>0},k={};function computeId(c,u){if(!u)return"jsx-"+c;var h=String(u),d=c+h;return k[d]||(k[d]="jsx-"+stringHash(c+"-"+h)),k[d]}function computeSelector(c,u){var h=c+u;return k[h]||(k[h]=u.replace(/__jsx-style-dynamic-selector/g,c)),k[h]}var T=function(){function StyleSheetRegistry(c){var u=void 0===c?{}:c,h=u.styleSheet,d=void 0===h?null:h,v=u.optimizeForSpeed,m=void 0!==v&&v;this._sheet=d||new S({name:"styled-jsx",optimizeForSpeed:m}),this._sheet.inject(),d&&"boolean"==typeof m&&(this._sheet.setOptimizeForSpeed(m),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var c=StyleSheetRegistry.prototype;return c.add=function(c){var u=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(c.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(c,u){return c[u]=0,c},{}));var h=this.getIdAndRules(c),d=h.styleId,v=h.rules;if(d in this._instancesCounts){this._instancesCounts[d]+=1;return}var m=v.map(function(c){return u._sheet.insertRule(c)}).filter(function(c){return -1!==c});this._indices[d]=m,this._instancesCounts[d]=1},c.remove=function(c){var u=this,h=this.getIdAndRules(c).styleId;if(function(c,u){if(!c)throw Error("StyleSheetRegistry: "+u+".")}(h in this._instancesCounts,"styleId: `"+h+"` not found"),this._instancesCounts[h]-=1,this._instancesCounts[h]<1){var d=this._fromServer&&this._fromServer[h];d?(d.parentNode.removeChild(d),delete this._fromServer[h]):(this._indices[h].forEach(function(c){return u._sheet.deleteRule(c)}),delete this._indices[h]),delete this._instancesCounts[h]}},c.update=function(c,u){this.add(u),this.remove(c)},c.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},c.cssRules=function(){var c=this,u=this._fromServer?Object.keys(this._fromServer).map(function(u){return[u,c._fromServer[u]]}):[],h=this._sheet.cssRules();return u.concat(Object.keys(this._indices).map(function(u){return[u,c._indices[u].map(function(c){return h[c].cssText}).join(c._optimizeForSpeed?"":"\n")]}).filter(function(c){return!!c[1]}))},c.styles=function(c){var u,h;return u=this.cssRules(),void 0===(h=c)&&(h={}),u.map(function(c){var u=c[0],d=c[1];return m.default.createElement("style",{id:"__"+u,key:"__"+u,nonce:h.nonce?h.nonce:void 0,dangerouslySetInnerHTML:{__html:d}})})},c.getIdAndRules=function(c){var u=c.children,h=c.dynamic,d=c.id;if(h){var v=computeId(d,h);return{styleId:v,rules:Array.isArray(u)?u.map(function(c){return computeSelector(v,c)}):[computeSelector(v,u)]}}return{styleId:computeId(d),rules:Array.isArray(u)?u:[u]}},c.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(c,u){return c[u.id.slice(2)]=u,c},{})},StyleSheetRegistry}(),P=v.createContext(null);P.displayName="StyleSheetContext";var C=m.default.useInsertionEffect||m.default.useLayoutEffect,$=new T;function JSXStyle(c){var u=$||v.useContext(P);return u&&C(function(){return u.add(c),function(){u.remove(c)}},[c.id,String(c.dynamic)]),null}JSXStyle.dynamic=function(c){return c.map(function(c){return computeId(c[0],c[1])}).join(" ")},u.style=JSXStyle},5379:function(c,u,h){"use strict";c.exports=h(597).style},5913:function(c,u,h){"use strict";h.r(u);var d=h(5893),v=h(5432),m=h.n(v),b=h(777),S=h.n(b),k=h(8806),T=h.n(k),P=h(1418),C=h.n(P),$=h(8030),G=h.n($),X=h(5379),Z=h.n(X);h(9935),h(4749),h(6541);var J=h(9008),Q=h.n(J),ee=h(4298),et=h.n(ee),ei=h(7294),ea=h(1163),el=h(4871),ec=h(4651),eu=h(7893);u.default=function(c){let{Component:u,pageProps:h}=c,v=(0,ea.useRouter)(),[b,k]=(0,ei.useState)();return(0,ei.useEffect)(()=>{window},[]),(0,ei.useEffect)(()=>{var c;let u=null===(c=el.v.NEXT_PUBLIC_POSTHOG_KEY)||void 0===c?void 0:c.trim();if(!u||ec.ZP.__loaded)return;let h=window.location.host.startsWith("localhost");ec.ZP.init(u,{api_host:el.v.NEXT_PUBLIC_POSTHOG_HOST||"https://us.i.posthog.com",autocapture:!0,capture_pageview:!0,persistence:"localStorage+cookie",loaded:c=>{h&&c.debug()}})},[]),(0,ei.useEffect)(()=>{var c;if(!(null===(c=el.v.NEXT_PUBLIC_POSTHOG_KEY)||void 0===c?void 0:c.trim())||!(null===ec.ZP||void 0===ec.ZP?void 0:ec.ZP.__loaded))return;let u="/login"===v.asPath||v.asPath.endsWith("/login");u?ec.ZP.opt_out_capturing():ec.ZP.opt_in_capturing()},[v.asPath]),(0,ei.useEffect)(()=>{(0,eu.v4)();let onRouteChange=()=>(0,eu.v4)();return v.events.on("routeChangeComplete",onRouteChange),()=>{v.events.off("routeChangeComplete",onRouteChange)}},[v.events]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Z(),{id:"c438317819469c26",dynamic:[m().style.fontFamily,m().style.fontFamily,S().style.fontFamily,T().style.fontFamily,C().style.fontFamily,G().style.fontFamily],children:"body{font-family:".concat(m().style.fontFamily,"}button{font-family:").concat(m().style.fontFamily,"}.archivo{font-family:").concat(S().style.fontFamily,"}.gtAmerica700{font-family:").concat(C().style.fontFamily,"}.gtAmerica400{font-family:").concat(G().style.fontFamily,"}")}),(0,d.jsx)(Q(),{children:(0,d.jsx)("link",{rel:"shortcut icon",href:"/favicon.ico",className:Z().dynamic([["c438317819469c26",[m().style.fontFamily,m().style.fontFamily,S().style.fontFamily,T().style.fontFamily,C().style.fontFamily,G().style.fontFamily]]])})}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(et(),{src:"https://www.googletagmanager.com/gtag/js?i
1d=G-PP5Q90BBFJ",strategy:"lazyOnload"}),(0,d.jsx)(et(),{id:"google-analytics",children:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', 'G-PP5Q90BBFJ', {'allow_enhanced_conversions':true});\n "})]}),(0,d.jsx)(u,{...h,className:Z().dynamic([["c438317819469c26",[m().style.fontFamily,m().style.fontFamily,S().style.fontFamily,T().style.fontFamily,C().style.fontFamily,G().style.fontFamily]]])+" "+(h&&null!=h.className&&h.className||"")})]})}},4871:function(c,u,h){"use strict";h.d(u,{v:function(){return d}});let d={NEXT_PUBLIC_POSTHOG_KEY:"phc_nXBRaM2xCPiMXf7yoWcU53u8W4hvHCM5bajuQxJuSCJK",NEXT_PUBLIC_POSTHOG_HOST:"https://us.i.posthog.com"}},1479:function(){},6541:function(){},4749:function(){},9935:function(){},777:function(c){c.exports={style:{fontFamily:"'__Archivo_5afde0', '__Archivo_Fallback_5afde0'",fontStyle:"normal"},className:"__className_5afde0"}},5432:function(c){c.exports={style:{fontFamily:"'__Inter_f367f3', '__Inter_Fallback_f367f3'",fontStyle:"normal"},className:"__className_f367f3"}},1418:function(c){c.exports={style:{fontFamily:"'__gtAmerica700_b2522b', '__gtAmerica700_Fallback_b2522b'"},className:"__className_b2522b"}},8030:function(c){c.exports={style:{fontFamily:"'__gtAmerica400_cc9d5f', '__gtAmerica400_Fallback_cc9d5f'"},className:"__className_cc9d5f"}},8806:function(c){c.exports={style:{fontFamily:"'__interDisplay600_9c582d', '__interDisplay600_Fallback_9c582d'"},className:"__className_9c582d"}},7663:function(c){!function(){var u={229:function(c){var u,h,d,v=c.exports={};function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(c){if(u===setTimeout)return setTimeout(c,0);if((u===defaultSetTimout||!u)&&setTimeout)return u=setTimeout,setTimeout(c,0);try{return u(c,0)}
1catch(h){try{return u.call(null,c,0)}catch(h){return u.call(this,c,0)}}}!function(){try{u="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(c){u=defaultSetTimout}try{h="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(c){h=defaultClearTimeout}}();var m=[],b=!1,S=-1;function cleanUpNextTick(){b&&d&&(b=!1,d.length?m=d.concat(m):S=-1,m.length&&drainQueue())}function drainQueue(){if(!b){var c=runTimeout(cleanUpNextTick);b=!0;for(var u=m.length;u;){for(d=m,m=[];++S<u;)d&&d[S].run();S=-1,u=m.length}d=null,b=!1,function(c){if(h===clearTimeout)return clearTimeout(c);if((h===defaultClearTimeout||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(c);try{h(c)}catch(u){try{return h.call(null,c)}catch(u){return h.call(this,c)}}}(c)}}function Item(c,u){this.fun=c,this.array=u}function noop(){}v.nextTick=function(c){var u=Array(arguments.length-1);if(arguments.length>1)for(var h=1;h<arguments.length;h++)u[h-1]=arguments[h];m.push(new Item(c,u)),1!==m.length||b||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},v.title="browser",v.browser=!0,v.env={},v.argv=[],v.version="",v.versions={},v.on=noop,v.addListener=noop,v.once=noop,v.off=noop,v.removeListener=noop,v.removeAllListeners=noop,v.emit=noop,v.prependListener=noop,v.prependOnceListener=noop,v.listeners=function(c){return[]},v.binding=function(c){throw Error("process.binding is not supported")},v.cwd=function(){return"/"},v.chdir=function(c){throw Error("process.chdir is not supported")},v.umask=function(){return 0}}},h={};function __nccwpck_require__(c){var d=h[c];if(void 0!==d)return d.exports;var v=h[c]={exports:{}},m=!0;try{u[c](v,v.exports,__nccwpck_require__),m=!1}finally{m&&delete h[c]}return v.exports}__nccwpck_require__.ab="//";var d=__nccwpck_require__(229);c.exports=d}()},9008:function(c,u,h){c.exports=h(9201)},1163:function(c,u,h){c.exports=h(9974)},4298:function(c,u,h){c.exports=h(5354)},4651:function(c,u,h){"use strict";h.d(u,{ZP:function(){return rQ}});var d="undefined"!=typeof window?window:void 0,v="undefined"!=typeof globalThis?globalThis:d;"undefined"==typeof self&&(v.self=v),"undefined"==typeof File&&(v.File=function(){});var m=Array.prototype,b=m.forEach,S=m.indexOf,k=null==v?void 0:v.navigator,T=null==v?void 0:v.document,P=null==v?void 0:v.location,C=null==v?void 0:v.fetch,$=null!=v&&v.XMLHttpRequest&&"withCredentials"in new v.XMLHttpRequest?v.XMLHttpRequest:void 0,G=null==v?void 0:v.AbortController,X=null==k?void 0:k.userAgent,Z=null!=d?d:{},J={DEBUG:!1,LIB_VERSION:"1.356.1"};function f(c,u,h,d,v,m,b){try{var S=c[m](b),k=S.value}catch(c){return void h(c)}S.done?u(k):Promise.resolve(k).then(d,v)}function p(c){return function(){var u=this,h=arguments;return new Promise(function(d,v){var m=c.apply(u,h);function o(c){f(m,d,v,o,a,"next",c)}function a(c){f(m,d,v,o,a,"throw",c)}o(void 0)})}}function _(){return(_=Object.assign?Object.assign.bind():function(c){for(var u=1;u<arguments.length;u++){var h=arguments[u];for(var d in h)({}).hasOwnProperty.call(h,d)&&(c[d]=h[d])}return c}).apply(null,arguments)}function g(c,u){if(null==c)return{};var h={};for(var d in c)if(({}).hasOwnProperty.call(c,d)){if(-1!==u.indexOf(d))continue;h[d]=c[d]}return h}var Q=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],ee=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],y=function(c,u){if(void 0===u&&(u=[]),!c)return!1;var h=c.toLowerCase();return ee.concat(u).some(c=>{var u=c.toLowerCase();return -1!==h.indexOf(u)}
1)};function w(c,u){return -1!==c.indexOf(u)}var x=function(c){return c.trim()},E=function(c){return c.replace(/^\$/,"")},et=Array.isArray,ei=Object.prototype,ea=ei.hasOwnProperty,el=ei.toString,ec=et||function(c){return"[object Array]"===el.call(c)},I=c=>"function"==typeof c,R=c=>c===Object(c)&&!ec(c),F=c=>{if(R(c)){for(var u in c)if(ea.call(c,u))return!1;return!0}return!1},O=c=>void 0===c,M=c=>"[object String]"==el.call(c),A=c=>M(c)&&0===c.trim().length,D=c=>null===c,j=c=>O(c)||D(c),L=c=>"[object Number]"==el.call(c)&&c==c,N=c=>L(c)&&c>0,U=c=>"[object Boolean]"===el.call(c),z=c=>c instanceof FormData,H=c=>w(Q,c);function B(c){return null===c||"object"!=typeof c}function q(c,u){return Object.prototype.toString.call(c)==="[object "+u+"]"}function W(c){return!O(Event)&&function(c,u){try{return c instanceof u}catch(c){return!1}}(c,Event)}var eu=[!0,"true",1,"1","yes"],V=c=>w(eu,c),eh=[!1,"false",0,"0","no"];function K(c,u,h,d,v){return u>h&&(d.warn("min cannot be greater than max."),u=h),L(c)?c>h?(d.warn(" cannot be greater than max: "+h+". Using max value instead."),h):c<u?(d.warn(" cannot be less than min: "+u+". Using min value instead."),u):c:(d.warn(" must be a number. using max or fallback. max: "+h+", fallback: "+v),K(v||h,u,h,d))}let Y=class Y{constructor(c){this.t={},this.i=c.i,this.o=K(c.bucketSize,0,100,c.h),this.m=K(c.refillRate,0,this.o,c.h),this.$=K(c.refillInterval,0,864e5,c.h)}S(c,u){var h=Math.floor((u-c.lastAccess)/this.$);if(h>0){var d=h*this.m;c.tokens=Math.min(c.tokens+d,this.o),c.lastAccess=c.lastAccess+h*this.$}}consumeRateLimit(c){var u,h=Date.now(),d=String(c),v=this.t[d];return v?this.S(v,h):(v={tokens:this.o,lastAccess:h},this.t[d]=v),0===v.tokens||(v.tokens--,0===v.tokens&&(null==(u=this.i)||u.call(this,c)),0===v.tokens)}stop(){this.t={}}};var ed,ep,e_,eg="Mobile",ev="Android",ef="Tablet",em=ev+" "+ef,ey="iPad",eb="Apple",ew=eb+" Watch",eE="Safari",eS="BlackBerry",ex="Samsung",ek=ex+"Browser",eO=ex+" Internet",eR="Chrome",eT=eR+" OS",eP=eR+" iOS",eF="Internet Explorer",eI=eF+" "+eg,eC="Opera",e$=eC+" Mini",eA="Edge",eM="Microsoft "+eA,eN="Firefox",eL=eN+" iOS",eD="Nintendo",ej="PlayStation",eU="Xbox",eq=ev+" "+eg,eH=eg+" "+eE,ez="Windows",eV=ez+" Phone",eB="Nokia",eW="Ouya",eG="Generic",eY=eG+" "+eg.toLowerCase(),eK=eG+" "+ef.toLowerCase(),eX="Konqueror",eZ="(\\d+(\\.\\d+)?)",eJ=RegExp("Version/"+eZ),eQ=RegExp(eU,"i"),e0=RegExp(ej+" \\w+","i"),e1=RegExp(eD+" \\w+","i"),e2=RegExp(eS+"|PlayBook|BB10","i"),e3={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},qt=(c,u)=>u&&w(u,eb)||w(c,eE)&&!w(c,eR)&&!w(c,ev),Wt=function(c,u){return u=u||"",w(c," OPR/")&&w(c,"Mini")?e$:w(c," OPR/")?eC:e2.test(c)?eS:w(c,"IE"+eg)||w(c,"WPDesktop")?eI:w(c,ek)?eO:w(c,eA)||w(c,"Edg/")?eM:w(c,"FBIOS")?"Facebook "+eg:w(c,"UCWEB")||w(c,"UCBrowser")?"UC Browser":w(c,"CriOS")?eP:w(c,"CrMo")||w(c,eR)?eR:w(c,ev)&&w(c,eE)?eq:w(c,"FxiOS")?eL:w(c.toLowerCase(),eX.toLowerCase())?eX:qt(c,u)?w(c,eg)?eH:eE:w(c,eN)?eN:w(c,"MSIE")||w(c,"Trident/")?eF:w(c,"Gecko")?eN:""},e5={[eI]:[RegExp("rv:"+eZ)],[eM]:[RegExp(eA+"?\\/"+eZ)],[eR]:[RegExp("("+eR+"|CrMo)\\/"+eZ)],[eP]:[RegExp("CriOS\\/"+eZ)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eZ)],[eE]:[eJ],[eH]:[eJ],[eC]:[RegExp("(Opera|OPR)\\/"+eZ)],[eN]:[RegExp(eN+"\\/"+eZ)],[eL]:[RegExp("FxiOS\\/"+eZ)],[eX]:[RegExp("Konqueror[:/]?"+eZ,"i")],[eS]:[RegExp(eS+" "+eZ),eJ],[eq]:[RegExp("android\\s"+eZ,"i")],[eO]:[RegExp(ek+"\\/"+eZ)],[eF]:[RegExp("(rv:|MSIE )"+eZ)],Mozilla:[RegExp("rv:"+eZ)]},Vt=function(c,u){var h=e5[Wt(c,u)];if(O(h))return null;for(var d=0;d<h.length;d++){var v=h[d],m=c.match(v);if(m)return parseFloat(m[m.length-2])}return null},e4=[[RegExp(eU+"; "+eU+" (.*?)[);]","i"),c=>[eU,c&&c[1]||""]],[RegExp(eD,"i"),[eD,""]],[RegExp(ej,"i"),[ej,""]],[e2,[eS,""]],[RegExp(ez,"i"),(c,u)=>{if(/Phone/.test(u)||/WPDesktop/.test(u))return[eV,""];if(new RegExp(eg).test(u)&&!/IEMobile\b/.test(u))return[ez+" "+eg,""];var h=/Windows NT ([0-9.]+)/i.exec(u);if(h&&h[1]){var d=e3[h[1]]||"";return/arm/i.test(u)&&(d="RT"),[ez,d]}return[ez,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,c=>c&&c[3]?["iOS",[c[3],c[4],c[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,c=>{var u="";return c&&c.length>=3&&(u=O(c[2])?c[3]:c[2]),["watchOS",u]}],[RegExp("("+ev+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ev+")","i"),c=>c&&c[2]?[ev,[c[2],c[3],c[4]||"0"].join(".")]:[ev,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,c=>{var u=["Mac OS X",""];if(c&&c[1]){var h=[c[1],c[2],c[3]||"0"];u[1]=h.join(".")}return u}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eT,""]],[/Linux|debian/i,["Linux",""]]],Kt=function(c){return e1.test(c)?eD:e0.test(c)?ej:eQ.test(c)?eU:RegExp(eW,"i").test(c)?eW:RegExp("("+eV+"|WPDesktop)","i").test(c)?eV:/iPad/.test(c)?ey:/iPod/.test(c)?"iPod Touch":/iPhone/.test(c)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(c)?ew:e2.test(c)?eS:/(kobo)\s(ereader|touch)/i.test(c)?"Kobo":RegExp(eB,"i").test(c)?eB:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(c)||/(kf[a-z]+)( bui|\)).+silk\//i.test(c)?"Kindle Fire":/(Android|ZTE)/i.test(c)?new RegExp(eg).test(c)&&!
1/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(c)||/pixel[\daxl ]{1,6}/i.test(c)&&!/pixel c/i.test(c)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(c)||/lmy47v/i.test(c)&&!/QTAQZ3/i.test(c)?ev:em:RegExp("(pda|"+eg+")","i").test(c)?eY:RegExp(ef,"i").test(c)&&!RegExp(ef+" pc","i").test(c)?eK:""},Yt=c=>c instanceof Error;let Qt=class Qt{constructor(c,u,h){void 0===h&&(h=[]),this.coercers=c,this.stackParser=u,this.modifiers=h}buildFromUnknown(c,u){void 0===u&&(u={});var h=u&&u.mechanism||{handled:!0,type:"generic"},d=this.buildCoercingContext(h,u,0).apply(c),v=this.buildParsingContext(u),m=this.parseStacktrace(d,v);return{$exception_list:this.convertToExceptionList(m,h),$exception_level:"error"}}modifyFrames(c){var u=this;return p(function*(){for(var h of c)h.stacktrace&&h.stacktrace.frames&&ec(h.stacktrace.frames)&&(h.stacktrace.frames=yield u.applyModifiers(h.stacktrace.frames));return c})()}coerceFallback(c){var u;return{type:"Error",value:"Unknown error",stack:null==(u=c.syntheticException)?void 0:u.stack,synthetic:!0}}parseStacktrace(c,u){var h,d;return null!=c.cause&&(h=this.parseStacktrace(c.cause,u)),""!=c.stack&&null!=c.stack&&(d=this.applyChunkIds(this.stackParser(c.stack,c.synthetic?u.skipFirstLines:0),u.chunkIdMap)),_({},c,{cause:h,stack:d})}applyChunkIds(c,u){return c.map(c=>(c.filename&&u&&(c.chunk_id=u[c.filename]),c))}applyCoercers(c,u){for(var h of this.coercers)if(h.match(c))return h.coerce(c,u);return this.coerceFallback(u)}applyModifiers(c){var u=this;return p(function*(){var h=c;for(var d of u.modifiers)h=yield d(h);return h})()}convertToExceptionList(c,u){var h,d,v,m={type:c.type,value:c.value,mechanism:{type:null!==(h=u.type)&&void 0!==h?h:"generic",handled:null===(d=u.handled)||void 0===d||d,synthetic:null!==(v=c.synthetic)&&void 0!==v&&v}};c.stack&&(m.stacktrace={type:"raw",frames:c.stack});var b=[m];return null!=c.cause&&b.push(...this.convertToExceptionList(c.cause,_({},u,{handled:!0}))),b}buildParsingContext(c){var u;return{chunkIdMap:function(c){var u=globalThis._posthogChunkIds;if(u){var h=Object.keys(u);return e_&&h.length===ep||(ep=h.length,e_=h.reduce((h,d)=>{ed||(ed={});var v=ed[d];if(v)h[v[0]]=v[1];else for(var m=c(d),b=m.length-1;b>=0;b--){var S=m[b],k=null==S?void 0:S.filename,T=u[d];if(k&&T){h[k]=T,ed[d]=[k,T];break}}return h},{})),e_}}(this.stackParser),skipFirstLines:null!==(u=c.skipFirstLines)&&void 0!==u?u:1}}buildCoercingContext(c,u,h){void 0===h&&(h=0);var r=(h,d)=>{if(d<=4){var v=this.buildCoercingContext(c,u,d);return this.applyCoercers(h,v)}};return _({},u,{syntheticException:0==h?u.syntheticException:void 0,mechanism:c,apply:c=>r(c,h),next:c=>r(c,h+1)})}};function ti(c,u,h,d,v){var m={platform:c,filename:u,function:"<anonymous>"===h?"?":h,in_app:!0};return O(d)||(m.lineno=d),O(v)||(m.colno=v),m}var ii=(c,u)=>{var h=-1!==c.indexOf("safari-extension"),d=-1!==c.indexOf("safari-web-extension");return h||d?[-1!==c.indexOf("@")?c.split("@")[0]:"?",h?"safari-extension:"+u:"safari-web-extension:"+u]:[c,u]},e6=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,e8=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e7=/\((\S*)(?::(\d+))(?::(\d+))\)/,ni=(c,u)=>{var h=e6.exec(c);if(h){var[,d,v,m]=h;return ti(u,d,"?",+v,+m)}var b=e8.exec(c);if(b){if(b[2]&&0===b[2].indexOf("eval")){var S=e7.exec(b[2]);S&&(b[2]=S[1],b[3]=S[2],b[4]=S[3])}var[k,T]=ii(b[1]||"?",b[2]);return ti(u,T,k,b[3]?+b[3]:void 0,b[4]?+b[4]:void 0)}},e9=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,te=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,li=(c,u)=>{var h=e9.exec(c);if(h){if(h[3]&&h[3].indexOf(" > eval")>-1){var d=te.exec(h[3]);d&&(h[1]=h[1]||"eval",h[3]=d[1],h[4]=d[2],h[5]="")}var v=h[3],m=h[1]||"?";return[m,v]=ii(m,v),ti(u,v,m,h[4]?+h[4]:void 0,h[5]?+h[5]:void 0)}},tt=/\(error: (.*)\)/;let vi=class vi{match(c){return this.isDOMException(c)||this.isDOMError(c)}coerce(c,u){var h=M(c.stack);return{type:this.getType(c),value:this.getValue(c),stack:h?c.stack:void 0,cause:c.cause?u.next(c.cause):void 0,synthetic:!1}}getType(c){return this.isDOMError(c)?"DOMError":"DOMException"}getValue(c){var u=c.name||(this.isDOMError(c)?"DOMError":"DOMException");return c.message?u+": "+c.message:u}isDOMException(c){return q(c,"DOMException")}isDOMError(c){return q(c,"DOMError")}};let ci=class ci{match(c){return c instanceof Error}coerce(c,u){return{type:this.getType(c),value:this.getMessage(c,u),stack:this.getStack(c),cause:c.cause?u.next(c.cause):void 0,synthetic:!1}}getType(c){return c.name||c.constructor.name}getMessage(c,u){var h=c.message;return h.error&&"string"==typeof h.error.message?String(h.error.message):String(h)}getStack(c){return c.stacktrace||c.stack||void 0}};let fi=class fi{constructor(){}match(c){return q(c,"ErrorEvent")&&null!=c.error}coerce(c,u){var h;return u.apply(c.error)||{type:"ErrorEvent",value:c.message,stack:null==(h=u.syntheticException)?void 0:h.stack,synthetic:!0}}};var ta=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let _i=class _i{match(c){return"string"==typeof c}coerce(c,u){var h,[d,v]=this.getInfos(c);return{type:null!=d?d:"Error",value:null!=v?v:c,stack:null==(h=u.syntheticException)?void 0:h.stack,synthetic:!0}}getInfos(c){var u="Error",h=c,d=c.match(ta);return d&&(u=d[1],h=d[2]),[u,h]}};var tl=["fatal","error","warning","log","info","debug"];function mi(c,u){void 0===u&&(u=40);var h=Object.keys(c);if(h.sort(),!h.length)return"[object has no keys]";for(var d=h.length;d>0;d--){var v=h.slice(0,d).join(", ");
1if(!(v.length>u))return d===h.length||v.length<=u?v:v.slice(0,u)+"..."}return""}let bi=class bi{match(c){return"object"==typeof c&&null!==c}coerce(c,u){var h,d=this.getErrorPropertyFromObject(c);return d?u.apply(d):{type:this.getType(c),value:this.getValue(c),stack:null==(h=u.syntheticException)?void 0:h.stack,level:this.isSeverityLevel(c.level)?c.level:"error",synthetic:!0}}getType(c){return W(c)?c.constructor.name:"Error"}getValue(c){if("name"in c&&"string"==typeof c.name){var u="'"+c.name+"' captured as exception";return"message"in c&&"string"==typeof c.message&&(u+=" with message: '"+c.message+"'"),u}if("message"in c&&"string"==typeof c.message)return c.message;var h=this.getObjectClassName(c);return(h&&"Object"!==h?"'"+h+"'":"Object")+" captured as exception with keys: "+mi(c)}isSeverityLevel(c){return M(c)&&!A(c)&&tl.indexOf(c)>=0}getErrorPropertyFromObject(c){for(var u in c)if(Object.prototype.hasOwnProperty.call(c,u)){var h=c[u];if(Yt(h))return h}}getObjectClassName(c){try{var u=Object.getPrototypeOf(c);return u?u.constructor.name:void 0}catch(c){return}}};let yi=class yi{match(c){return W(c)}coerce(c,u){var h,d=c.constructor.name;return{type:d,value:d+" captured as exception with keys: "+mi(c),stack:null==(h=u.syntheticException)?void 0:h.stack,synthetic:!0}}};let wi=class wi{match(c){return B(c)}coerce(c,u){var h;return{type:"Error",value:"Primitive value captured as exception: "+String(c),stack:null==(h=u.syntheticException)?void 0:h.stack,synthetic:!0}}};let xi=class xi{match(c){return q(c,"PromiseRejectionEvent")}coerce(c,u){var h,d=this.getUnhandledRejectionReason(c);return B(d)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(d),stack:null==(h=u.syntheticException)?void 0:h.stack,synthetic:!0}:u.apply(d)}getUnhandledRejectionReason(c){if(B(c))return c;try{if("reason"in c)return c.reason;if("detail"in c&&"reason"in c.detail)return c.detail.reason}catch(c){}return c}};var $i=function(c,u){var{debugEnabled:h}=void 0===u?{}:u,v={k:function(u){if(d&&(J.DEBUG||Z.POSTHOG_DEBUG||h)&&!O(d.console)&&d.console){for(var v=("__rrweb_original__"in d.console[u])?d.console[u].__rrweb_original__:d.console[u],m=arguments.length,b=Array(m>1?m-1:0),S=1;S<m;S++)b[S-1]=arguments[S];v(c,...b)}},info:function(){for(var c=arguments.length,u=Array(c),h=0;h<c;h++)u[h]=arguments[h];v.k("log",...u)},warn:function(){for(var c=arguments.length,u=Array(c),h=0;h<c;h++)u[h]=arguments[h];v.k("warn",...u)},error:function(){for(var c=arguments.length,u=Array(c),h=0;h<c;h++)u[h]=arguments[h];v.k("error",...u)},critical:function(){for(var u=arguments.length,h=Array(u),d=0;d<u;d++)h[d]=arguments[d];console.error(c,...h)},uninitializedWarning:c=>{v.error("You must initialize PostHog before calling "+c)},createLogger:(u,h)=>$i(c+" "+u,h)};return v},tc=$i("[PostHog.js]"),tu=tc.createLogger,th=tu("[ExternalScriptsLoader]"),Pi=(c,u,h)=>{if(c.config.disable_external_dependency_loading)return th.warn(u+" was requested but loading of external scripts is disabled."),h("Loading of external scripts is disabled");var d=null==T?void 0:T.querySelectorAll("script");if(d){for(var v,m=0;m<d.length;m++)if(v=function(){if(d[m].src===u){var c=d[m];return c.__posthog_loading_callback_fired?{v:h()}:(c.addEventListener("load",u=>{c.__posthog_loading_callback_fired=!0,h(void 0,u)}),c.onerror=c=>h(c),{v:void 0})}}())return v.v}var l=()=>{if(!T)return h("document not found");var d=T.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=u,d.onload=c=>{d.__posthog_loading_callback_fired=!0,h(void 0,c)},d.onerror=c=>h(c),c.config.prepare_external_dependency_script&&(d=c.config.prepare_external_dependency_script(d)),!d)return h("prepare_external_dependency_script returned null");if("head"===c.config.external_scripts_inject_target)T.head.appendChild(d);else{var v,m=T.querySelectorAll("body > script");m.length>0?null==(v=m[0].parentNode)||v.insertBefore(d,m[0]):T.body.appendChild(d)}};null!=T&&T.body?l():null==T||T.addEventListener("DOMContentLoaded",l)};Z.__PosthogExtensions__=Z.__PosthogExtensions__||{},Z.__PosthogExtensions__.loadExternalDependency=(c,u,h)=>{var d="/static/"+u+".js?v="+c.version;"remote-config"===u&&(d="/array/"+c.config.token+"/config.js"),"toolbar"===u&&(d=d+"&t="+3e5*Math.floor(Date.now()/3e5));var v=c.requestRouter.endpointFor("assets",d);Pi(c,v,h)},Z.__PosthogExtensions__.loadSiteApp=(c,u,h)=>{var d=c.requestRouter.endpointFor("api",u);Pi(c,d,h)};var td={};
vendor: 7,683 bytes, line 1
1function Ci(c,u,h){if(ec(c)){if(b&&c.forEach===b)c.forEach(u,h);else if("length"in c&&c.length===+c.length){for(var d=0,v=c.length;d<v;d++)if(d in c&&u.call(h,c[d],d)===td)return}}}function Ii(c,u,h){if(!j(c)){if(ec(c))return Ci(c,u,h);if(z(c)){for(var d of c.entries())if(u.call(h,d[1],d[0])===td)return}else for(var v in c)if(ea.call(c,v)&&u.call(h,c[v],v)===td)return}}var Ri=function(c){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return Ci(h,function(u){for(var h in u)void 0!==u[h]&&(c[h]=u[h])}),c},Fi=function(c){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return Ci(h,function(u){Ci(u,function(u){c.push(u)})}),c};function Oi(c){for(var u=Object.keys(c),h=u.length,d=Array(h);h--;)d[h]=[u[h],c[u[h]]];return d}var Mi=function(c){try{return c()}catch(c){return}},Ai=function(c){return function(){try{for(var u=arguments.length,h=Array(u),d=0;d<u;d++)h[d]=arguments[d];return c.apply(this,h)}catch(c){tc.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tc.critical(c)}}},Di=function(c){var u={};return Ii(c,function(c,h){(M(c)&&c.length>0||L(c))&&(u[h]=c)}),u},tp=["herokuapp.com","vercel.app","netlify.app"];function Ui(c,u){for(var h=0;h<c.length;h++)if(u(c[h]))return c[h]}function zi(c,u,h,d){var{capture:v=!1,passive:m=!0}=null!=d?d:{};null==c||c.addEventListener(u,h,{capture:v,passive:m})}function Hi(c){return"ph_toolbar_internal"===c.name}var t_="$people_distinct_id",tg="__alias",tv="__timers",tf="$autocapture_disabled_server_side",tm="$heatmaps_enabled_server_side",ty="$exception_capture_enabled_server_side",tb="$error_tracking_suppression_rules",tw="$error_tracking_capture_extension_exceptions",tE="$web_vitals_enabled_server_side",tS="$dead_clicks_enabled_server_side",tx="$product_tours_enabled_server_side",tk="$web_vitals_allowed_metrics",tO="$session_recording_remote_config",tR="$sesid",tT="$session_is_sampled",tP="$enabled_feature_flags",tF="$early_access_features",tI="$feature_flag_details",tC="$stored_person_properties",t$="$stored_group_properties",tA="$surveys",tM="$flag_call_reported",tN="$feature_flag_errors",tL="$feature_flag_evaluated_at",tD="$user_state",tj="$client_session_props",tU="$capture_rate_limit",tq="$initial_campaign_params",tH="$initial_referrer_info",tz="$initial_person_info",tV="$epp",tB="__POSTHOG_TOOLBAR__",tW="$posthog_cookieless",tG=[t_,tg,"__cmpns",tv,"$session_recording_enabled_server_side",tm,tR,tP,tb,tD,tF,tI,t$,tC,tA,tM,tN,tL,tj,tU,tq,tH,tV,tz];Math.trunc||(Math.trunc=function(c){return c<0?Math.ceil(c):Math.floor(c)}),Number.isInteger||(Number.isInteger=function(c){return L(c)&&isFinite(c)&&Math.floor(c)===c});var tY="0123456789abcdef";let Ee=class Ee{constructor(c){if(this.bytes=c,16!==c.length)throw TypeError("not 128-bit length")}static fromFieldsV7(c,u,h,d){if(!Number.isInteger(c)||!Number.isInteger(u)||!Number.isInteger(h)||!Number.isInteger(d)||c<0||u<0||h<0||d<0||c>0xffffffffffff||u>4095||h>1073741823||d>4294967295)throw RangeError("invalid field value");var v=new Uint8Array(16);return v[0]=c/1099511627776,v[1]=c/4294967296,v[2]=c/16777216,v[3]=c/65536,v[4]=c/256,v[5]=c,v[6]=112|u>>>8,v[7]=u,v[8]=128|h>>>24,v[9]=h>>>16,v[10]=h>>>8,v[11]=h,v[12]=d>>>24,v[13]=d>>>16,v[14]=d>>>8,v[15]=d,new Ee(v)}toString(){for(var c="",u=0;u<this.bytes.length;u++)c=c+tY.charAt(this.bytes[u]>>>4)+tY.charAt(15&this.bytes[u]),3!==u&&5!==u&&7!==u&&9!==u||(c+="-");if(36!==c.length)throw Error("Invalid UUIDv7 was generated");return c}clone(){return new Ee(this.bytes.slice(0))}equals(c){return 0===this.compareTo(c)}compareTo(c){for(var u=0;u<16;u++){var h=this.bytes[u]-c.bytes[u];if(0!==h)return Math.sign(h)}return 0}};let Se=class Se{constructor(){this.P=0,this.T=0,this.C=new Te}generate(){var c=this.generateOrAbort();if(O(c)){this.P=0;var u=this.generateOrAbort();if(O(u))throw Error("Could not generate UUID after timestamp reset");return u}return c}generateOrAbort(){var c=Date.now();if(c>this.P)this.P=c,this.I();else{if(!(c+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return Ee.fromFieldsV7(this.P,Math.trunc(this.T/1073741824),1073741823&this.T,this.C.nextUint32())}I(){this.T=1024*this.C.nextUint32()+(1023&this.C.nextUint32())}};var tK,Pe=c=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var u=0;u<c.length;u++)c[u]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return c};d&&!O(d.crypto)&&crypto.getRandomValues&&(Pe=c=>crypto.getRandomValues(c));let Te=class Te{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(Pe(this.R),this.F=0),this.R[this.F++]}};var Ce=()=>Ie().toString(),Ie=()=>(tK||(tK=new Se)).generate(),tX="",tZ=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,tJ={O:()=>!!T,M:function(c){tc.error("cookieStore error: "+c)},A:function(c){if(T){try{for(var u=c+"=",h=T.cookie.split(";").filter(c=>c.length),d=0;d<h.length;d++){for(var v=h[d];" "==v.charAt(0);)v=v.substring(1,v.length);if(0===v.indexOf(u))return decodeURIComponent(v.substring(u.length,v.length))}}catch(c){}return null}},D:function(c){var u;try{u=JSON.parse(tJ.A(c))||{}}catch(c){}return u},j:function(c,u,h,d,v){if(T)try{var m="",b="",S=function(c,u){if(u){var h=function(c,u){if(void 0===u&&(u=T),tX)return tX;if(!u||["localhost","127.0.0.1"].includes(c))return"";for(var h=c.split("."),d=Math.min(h.length,8),v="dmn_chk_"+Ce();!tX&&d--;){var m=h.slice(d).join("."),b=v+"=1;domain=."+m+";path=/";u.cookie=b+";max-age=3",u.cookie.includes(v)&&(u.cookie=b+";max-age=0",tX=m)}return tX}(c);if(!h){var d,v=(d=c.match(tZ))?d[0]:"";v!==h&&tc.info("Warning: cookie subdomain discovery mismatch",v,h),h=v}return h?"; domain=."+h:""}return""}(T.location.hostname,d);if(h){var k=new Date;k.setTime(k.getTime()+24*h*36e5),m="; expires="+k.toUTCString()}v&&(b="; secure");var P=c+"="+encodeURIComponent(JSON.stringify(u))+m+"; SameSite=Lax; path=/"+S+b;return P.length>3686.4&&tc.warn("cookieStore warning: large cookie, len="+P.length),T.cookie=P,P}catch(c){return}},L:function(c,u){if(null!=T&&T.cookie)try{tJ.j(c,"",-1,u)}catch(c){return}}},tQ=null,t0={O:function(){if(!D(tQ))return tQ;var c=!0;if(O(d))c=!1;else try{var u="__mplssupport__";t0.j(u,"xyz"),'"xyz"'!==t0.A(u)&&(c=!1),t0.L(u)}catch(u){c=!1}return c||tc.error("localStorage unsupported; falling back to cookie store"),tQ=c,c},M:function(c){tc.error("localStorage error: "+c)},A:function(c){try{return null==d?void 0:d.localStorage.getItem(c)}catch(c){t0.M(c)}return null},D:function(c){try{return JSON.parse(t0.A(c))||{}}catch(c){}return null},j:function(c,u){try{null==d||d.localStorage.setItem(c,JSON.stringify(u))}catch(c){t0.M(c)}},L:function(c){try{null==d||d.localStorage.removeItem(c)}catch(c){t0.M(c)}}},t1=["$device_id","distinct_id",tR,tT,tV,tz,tD],t2={},t3={O:function(){return!0},M:function(c){tc.error("memoryStorage error: "+c)},A:function(c){return t2[c]||null},D:function(c){return t2[c]||null},j:function(c,u){t2[c]=u},L:function(c){delete t2[c]}},t5=null,t4={O:function(){if(!D(t5))return t5;if(t5=!0,O(d))t5=!1;else try{var c="__support__";t4.j(c,"xyz"),'"xyz"'!==t4.A(c)&&(t5=!1),t4.L(c)}catch(c){t5=!1}return t5},M:function(c){tc.error("sessionStorage error: ",c)},A:function(c){try{return null==d?void 0:d.sessionStorage.getItem(c)}catch(c){t4.M(c)}return null},D:function(c){try{return JSON.parse(t4.A(c))||null}catch(c){}return null},j:function(c,u){try{null==d||d.sessionStorage.setItem(c,JSON.stringify(u))}catch(c){t4.M(c)}},L:function(c){try{null==d||d.sessionStorage.removeItem(c)}catch(c){t4.M(c)}}},t6=((rA={}
1)[rA.PENDING=-1]="PENDING",rA[rA.DENIED=0]="DENIED",rA[rA.GRANTED=1]="GRANTED",rA);let Be=class Be{constructor(c){this._instance=c}get N(){return this._instance.config}get consent(){return this.U()?t6.DENIED:this.H}isOptedOut(){return"always"===this.N.cookieless_mode||this.consent===t6.DENIED||this.consent===t6.PENDING&&(this.N.opt_out_capturing_by_default||"on_reject"===this.N.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===t6.DENIED}optInOut(c){this.B.j(this.q,c?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:c,opt_out_capturing_cookie_prefix:u,consent_persistence_name:h}=this._instance.config;return h||(u?u+c:"__ph_opt_in_out_"+c)}get H(){var c=this.B.A(this.q);return V(c)?t6.GRANTED:w(eh,c)?t6.DENIED:t6.PENDING}get B(){if(!this.W){var c=this.N.opt_out_capturing_persistence_type;this.W="localStorage"===c?t0:tJ;var u="localStorage"===c?tJ:t0;u.A(this.q)&&(this.W.A(this.q)||this.optInOut(V(u.A(this.q))),u.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!Ui([null==k?void 0:k.doNotTrack,null==k?void 0:k.msDoNotTrack,Z.doNotTrack],c=>V(c))}};var t8=tu("[Dead Clicks]"),We=()=>!0,Ge=c=>{var u,h=!(null==(u=c.instance.persistence)||!u.get_property(tS)),d=c.instance.config.capture_dead_clicks;return U(d)?d:!!R(d)||h};let Ve=class Ve{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(c,u,h){this.instance=c,this.isEnabled=u,this.onCapture=h,this.startIfEnabledOrStop()}onRemoteConfig(c){"captureDeadClicks"in c&&(this.instance.persistence&&this.instance.persistence.register({[tS]:c.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(c){var u,h;null!=(u=Z.__PosthogExtensions__)&&u.initDeadClicksAutocapture&&c(),null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this.instance,"dead-clicks-autocapture",u=>{u?t8.error("failed to load script",u):c()})}J(){var c;if(T){if(!this.G&&null!=(c=Z.__PosthogExtensions__)&&c.initDeadClicksAutocapture){var u=R(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};u.__onCapture=this.onCapture,this.G=Z.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,u),this.G.start(T),t8.info("starting...")}}else t8.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,t8.info("stopping..."))}};var t7=tu("[SegmentIntegration]"),t9="posthog-js";function Xe(c,u){var{organization:h,projectId:d,prefix:v,severityAllowList:m=["error"],sendExceptionsToPostHog:b=!0}=void 0===u?{}:u;return u=>{if(!("*"===m||m.includes(u.level))||!c.__loaded)return u;u.tags||(u.tags={});var S,k,T,P,C,$=c.requestRouter.endpointFor("ui","/project/"+c.config.token+"/person/"+c.get_distinct_id());u.tags["PostHog Person URL"]=$,c.sessionRecordingStarted()&&(u.tags["PostHog Recording URL"]=c.get_session_replay_url({withTimestamp:!0}));var G=(null==(S=u.exception)?void 0:S.values)||[],X=G.map(c=>_({},c,{stacktrace:c.stacktrace?_({}
1,c.stacktrace,{type:"raw",frames:(c.stacktrace.frames||[]).map(c=>_({},c,{platform:"web:javascript"}))}):void 0})),Z={$exception_message:(null==(k=G[0])?void 0:k.value)||u.message,$exception_type:null==(T=G[0])?void 0:T.type,$exception_level:u.level,$exception_list:X,$sentry_event_id:u.event_id,$sentry_exception:u.exception,$sentry_exception_message:(null==(P=G[0])?void 0:P.value)||u.message,$sentry_exception_type:null==(C=G[0])?void 0:C.type,$sentry_tags:u.tags};return h&&d&&(Z.$sentry_url=(v||"https://sentry.io/organizations/")+h+"/issues/?project="+d+"&query="+u.event_id),b&&c.exceptions.sendExceptionEvent(Z),u}}let Qe=class Qe{constructor(c,u,h,d,v,m){this.name=t9,this.setupOnce=function(b){b(Xe(c,{organization:u,projectId:h,prefix:d,severityAllowList:v,sendExceptionsToPostHog:null==m||m}))}}};var Ze=c=>{var u=null==T?void 0:T.createElement("a");return O(u)?null:(u.href=c,u)},tr=function(c,u){void 0===u&&(u="&");var h,d,v=[];return Ii(c,function(c,u){O(c)||O(u)||"undefined"===u||(h=encodeURIComponent(c instanceof File?c.name:c.toString()),d=encodeURIComponent(u),v[v.length]=d+"="+h)}),v.join(u)},ir=function(c,u){for(var h,d=((c.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),v=0;v<d.length;v++){var m=d[v].split("=");if(m[0]===u){h=m;break}}if(!ec(h)||h.length<2)return"";var b=h[1];try{b=decodeURIComponent(b)}catch(c){tc.error("Skipping decoding for malformed query param: "+b)}return b.replace(/\+/g," ")},er=function(c,u,h){if(!c||!u||!u.length)return c;for(var d=c.split("#"),v=d[0]||"",m=d[1],b=v.split("?"),S=b[1],k=b[0],T=(S||"").split("&"),P=[],C=0;C<T.length;C++){var $=T[C].split("=");ec($)&&(u.includes($[0])?P.push($[0]+"="+h):P.push(T[C]))}var G=k;return null!=S&&(G+="?"+P.join("&")),null!=m&&(G+="#"+m),G},rr=function(c,u){var h=c.match(RegExp(u+"=([^&]*)"));return h?h[1]:null},ie=null!=d&&d.location?rr(d.location.hash,"__posthog")||rr(location.hash,"state"):null,it="_postHogToolbarParams",is=tu("[Toolbar]"),ia=((rM=ia||{})[rM.UNINITIALIZED=0]="UNINITIALIZED",rM[rM.LOADING=1]="LOADING",rM[rM.LOADED=2]="LOADED",rM);let lr=class lr{constructor(c){this.instance=c}K(c){Z.ph_toolbar_state=c}Y(){var c;return null!==(c=Z.ph_toolbar_state)&&void 0!==c?c:ia.UNINITIALIZED}maybeLoadToolbar(c,u,h){if(void 0===c&&(c=void 0),void 0===u&&(u=void 0),void 0===h&&(h=void 0),Hi(this.instance.config)||!d||!T)return!1;c=null!=c?c:d.location,h=null!=h?h:d.history;try{if(!u){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch(c){return!1}u=null==d?void 0:d.localStorage}var v,m=ie||rr(c.hash,"__posthog")||rr(c.hash,"state"),b=m?Mi(()=>JSON.parse(atob(decodeURIComponent(m))))||Mi(()=>JSON.parse(decodeURIComponent(m))):null;return b&&"ph_authorize"===b.action?((v=b).source="url",v&&Object.keys(v).length>0&&(b.desiredHash?c.hash=b.desiredHash:h?h.replaceState(h.state,"",c.pathname+c.search):c.hash="")):((v=JSON.parse(u.getItem(it)||"{}")).source="localstorage",delete v.userIntent),!(!v.token||this.instance.config.token!==v.token)&&(this.loadToolbar(v),!0)}catch(c){return!1}}X(c){var u=Z.ph_load_toolbar||Z.ph_load_editor;!j(u)&&I(u)?u(c,this.instance):is.warn("No toolbar load function found")}loadToolbar(c){var u,h=!(null==T||!T.getElementById(tB));if(!d||h)return!1;var v="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,m=_({token:this.instance.config.token},c,{apiURL:this.instance.requestRouter.endpointFor("ui")},v?{instrument:!1}:{});return(d.localStorage.setItem(it,JSON.stringify(_({},m,{source:void 0}))),this.Y()===ia.LOADED)?this.X(m):this.Y()===ia.UNINITIALIZED&&(this.K(ia.LOADING),null==(u=Z.__PosthogExtensions__)||null==u.loadExternalDependency||u.loadExternalDependency(this.instance,"toolbar",c=>{if(c)return is.error("[Toolbar] Failed to load",c),void this.K(ia.UNINITIALIZED);this.K(ia.LOADED),this.X(m)}),zi(d,"turbolinks:load",()=>{this.K(ia.UNINITIALIZED),this.loadToolbar(m)})),!0}Z(c){return this.loadToolbar(c)}maybeLoadEditor(c,u,h){return void 0===c&&(c=void 0),void 0===u&&(u=void 0),void 0===h&&(h=void 0),this.maybeLoadToolbar(c,u,h)}};let ur=class ur{constructor(c){this.tt=(c,u,h)=>{h&&(h.noSessionId||h.activityTimeout||h.sessionPastMaximumLength)&&(tc.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:c,changeReason:h}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=c,this.et()}et(){var c;this.rt=null==(c=this._instance.sessionManager)?void 0:c.onSessionId(this.tt)}destroy(){var c;null==(c=this.rt)||c.call(this),this.rt=void 0}doPageView(c,u){var h,v=this.st(c,u);return this.it={pathname:null!==(h=null==d?void 0:d.location.pathname)&&void 0!==h?h:"",pageViewId:u,timestamp:c},this._instance.scrollManager.resetContext(),v}doPageLeave(c){var u;return this.st(c,null==(u=this.it)?void 0:u.pageViewId)}doEvent(){var c;return{$pageview_id:null==(c=this.it)?void 0:c.pageViewId}}st(c,u){var h=this.it;if(!h)return{$pageview_id:u};var d={$pageview_id:u,$prev_pageview_id:h.pageViewId},v=this._instance.scrollManager.getContext();if(v&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:m,lastScrollY:b,maxScrollY:S,maxContentHeight:k,lastContentY:T,maxContentY:P}=v;if(!(O(m)||O(b)||O(S)||O(k)||O(T)||O(P))){m=Math.ceil(m),b=Math.ceil(b),S=Math.ceil(S),k=Math.ceil(k),T=Math.ceil(T),P=Math.ceil(P);var C=m<=1?1:K(b/m,0,1,tc),$=m<=1?1:K(S/m,0,1,tc),G=k<=1?1:K(T/k,0,1,tc),X=k<=1?1:K(P/k,0,1,tc);d=Ri(d,{$prev_pageview_last_scroll:b,$prev_pageview_last_scroll_percentage:C,$prev_pageview_max_scroll:S,$prev_pageview_max_scroll_percentage:$,$prev_pageview_last_content:T,$prev_pageview_last_content_percentage:G,$prev_pageview_max_content:P,$prev_pageview_max_content_percentage:X})}}return h.pathname&&(d.$prev_pageview_pathname=h.pathname),h.timestamp&&(d.$prev_pageview_duration=(c.getTime()-h.timestamp.getTime())/1e3),d}};var il=((rN={}
vendor: 4,144 bytes, line 1
1).GZipJS="gzip-js",rN.Base64="base64",rN),ic=Uint8Array,iu=Uint16Array,ih=Uint32Array,id=new ic([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ip=new ic([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),i_=new ic([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),mr=function(c,u){for(var h=new iu(31),d=0;d<31;++d)h[d]=u+=1<<c[d-1];var v=new ih(h[30]);for(d=1;d<30;++d)for(var m=h[d];m<h[d+1];++m)v[m]=m-h[d]<<5|d;return[h,v]},ig=mr(id,2),iv=ig[0],im=ig[1];iv[28]=258,im[258]=28;for(var iy=mr(ip,0)[1],ib=new iu(32768),iw=0;iw<32768;++iw){var iE=(43690&iw)>>>1|(21845&iw)<<1;iE=(61680&(iE=(52428&iE)>>>2|(13107&iE)<<2))>>>4|(3855&iE)<<4,ib[iw]=((65280&iE)>>>8|(255&iE)<<8)>>>1}var kr=function(c,u,h){for(var d=c.length,v=0,m=new iu(u);v<d;++v)++m[c[v]-1];var b,S=new iu(u);for(v=0;v<u;++v)S[v]=S[v-1]+m[v-1]<<1;if(h){b=new iu(1<<u);var k=15-u;for(v=0;v<d;++v)if(c[v])for(var T=v<<4|c[v],P=u-c[v],C=S[c[v]-1]++<<P,$=C|(1<<P)-1;C<=$;++C)b[ib[C]>>>k]=T}else for(b=new iu(d),v=0;v<d;++v)b[v]=ib[S[c[v]-1]++]>>>15-c[v];return b},iS=new ic(288);for(iw=0;iw<144;++iw)iS[iw]=8;for(iw=144;iw<256;++iw)iS[iw]=9;for(iw=256;iw<280;++iw)iS[iw]=7;for(iw=280;iw<288;++iw)iS[iw]=8;var ix=new ic(32);for(iw=0;iw<32;++iw)ix[iw]=5;var ik=kr(iS,9,0),iO=kr(ix,5,0),Rr=function(c){return(c/8>>0)+(7&c&&1)},Fr=function(c,u,h){(null==h||h>c.length)&&(h=c.length);var d=new(c instanceof iu?iu:c instanceof ih?ih:ic)(h-u);return d.set(c.subarray(u,h)),d},Or=function(c,u,h){h<<=7&u;var d=u/8>>0;c[d]|=h,c[d+1]|=h>>>8},Mr=function(c,u,h){h<<=7&u;var d=u/8>>0;c[d]|=h,c[d+1]|=h>>>8,c[d+2]|=h>>>16},Ar=function(c,u){for(var h=[],d=0;d<c.length;++d)c[d]&&h.push({s:d,f:c[d]});var v=h.length,m=h.slice();if(!v)return[new ic(0),0];if(1==v){var b=new ic(h[0].s+1);return b[h[0].s]=1,[b,1]}h.sort(function(c,u){return c.f-u.f}),h.push({s:-1,f:25001});var S=h[0],k=h[1],T=0,P=1,C=2;for(h[0]={s:-1,f:S.f+k.f,l:S,r:k};P!=v-1;)S=h[h[T].f<h[C].f?T++:C++],k=h[T!=P&&h[T].f<h[C].f?T++:C++],h[P++]={s:-1,f:S.f+k.f,l:S,r:k};var $=m[0].s;for(d=1;d<v;++d)m[d].s>$&&($=m[d].s);var G=new iu($+1),X=Dr(h[P-1],G,0);if(X>u){d=0;var Z=0,J=X-u,Q=1<<J;for(m.sort(function(c,u){return G[u.s]-G[c.s]||c.f-u.f});d<v;++d){var ee=m[d].s;if(!(G[ee]>u))break;Z+=Q-(1<<X-G[ee]),G[ee]=u}for(Z>>>=J;Z>0;){var et=m[d].s;G[et]<u?Z-=1<<u-G[et]++-1:++d}for(;d>=0&&Z;--d){var ei=m[d].s;G[ei]==u&&(--G[ei],++Z)}X=u}return[new ic(G),X]},Dr=function(c,u,h){return -1==c.s?Math.max(Dr(c.l,u,h+1),Dr(c.r,u,h+1)):u[c.s]=h},jr=function(c){for(var u=c.length;u&&!c[--u];);for(var h=new iu(++u),d=0,v=c[0],m=1,o=function(c){h[d++]=c},b=1;b<=u;++b)if(c[b]==v&&b!=u)++m;else{if(!v&&m>2){for(;m>138;m-=138)o(32754);m>2&&(o(m>10?m-11<<5|28690:m-3<<5|12305),m=0)}else if(m>3){for(o(v),--m;m>6;m-=6)o(8304);m>2&&(o(m-3<<5|8208),m=0)}for(;m--;)o(v);m=1,v=c[b]}return[h.subarray(0,d),u]},Lr=function(c,u){for(var h=0,d=0;d<u.length;++d)h+=c[d]*u[d];return h},Nr=function(c,u,h){var d=h.length,v=Rr(u+2);c[v]=255&d,c[v+1]=d>>>8,c[v+2]=255^c[v],c[v+3]=255^c[v+1];for(var m=0;m<d;++m)c[v+m+4]=h[m];return 8*(v+4+d)},Ur=function(c,u,h,d,v,m,b,S,k,T,P){Or(u,P++,h),++v[256];for(var C=Ar(v,15),$=C[0],G=C[1],X=Ar(m,15),Z=X[0],J=X[1],Q=jr($),ee=Q[0],et=Q[1],ei=jr(Z),ea=ei[0],el=ei[1],ec=new iu(19),eu=0;eu<ee.length;++eu)ec[31&ee[eu]]++;for(eu=0;eu<ea.length;++eu)ec[31&ea[eu]]++;for(var eh=Ar(ec,7),ed=eh[0],ep=eh[1],e_=19;e_>4&&!ed[i_[e_-1]];--e_);var eg,ev,ef,em,ey=T+5<<3,eb=Lr(v,iS)+Lr(m,ix)+b,ew=Lr(v,$)+Lr(m,Z)+b+14+3*e_+Lr(ec,ed)+(2*ec[16]+3*ec[17]+7*ec[18]);if(ey<=eb&&ey<=ew)return Nr(u,P,c.subarray(k,k+T));if(Or(u,P,1+(ew<eb)),P+=2,ew<eb){eg=kr($,G,0),ev=$,ef=kr(Z,J,0),em=Z;var eE=kr(ed,ep,0);for(Or(u,P,et-257),Or(u,P+5,el-1),Or(u,P+10,e_-4),P+=14,eu=0;eu<e_;++eu)Or(u,P+3*eu,ed[i_[eu]]);P+=3*e_;for(var eS=[ee,ea],ex=0;ex<2;++ex){var ek=eS[ex];for(eu=0;eu<ek.length;++eu){var eO=31&ek[eu];Or(u,P,eE[eO]),P+=ed[eO],eO>15&&(Or(u,P,ek[eu]>>>5&127),P+=ek[eu]>>>12)}}}else eg=ik,ev=iS,ef=iO,em=ix;for(eu=0;eu<S;++eu)if(d[eu]>255){Mr(u,P,eg[(eO=d[eu]>>>18&31)+257]),P+=ev[eO+257],eO>7&&(Or(u,P,d[eu]>>>23&31),P+=id[eO]);var eR=31&d[eu];Mr(u,P,ef[eR]),P+=em[eR],eR>3&&(Mr(u,P,d[eu]>
1>>5&8191),P+=ip[eR])}else Mr(u,P,eg[d[eu]]),P+=ev[d[eu]];return Mr(u,P,eg[256]),P+ev[256]},iR=new ih([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iT=function(){for(var c=new ih(256),u=0;u<256;++u){for(var h=u,d=9;--d;)h=(1&h&&3988292384)^h>>>1;c[u]=h}return c}(),qr=function(c,u,h){for(;h;++u)c[u]=h,h>>>=8},Gr=function(c){var u,h,d,v,m="";for(u=h=0,d=(c=(c+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,v=0;v<d;v++){var b=c.charCodeAt(v),S=null;b<128?h++:S=b>127&&b<2048?String.fromCharCode(b>>6|192,63&b|128):String.fromCharCode(b>>12|224,b>>6&63|128,63&b|128),D(S)||(h>u&&(m+=c.substring(u,h)),m+=S,u=h=v+1)}return h>u&&(m+=c.substring(u,c.length)),m},iP=!!$||!!C,iF="text/plain",Kr=function(c,u,h){void 0===h&&(h=!0);var d,[v,m]=c.split("?"),b=_({},u),S=null!==(d=null==m?void 0:m.split("&").map(c=>{var u,[d,v]=c.split("="),m=h&&null!==(u=b[d])&&void 0!==u?u:v;return delete b[d],d+"="+m}))&&void 0!==d?d:[],k=tr(b);return k&&S.push(k),v+"?"+S.join("&")},Yr=(c,u)=>JSON.stringify(c,(c,u)=>"bigint"==typeof u?u.toString():u,u),Xr=c=>{var{data:u,compression:h}=c;if(u){if(h===il.GZipJS){var d,v,m,b,S,k,T,P,C=(d=function(c,u){var h=c.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(c);for(var d=new ic(c.length+(c.length>>>1)),v=0,n=function(c){d[v++]=c},m=0;m<h;++m){if(v+5>d.length){var b=new ic(v+8+(h-m<<1));b.set(d),d=b}var S=c.charCodeAt(m);S<128?n(S):(S<2048?n(192|S>>>6):(S>55295&&S<57344?(n(240|(S=65536+(1047552&S)|1023&c.charCodeAt(++m))>>>18),n(128|S>>>12&63)):n(224|S>>>12),n(128|S>>>6&63)),n(128|63&S))}return Fr(d,0,v)}(Yr(u)),v={mtime:0},m=4294967295,b={p:function(c){for(var u=m,h=0;h<c.length;++h)u=iT[255&u^c[h]]^u>>>8;m=u},d:function(){return 4294967295^m}},S=d.length,b.p(d),P=(k=10+(v.filename&&v.filename.length+1||0),T=function(c,u,h,d,v,m){var b=c.length,S=new ic(d+b+5*(1+Math.floor(b/7e3))+v),k=S.subarray(d,S.length-v),T=0;if(!u||b<8)for(var P=0;P<=b;P+=65535){var C=P+65535;C<b?T=Nr(k,T,c.subarray(P,C)):(k[P]=m,T=Nr(k,T,c.subarray(P,b)))}else{for(var $=iR[u-1],G=$>>>13,X=8191&$,Z=(1<<h)-1,J=new iu(32768),Q=new iu(Z+1),ee=Math.ceil(h/3),et=2*ee,y=function(u){return(c[u]^c[u+1]<<ee^c[u+2]<<et)&Z},ei=new ih(25e3),ea=new iu(288),el=new iu(32),ec=0,eu=0,eh=(P=0,0),ed=0,ep=0;P<b;++P){var e_=y(P),eg=32767&P,ev=Q[e_];if(J[eg]=ev,Q[e_]=eg,ed<=P){var ef=b-P;if((ec>7e3||eh>24576)&&ef>423){T=Ur(c,k,0,ei,ea,el,eu,eh,ep,P-ep,T),eh=ec=eu=0,ep=P;for(var em=0;em<286;++em)ea[em]=0;for(em=0;em<30;++em)el[em]=0}var ey=2,eb=0,ew=X,eE=eg-ev&32767;if(ef>2&&e_==y(P-eE))for(var eS=Math.min(G,ef)-1,ex=Math.min(32767,P),ek=Math.min(258,ef);eE<=ex&&--ew&&eg!=ev;){if(c[P+ey]==c[P+ey-eE]){for(var eO=0;eO<ek&&c[P+eO]==c[P+eO-eE];++eO);if(eO>ey){if(ey=eO,eb=eE,eO>eS)break;var eR=Math.min(eE,eO-2),eT=0;for(em=0;em<eR;++em){var eP=P-eE+em+32768&32767,eF=eP-J[eP]+32768&32767;eF>eT&&(eT=eF,ev=eP)}}}eE+=(eg=ev)-(ev=J[eg])+32768&32767}if(eb){ei[eh++]=268435456|im[ey]<<18|iy[eb];var eI=31&im[ey],eC=31&iy[eb];eu+=id[eI]+ip[eC],++ea[257+eI],++el[eC],ed=P+ey,++ec}else ei[eh++]=c[P],++ea[c[P]]}}T=Ur(c,k,m,ei,ea,el,eu,eh,ep,P-ep,T)}return Fr(S,0,d+Rr(T)+v)}(d,null==v.level?6:v.level,null==v.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(d.length)))):12+v.mem,k,8,!0)).length,function(c,u){var h=u.filename;if(c[0]=31,c[1]=139,c[2]=8,c[8]=u.level<2?4:9==u.level?2:0,c[9]=3,0!=u.mtime&&qr(c,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),h){c[3]=8;for(var d=0;d<=h.length;++d)c[d+10]=h.charCodeAt(d)}}(T,v),qr(T,P-8,b.d()),qr(T,P-4,S),T),$=new Blob([C],{type:iF});return{contentType:iF,body:$,estimatedSize:$.size}}if(h===il.Base64){var G,X="data="+encodeURIComponent("string"==typeof(G=function(c){var u,h,d,v,m,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",S=0,k=0,T="",P=[];if(!c)return c;c=Gr(c);do u=(m=c.charCodeAt(S++)<<16|c.charCodeAt(S++)<<8|c.charCodeAt(S++))>>18&63,h=m>>12&63,d=m>>6&63,v=63&m,P[k++]=b.charAt(u)+b.charAt(h)+b.charAt(d)+b.charAt(v);while(S<c.length);switch(T=P.join(""),c.length%3){case 1:T=T.slice(0,-2)+"==";break;case 2:T=T.slice(0,-1)+"="}return T}(Yr(u)))?G:Yr(G));return{contentType:"application/x-www-form-urlencoded",body:X,estimatedSize:new Blob([X]).size}}var Z=Yr(u);return{contentType:"application/json",body:Z,estimatedSize:new Blob([Z]).size}}},iI=[];C&&iI.push({transport:"fetch",method:c=>{var u,h,{contentType:d,body:v,estimatedSize:m}=null!==(u=Xr(c))&&void 0!==u?u:{},b=new Headers;Ii(c.headers,function(c,u){b.append(u,c)}),d&&b.append("Content-Type",d);var S=c.url,k=null;if(G){var T=new G;k={signal:T.signal,timeout:setTimeout(()=>T.abort(),c.timeout)}}C(S,_({method:(null==c?void 0:c.method)||"GET",headers:b,keepalive:"POST"===c.method&&52428.8>(m||0),body:v,signal:null==(h=k)?void 0:h.signal},c.fetchOptions)).then(u=>u.text().then(h=>{var d={statusCode:u.status,text:h};if(200===u.status)try{d.json=JSON.parse(h)}catch(c){tc.error(c)}null==c.callback||c.callback(d)})).catch(u=>{tc.error(u),null==c.callback||c.callback({statusCode:0,error:u})}).finally(()=>k?clearTimeout(k.timeout):null)}}),$&&iI.push({transport:"XHR",method:c=>{var u,h=new $;h.open(c.method||"GET",c.url,!0);var{contentType:d,body:v}=null!==(u=Xr(c))&&void 0!==u?u:{};Ii(c.headers,function(c,u){h.setRequestHeader(u,c)}),d&&h.setRequestHeader("Content-Type",d),c.timeout&&(h.timeout=c.timeout),c.disableXHRCredentials||(h.withCredentials=!0),h.onreadystatechange=()=>{if(4===h.readyState){var u={statusCode:h.status,text:h.responseText};
1if(200===h.status)try{u.json=JSON.parse(h.responseText)}catch(c){}null==c.callback||c.callback(u)}},h.send(v)}}),null!=k&&k.sendBeacon&&iI.push({transport:"sendBeacon",method:c=>{var u=Kr(c.url,{beacon:"1"});try{var h,{contentType:d,body:v}=null!==(h=Xr(c))&&void 0!==h?h:{},m="string"==typeof v?new Blob([v],{type:d}):v;k.sendBeacon(u,m)}catch(c){}}});var Zr=function(c,u){if(!function(c){try{new RegExp(c)}catch(c){return!1}return!0}(u))return!1;try{return new RegExp(u).test(c)}catch(c){return!1}};function ts(c,u,h){return Yr({distinct_id:c,userPropertiesToSet:u,userPropertiesToSetOnce:h})}var iC={exact:(c,u)=>u.some(u=>c.some(c=>u===c)),is_not:(c,u)=>u.every(u=>c.every(c=>u!==c)),regex:(c,u)=>u.some(u=>c.some(c=>Zr(u,c))),not_regex:(c,u)=>u.every(u=>c.every(c=>!Zr(u,c))),icontains:(c,u)=>u.map(es).some(u=>c.map(es).some(c=>u.includes(c))),not_icontains:(c,u)=>u.map(es).every(u=>c.map(es).every(c=>!u.includes(c))),gt:(c,u)=>u.some(u=>{var h=parseFloat(u);return!isNaN(h)&&c.some(c=>h>parseFloat(c))}),lt:(c,u)=>u.some(u=>{var h=parseFloat(u);return!isNaN(h)&&c.some(c=>h<parseFloat(c))})},es=c=>c.toLowerCase();function rs(c,u){return!c||Object.entries(c).every(c=>{var[h,d]=c,v=null==u?void 0:u[h];if(O(v)||D(v))return!1;var m=[String(v)],b=iC[d.operator];return!!b&&b(d.values,m)})}var i$=tu("[Error tracking]");let ns=class ns{constructor(c){var u,h;this.nt=[],this.ot=new Qt([new vi,new xi,new fi,new ci,new yi,new bi,new _i,new wi],function(c){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return function(u,d){void 0===d&&(d=0);for(var v=[],m=u.split("\n"),b=d;b<m.length;b++){var S=m[b];if(!(S.length>1024)){var k=tt.test(S)?S.replace(tt,"$1"):S;if(!k.match(/\S*Error: /)){for(var T of h){var P=T(k,c);if(P){v.push(P);break}}if(v.length>=50)break}}}return function(c){if(!c.length)return[];var u=Array.from(c);return u.reverse(),u.slice(0,50).map(c=>_({},c,{filename:c.filename||(u[u.length-1]||{}).filename,function:c.function||"?"}))}(v)}}("web:javascript",ni,li)),this._instance=c,this.nt=null!==(u=null==(h=this._instance.persistence)?void 0:h.get_property(tb))&&void 0!==u?u:[]}onRemoteConfig(c){var u,h,d;if("errorTracking"in c){var v=null!==(u=null==(h=c.errorTracking)?void 0:h.suppressionRules)&&void 0!==u?u:[],m=null==(d=c.errorTracking)?void 0:d.captureExtensionExceptions;this.nt=v,this._instance.persistence&&this._instance.persistence.register({[tb]:this.nt,[tw]:m})}}get ut(){var c,u=!!this._instance.get_property(tw),h=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(c=null!=h?h:u)&&void 0!==c&&c}buildProperties(c,u){return this.ot.buildFromUnknown(c,{syntheticException:null==u?void 0:u.syntheticException,mechanism:{handled:null==u?void 0:u.handled}})}sendExceptionEvent(c){var u=c.$exception_list;if(this.ht(u)){if(this.dt(u))return void i$.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(u))return void i$.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(u))return void i$.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",c,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(c){if(0===c.length)return!1;var u=c.reduce((c,u)=>{var{type:h,value:d}=u;return M(h)&&h.length>0&&c.$exception_types.push(h),M(d)&&d.length>0&&c.$exception_values.push(d),c},{$exception_types:[],$exception_values:[]});return this.nt.some(c=>{var h=c.values.map(c=>{var h,d=iC[c.operator],v=ec(c.value)?c.value:[c.value],m=null!==(h=u[c.key])&&void 0!==h?h:[];return v.length>0&&d(v,m)});return"OR"===c.type?h.some(Boolean):h.every(Boolean)})}vt(c){return c.flatMap(c=>{var u,h;return null!==(u=null==(h=c.stacktrace)?void 0:h.frames)&&void 0!==u?u:[]}).some(c=>c.filename&&c.filename.startsWith("chrome-extension://"))}ct(c){if(c.length>0){var u,h,d,v,m=null!==(u=null==(h=c[0].stacktrace)?void 0:h.frames)&&void 0!==u?u:[],b=m[m.length-1];return null!==(d=null==b||null==(v=b.filename)?void 0:v.includes("posthog.com/static"))&&void 0!==d&&d}return!1}ht(c){return!j(c)&&ec(c)}};var iA="https?://(.*)",iM=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],iN=Fi(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],iM),iL="<masked>",iD=["li_fat_id"];function ds(c,u,h){if(!T)return{};var d,v=u?Fi([],iM,h||[]):[],m=vs(er(T.URL,v,iL),c);return Ri((d={},Ii(iD,function(c){var u=tJ.A(c);d[c]=u||null}),d),m)}function vs(c,u){var h=iN.concat(u||[]),d={};return Ii(h,function(u){var h=ir(c,u);d[u]=h||null}),d}function cs(c){var u=c?0===c.search(iA+"google.([^/?]*)")?"google":0===c.search(iA+"bing.com")?"bing":0===c.search(iA+"yahoo.com")?"yahoo":0===c.search(iA+"duckduckgo.com")?"duckduckgo":null:null,h="yahoo"!=u?"q":"p",d={};if(!D(u)){d.$search_engine=u;var v=T?ir(T.referrer,h):"";v.length&&(d.ph_keyword=v)}return d}function fs(){return navigator.language||navigator.userLanguage}function ps(){return(null==T?void 0:T.referrer)||"$direct"}function _s(c,u){var h=c?Fi([],iM,u||[]):[],d=null==P?void 0:P.href.substring(0,1e3);return{r:ps().substring(0,1e3),u:d?er(d,h,iL):void 0}}function gs(c){var u,{r:h,u:d}=c,v={$referrer:h,$referring_domain:null==h?void 0:"$direct"==h?"$direct":null==(u=Ze(h))?void 0:u.host};
1if(d){v.$current_url=d;var m=Ze(d);v.$host=null==m?void 0:m.host,v.$pathname=null==m?void 0:m.pathname,Ri(v,vs(d))}return h&&Ri(v,cs(h)),v}function ms(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(c){return}}var ij=tu("[FeatureFlags]"),iU=tu("[FeatureFlags]",{debugEnabled:!0}),Cs=c=>"api_error_"+c,iq="$active_feature_flags",iH="$override_feature_flags",iz="$feature_flag_payloads",iV="$override_feature_flag_payloads",iB="$feature_flag_request_id",As=c=>{var u={};for(var[h,d]of Oi(c||{}))d&&(u[h]=d);return u},Ds=c=>{var u=c.flags;return u?(c.featureFlags=Object.fromEntries(Object.keys(u).map(c=>{var h;return[c,null!==(h=u[c].variant)&&void 0!==h?h:u[c].enabled]})),c.featureFlagPayloads=Object.fromEntries(Object.keys(u).filter(c=>u[c].enabled).filter(c=>{var h;return null==(h=u[c].metadata)?void 0:h.payload}).map(c=>{var h;return[c,null==(h=u[c].metadata)?void 0:h.payload]}))):ij.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),c},iW=((rL={}).FeatureFlags="feature_flags",rL.Recordings="recordings",rL);let Ls=class Ls{constructor(c){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this.St=!1,this._instance=c,this.featureFlagEventHandlers=[]}kt(){var c,u;return null!==(c=null==(u=this._instance.persistence)?void 0:u.Pt(this._instance.config.feature_flag_cache_ttl_ms))&&void 0!==c&&c}Tt(){return!!this.kt()&&(this.St||this.yt||(this.St=!0,ij.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ct(){var c,u=null!==(c=this._instance.config.evaluation_contexts)&&void 0!==c?c:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(ij.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),null!=u&&u.length?u.filter(c=>{var u=c&&"string"==typeof c&&c.trim().length>0;return u||ij.error("Invalid evaluation context found:",c,"Expected non-empty string"),u}):[]}It(){return this.Ct().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var c=this._instance.get_property(tI),u=this._instance.get_property(iH),h=this._instance.get_property(iV);if(!h&&!u)return c||{};var d=Ri({},c||{});for(var v of[...new Set([...Object.keys(h||{}),...Object.keys(u||{})])]){var m,b,S=d[v],k=null==u?void 0:u[v],T=O(k)?null!==(m=null==S?void 0:S.enabled)&&void 0!==m&&m:!!k,P=O(k)?S.variant:"string"==typeof k?k:void 0,C=null==h?void 0:h[v],$=_({},S,{enabled:T,variant:T?null!=P?P:null==S?void 0:S.variant:void 0});T!==(null==S?void 0:S.enabled)&&($.original_enabled=null==S?void 0:S.enabled),P!==(null==S?void 0:S.variant)&&($.original_variant=null==S?void 0:S.variant),C&&($.metadata=_({},null==S?void 0:S.metadata,{payload:C,original_payload:null==S||null==(b=S.metadata)?void 0:b.payload})),d[v]=$}return this._t||(ij.warn(" Overriding feature flag details!",{flagDetails:c,overriddenPayloads:h,finalDetails:d}),this._t=!0),d}getFlagVariants(){var c=this._instance.get_property(tP),u=this._instance.get_property(iH);if(!u)return c||{};for(var h=Ri({},c),d=Object.keys(u),v=0;v<d.length;v++)h[d[v]]=u[d[v]];return this._t||(ij.warn(" Overriding feature flags!",{enabledFlags:c,overriddenFlags:u,finalFlags:h}),this._t=!0),h}getFlagPayloads(){var c=this._instance.get_property(iz),u=this._instance.get_property(iV);if(!u)return c||{};for(var h=Ri({},c||{}),d=Object.keys(u),v=0;v<d.length;v++)h[d[v]]=u[d[v]];return this._t||(ij.warn(" Overriding feature flag payloads!",{flagPayloads:c,overriddenPayloads:u,finalPayloads:h}),this._t=!0),h}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Rt||(this._instance.Ft.emit("featureFlagsReloading",!0),this.Rt=setTimeout(()=>{this.Ot()},5))}Mt(){clearTimeout(this.Rt),this.Rt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Rt||this.reloadFeatureFlags()}setAnonymousDistinctId(c){this.$anon_distinct_id=c}setReloadingPaused(c){this.wt=c}Ot(c){var u;if(this.Mt(),!this._instance.At()){if(this.yt)this.xt=!0;else{var h=this._instance.config.token,d=this._instance.get_property("$device_id"),v={token:h,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},(null==(u=this._instance.persistence)?void 0:u.get_initial_props())||{},this._instance.get_property(tC)||{}),group_properties:this._instance.get_property(t$),timezone:ms()};D(d)||O(d)||(v.$device_id=d),(null!=c&&c.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(v.disable_flags=!0),this.It()&&(v.evaluation_contexts=this.Ct());var m=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",b=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+m);this.yt=!0,this._instance._send_request({method:"POST",url:b,data:v,compression:this._instance.config.disable_compression?void 0:il.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var u,h,d,m=!0;if(200===c.statusCode&&(this.xt||(this.$anon_distinct_id=void 0),m=!1),this.yt=!1,!v.disable_flags||this.xt){this.$t
1=!m;var b,S=[];c.error?c.error instanceof Error?S.push("AbortError"===c.error.name?"timeout":"connection_error"):S.push("unknown_error"):200!==c.statusCode&&S.push(Cs(c.statusCode)),null!=(u=c.json)&&u.errorsWhileComputingFlags&&S.push("errors_while_computing_flags");var k=!(null==(h=c.json)||null==(h=h.quotaLimited)||!h.includes(iW.FeatureFlags));(k&&S.push("quota_limited"),null==(d=this._instance.persistence)||d.register({[tN]:S}),k)?ij.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(v.disable_flags||this.receivedFeatureFlags(null!==(b=c.json)&&void 0!==b?b:{},m),this.xt&&(this.xt=!1,this.Ot()))}}})}}}getFeatureFlag(c,u){var h;if(void 0===u&&(u={}),!u.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var d=this.getFeatureFlagResult(c,u);return null!==(h=null==d?void 0:d.variant)&&void 0!==h?h:null==d?void 0:d.enabled}}else ij.warn('getFeatureFlag for key "'+c+"\" failed. Feature flags didn't load in time.")}}getFeatureFlagDetails(c){return this.getFlagsWithDetails()[c]}getFeatureFlagPayload(c){var u=this.getFeatureFlagResult(c,{send_event:!1});return null==u?void 0:u.payload}getFeatureFlagResult(c,u){if(void 0===u&&(u={}),!u.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var h=this.getFlagVariants(),d=c in h,v=h[c],m=this.getFlagPayloads()[c],b=String(v),S=this._instance.get_property(iB)||void 0,k=this._instance.get_property(tL)||void 0,T=this._instance.get_property(tM)||{};if((u.send_event||!("send_event"in u))&&(!(c in T)||!T[c].includes(b))){ec(T[c])?T[c].push(b):T[c]=[b],null==(G=this._instance.persistence)||G.register({[tM]:T});var P=this.getFeatureFlagDetails(c),C=[...null!==(X=this._instance.get_property(tN))&&void 0!==X?X:[]];O(v)&&C.push("flag_missing");var $={$feature_flag:c,$feature_flag_response:v,$feature_flag_payload:m||null,$feature_flag_request_id:S,$feature_flag_evaluated_at:k,$feature_flag_bootstrapped_response:(null==(Z=this._instance.config.bootstrap)||null==(Z=Z.featureFlags)?void 0:Z[c])||null,$feature_flag_bootstrapped_payload:(null==(J=this._instance.config.bootstrap)||null==(J=J.featureFlagPayloads)?void 0:J[c])||null,$used_bootstrap_value:!this.$t};O(null==P||null==(Q=P.metadata)?void 0:Q.version)||($.$feature_flag_version=P.metadata.version);var G,X,Z,J,Q,ee,et,ei,ea,el,eu,eh=null!==(ee=null==P||null==(et=P.reason)?void 0:et.description)&&void 0!==ee?ee:null==P||null==(ei=P.reason)?void 0:ei.code;eh&&($.$feature_flag_reason=eh),null!=P&&null!=(ea=P.metadata)&&ea.id&&($.$feature_flag_id=P.metadata.id),O(null==P?void 0:P.original_variant)&&O(null==P?void 0:P.original_enabled)||($.$feature_flag_original_response=O(P.original_variant)?P.original_enabled:P.original_variant),null!=P&&null!=(el=P.metadata)&&el.original_payload&&($.$feature_flag_original_payload=null==P||null==(eu=P.metadata)?void 0:eu.original_payload),C.length&&($.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",$)}if(d){var ed=m;if(!O(m))try{ed=JSON.parse(m)}catch(c){}return{key:c,enabled:!!v,variant:"string"==typeof v?v:void 0,payload:ed}}}}else ij.warn('getFeatureFlagResult for key "'+c+"\" failed. Feature flags didn't load in time.")}}getRemoteConfigPayload(c,u){var h=this._instance.config.token,d={distinct_id:this._instance.get_distinct_id(),token:h};this.It()&&(d.evaluation_contexts=this.Ct()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:d,compression:this._instance.config.disable_compression?void 0:il.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:h=>{var d,v=null==(d=h.json)?void 0:d.featureFlagPayloads;u((null==v?void 0:v[c])||void 0)}})}isFeatureEnabled(c,u){if(void 0===u&&(u={}),!u.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var h=this.getFeatureFlag(c,u);return O(h)?void 0:!!h}ij.warn('isFeatureEnabled for key "'+c+"\" failed. Feature flags didn't load in time.")}}addFeatureFlagsHandler(c){this.featureFlagEventHandlers.push(c)}removeFeatureFlagsHandler(c){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(u=>u!==c)}receivedFeatureFlags(c,u){if(this._instance.persistence){this.bt=!0;var h=this.getFlagVariants(),d=this.getFlagPayloads(),v=this.getFlagsWithDetails();!function(c,u,h,d,v){void 0===h&&(h={}),void 0===d&&(d={}),void 0===v&&(v={});var m=Ds(c),b=m.flags,S=m.featureFlags,k=m.featureFlagPayloads;if(S){var T=c.requestId,P=c.evaluatedAt;if(ec(S)){ij.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(S)for(var $=0;$<S.length;$++)C[S[$]]=!0;u&&u.register({[iq]:S,[tP]:C})}else{var G=S,X=k,Z=b;if(c.errorsWhileComputingFlags){if(b){var J=new Set(Object.keys(b).filter(c=>{var u;return!(null!=(u=b[c])&&u.failed)}));G=_({},h,Object.fromEntries(Object.entries(G).filter(c=>{var[u]=c;return J.has(u)}))),X=_({},d,Object.fromEntries(Object.entries(X||{}).filter(c=>{var[u]=c;return J.has(u)}))),Z=_({},v,Object.fromEntries(Object.entries(Z||{}).filter(c=>{var[u]=c;return J.has(u)})))}else G=_({},h,G),X=_({},d,X),Z=_({},v,Z)}u&&u.register(_({[iq]:Object.keys(As(G)),[tP]:G||{},[iz]:X||{},[tI]:Z||{}},T?{[iB]:T}:{},P?{[tL]:P}:{}))}}}(c,this._instance.persistence,h,d,v),u||(this.St=!1),this.Dt(u)}}override(c,u){void 0===u&&(u=!1),ij.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:c,suppressWarning:u})}overrideFeatureFlags(c){if(!this._instance.__loaded||!this._instance.persistence)return ij.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===c)return this._instance.persistence.unregister(iH),this._instance.persistence.unregister(iV),this.Dt(),iU.info("All overrides cleared");
1if(c&&"object"==typeof c&&("flags"in c||"payloads"in c)){var u;if(this._t=!!(null!==(u=c.suppressWarning)&&void 0!==u&&u),"flags"in c){if(!1===c.flags)this._instance.persistence.unregister(iH),iU.info("Flag overrides cleared");else if(c.flags){if(ec(c.flags)){for(var h={},d=0;d<c.flags.length;d++)h[c.flags[d]]=!0;this._instance.persistence.register({[iH]:h})}else this._instance.persistence.register({[iH]:c.flags});iU.info("Flag overrides set",{flags:c.flags})}}return"payloads"in c&&(!1===c.payloads?(this._instance.persistence.unregister(iV),iU.info("Payload overrides cleared")):c.payloads&&(this._instance.persistence.register({[iV]:c.payloads}),iU.info("Payload overrides set",{payloads:c.payloads}))),void this.Dt()}this.Dt()}onFeatureFlags(c){if(this.addFeatureFlagsHandler(c),this.bt){var{flags:u,flagVariants:h}=this.jt();c(u,h)}return()=>this.removeFeatureFlagsHandler(c)}updateEarlyAccessFeatureEnrollment(c,u,h){var d,v=(this._instance.get_property(tF)||[]).find(u=>u.flagKey===c),m={["$feature_enrollment/"+c]:u},b={$feature_flag:c,$feature_enrollment:u,$set:m};v&&(b.$early_access_feature_name=v.name),h&&(b.$feature_enrollment_stage=h),this._instance.capture("$feature_enrollment_update",b),this.setPersonPropertiesForFlags(m,!1);var S=_({},this.getFlagVariants(),{[c]:u});null==(d=this._instance.persistence)||d.register({[iq]:Object.keys(As(S)),[tP]:S}),this.Dt()}getEarlyAccessFeatures(c,u,h){void 0===u&&(u=!1);var d=this._instance.get_property(tF),v=h?"&"+h.map(c=>"stage="+c).join("&"):"";if(d&&!u)return c(d);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+v),method:"GET",callback:u=>{var h,d;if(u.json){var v=u.json.earlyAccessFeatures;return null==(h=this._instance.persistence)||h.unregister(tF),null==(d=this._instance.persistence)||d.register({[tF]:v}),c(v)}}})}jt(){var c=this.getFlags(),u=this.getFlagVariants();return{flags:c.filter(c=>u[c]),flagVariants:Object.keys(u).filter(c=>u[c]).reduce((c,h)=>(c[h]=u[h],c),{})}}Dt(c){var{flags:u,flagVariants:h}=this.jt();this.featureFlagEventHandlers.forEach(d=>d(u,h,{errorsLoading:c}))}setPersonPropertiesForFlags(c,u){void 0===u&&(u=!0);var h=this._instance.get_property(tC)||{};this._instance.register({[tC]:_({},h,c)}),u&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tC)}setGroupPropertiesForFlags(c,u){void 0===u&&(u=!0);var h=this._instance.get_property(t$)||{};0!==Object.keys(h).length&&Object.keys(h).forEach(u=>{h[u]=_({},h[u],c[u]),delete c[u]}),this._instance.register({[t$]:_({},h,c)}),u&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(c){if(c){var u=this._instance.get_property(t$)||{};this._instance.register({[t$]:_({},u,{[c]:{}})})}else this._instance.unregister(t$)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Mt(),this._t=!1}};var iG=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];let Us=class Us{constructor(c,u){var h;this.N=c,this.props={},this.Lt=!1,this.Nt=(h="",c.token&&(h=c.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),c.persistence_name?"ph_"+c.persistence_name:"ph_"+h+"_posthog"),this.B=this.Ut(c),this.load(),c.debug&&tc.info("Persistence loaded",c.persistence,_({},this.props)),this.update_config(c,c,u),this.save()}isDisabled(){return!!this.zt}Ut(c){-1===iG.indexOf(c.persistence.toLowerCase())&&(tc.critical("Unknown persistence type "+c.persistence+"; falling back to localStorage+cookie"),c.persistence="localStorage+cookie");var u,h,v=(void 0===(u=c.cookie_persisted_properties||[])&&(u=[]),h=[...t1,...u],_({},t0,{D:function(c){try{var u={};try{u=tJ.D(c)||{}}catch(c){}var h=Ri(u,JSON.parse(t0.A(c)||"{}"));return t0.j(c,h),h}catch(c){}return null},j:function(c,u,d,v,m,b){try{t0.j(c,u,void 0,void 0,b);var S={};h.forEach(c=>{u[c]&&(S[c]=u[c])}),Object.keys(S).length&&tJ.j(c,S,d,v,m,b)}catch(c){t0.M(c)}},L:function(c,u){try{null==d||d.localStorage.removeItem(c),tJ.L(c,u)}catch(c){t0.M(c)}}})),m=c.persistence.toLowerCase();return"localstorage"===m&&t0.O()?t0:"localstorage+cookie"===m&&v.O()?v:"sessionstorage"===m&&t4.O()?t4:"memory"===m?t3:"cookie"===m?tJ:v.O()?v:tJ}Pt(c){var u=null!=c?c:this.N.feature_flag_cache_ttl_ms;if(!u||u<=0)return!1;var h=this.props[tL];return!h||"number"!=typeof h||Date.now()-h>u}properties(){var c={};return Ii(this.props,(u,h)=>
1{if(h===tP&&R(u)){if(!this.Pt())for(var d,v=Object.keys(u),m=0;m<v.length;m++)c["$feature/"+v[m]]=u[v[m]]}else d=!1,(D(tG)?d:S&&tG.indexOf===S?-1!=tG.indexOf(h):(Ii(tG,function(c){if(d||(d=c===h))return td}),d))||(c[h]=u)}),c}load(){if(!this.zt){var c=this.B.D(this.Nt);c&&(this.props=Ri({},c))}}save(){this.zt||this.B.j(this.Nt,this.props,this.Ht,this.Bt,this.qt,this.N.debug)}remove(){this.B.L(this.Nt,!1),this.B.L(this.Nt,!0)}clear(){this.remove(),this.props={}}register_once(c,u,h){if(R(c)){O(u)&&(u="None"),this.Ht=O(h)?this.Wt:h;var d=!1;if(Ii(c,(c,h)=>{this.props.hasOwnProperty(h)&&this.props[h]!==u||(this.props[h]=c,d=!0)}),d)return this.save(),!0}return!1}register(c,u){if(R(c)){this.Ht=O(u)?this.Wt:u;var h=!1;if(Ii(c,(u,d)=>{c.hasOwnProperty(d)&&this.props[d]!==u&&(this.props[d]=u,h=!0)}),h)return this.save(),!0}return!1}unregister(c){c in this.props&&(delete this.props[c],this.save())}update_campaign_params(){if(!this.Lt){var c=ds(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);F(Di(c))||this.register(c),this.Lt=!0}}update_search_keyword(){var c;this.register((c=null==T?void 0:T.referrer)?cs(c):{})}update_referrer_info(){var c;this.register_once({$referrer:ps(),$referring_domain:null!=T&&T.referrer&&(null==(c=Ze(T.referrer))?void 0:c.host)||"$direct"},void 0)}set_initial_person_info(){this.props[tq]||this.props[tH]||this.register_once({[tz]:_s(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var c={};Ii([tH,tq],u=>{var h=this.props[u];h&&Ii(h,function(u,h){c["$initial_"+E(h)]=u})});var u,h,d=this.props[tz];return d&&Ri(c,(u=gs(d),h={},Ii(u,function(c,u){h["$initial_"+E(u)]=c}),h)),c}safe_merge(c){return Ii(this.props,function(u,h){h in c||(c[h]=u)}),c}update_config(c,u,h){if(this.Wt=this.Ht=c.cookie_expiration,this.set_disabled(c.disable_persistence||!!h),this.set_cross_subdomain(c.cross_subdomain_cookie),this.set_secure(c.secure_cookie),c.persistence!==u.persistence||!((c,u)=>{if(c.length!==u.length)return!1;var h=[...c].sort(),d=[...u].sort();return h.every((c,u)=>c===d[u])})(c.cookie_persisted_properties||[],u.cookie_persisted_properties||[])){var d=this.Ut(c),v=this.props;this.clear(),this.B=d,this.props=v,this.save()}}set_disabled(c){this.zt=c,this.zt?this.remove():this.save()}set_cross_subdomain(c){c!==this.Bt&&(this.Bt=c,this.remove(),this.save())}set_secure(c){c!==this.qt&&(this.qt=c,this.remove(),this.save())}set_event_timer(c,u){var h=this.props[tv]||{};h[c]=u,this.props[tv]=h,this.save()}remove_event_timer(c){var u=(this.props[tv]||{})[c];return O(u)||(delete this.props[tv][c],this.save()),u}get_property(c){return this.props[c]}set_property(c,u){this.props[c]=u,this.save()}};var iY=((rD={}).Activation="events",rD.Cancellation="cancelEvents",rD),iK=((rj={}).Button="button",rj.Tab="tab",rj.Selector="selector",(rU={}).TopLeft="top_left",rU.TopRight="top_right",rU.TopCenter="top_center",rU.MiddleLeft="middle_left",rU.MiddleRight="middle_right",rU.MiddleCenter="middle_center",rU.Left="left",rU.Center="center",rU.Right="right",rU.NextToTrigger="next_to_trigger",(rq={}).Top="top",rq.Left="left",rq.Right="right",rq.Bottom="bottom",(rH={}).Popover="popover",rH.API="api",rH.Widget="widget",rH.ExternalSurvey="external_survey",rH),iX=((rz={}).Open="open",rz.MultipleChoice="multiple_choice",rz.SingleChoice="single_choice",rz.Rating="rating",rz.Link="link",(rV={}).NextQuestion="next_question",rV.End="end",rV.ResponseBased="response_based",rV.SpecificQuestion="specific_question",(rB={}).Once="once",rB.Recurring="recurring",rB.Always="always",(rW={}).SHOWN="survey shown",rW.DISMISSED="survey dismissed",rW.SENT="survey sent",rW.ABANDONED="survey abandoned",rW),iZ=((rG={}).SURVEY_ID="$survey_id",rG.SURVEY_NAME="$survey_name",rG.SURVEY_RESPONSE="$survey_response",rG.SURVEY_ITERATION="$survey_iteration",rG.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",rG.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",rG.SURVEY_SUBMISSION_ID="$survey_submission_id",rG.SURVEY_QUESTIONS="$survey_questions",rG.SURVEY_COMPLETED="$survey_completed",rG.PRODUCT_TOUR_ID="$product_tour_id",rG.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",rG),iJ=((rY={}
vendor: 5,149 bytes, line 1
1).Popover="popover",rY.Inline="inline",rY),iQ=tu("[Surveys]"),i0="seenSurvey_",tn=(c,u)=>{var h="$survey_"+u+"/"+c.id;return c.current_iteration&&c.current_iteration>0&&(h="$survey_"+u+"/"+c.id+"/"+c.current_iteration),h},en=c=>{var u;return u=""+i0+c.id,c.current_iteration&&c.current_iteration>0&&(u=""+i0+c.id+"_"+c.current_iteration),u},i1=[iK.Popover,iK.Widget,iK.API],i2={ignoreConditions:!1,ignoreDelay:!1,displayType:iJ.Popover};let nn=class nn{constructor(){this.Gt={},this.Gt={}}on(c,u){return this.Gt[c]||(this.Gt[c]=[]),this.Gt[c].push(u),()=>{this.Gt[c]=this.Gt[c].filter(c=>c!==u)}}emit(c,u){for(var h of this.Gt[c]||[])h(u);for(var d of this.Gt["*"]||[])d(c,u)}};function on(c,u,h){if(j(c))return!1;switch(h){case"exact":return c===u;case"contains":return RegExp(u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(c);case"regex":try{return new RegExp(u).test(c)}catch(c){return!1}default:return!1}}let an=class an{constructor(c){this.Vt=new nn,this.Jt=(c,u)=>this.Kt(c,u)&&this.Yt(c,u)&&this.Xt(c,u)&&this.Qt(c,u),this.Kt=(c,u)=>null==u||!u.event||(null==c?void 0:c.event)===(null==u?void 0:u.event),this._instance=c,this.Zt=new Set,this.ti=new Set}init(){var c,u;O(null==(c=this._instance)?void 0:c._addCaptureHook)||null==(u=this._instance)||u._addCaptureHook((c,u)=>{this.on(c,u)})}register(c){var u,h;if(!O(null==(u=this._instance)?void 0:u._addCaptureHook)&&(c.forEach(c=>{var u,h;null==(u=this.ti)||u.add(c),null==(h=c.steps)||h.forEach(c=>{var u;null==(u=this.Zt)||u.add((null==c?void 0:c.event)||"")})}),null!=(h=this._instance)&&h.autocapture)){var d,v=new Set;c.forEach(c=>{var u;null==(u=c.steps)||u.forEach(c=>{null!=c&&c.selector&&v.add(null==c?void 0:c.selector)})}),null==(d=this._instance)||d.autocapture.setElementSelectors(v)}}on(c,u){var h;null!=u&&0!=c.length&&(this.Zt.has(c)||this.Zt.has(null==u?void 0:u.event))&&this.ti&&(null==(h=this.ti)?void 0:h.size)>0&&this.ti.forEach(c=>{this.ii(u,c)&&this.Vt.emit("actionCaptured",c.name)})}ei(c){this.onAction("actionCaptured",u=>c(u))}ii(c,u){if(null==(null==u?void 0:u.steps))return!1;for(var h of u.steps)if(this.Jt(c,h))return!0;return!1}onAction(c,u){return this.Vt.on(c,u)}Yt(c,u){if(null!=u&&u.url){var h,d=null==c||null==(h=c.properties)?void 0:h.$current_url;if(!d||"string"!=typeof d||!on(d,u.url,u.url_matching||"contains"))return!1}return!0}Xt(c,u){return!!this.ri(c,u)&&!!this.si(c,u)&&!!this.ni(c,u)}ri(c,u){if(null==u||!u.href)return!0;var h=this.oi(c);if(h.length>0)return h.some(c=>on(c.href,u.href,u.href_matching||"exact"));var d,v,m=(null==c||null==(d=c.properties)?void 0:d.$elements_chain)||"";return!!m&&on((v=m.match(/(?::|")href="(.*?)"/))?v[1]:"",u.href,u.href_matching||"exact")}si(c,u){if(null==u||!u.text)return!0;var h=this.oi(c);if(h.length>0)return h.some(c=>on(c.text,u.text,u.text_matching||"exact")||on(c.$el_text,u.text,u.text_matching||"exact"));var d,v,m,b,S=(null==c||null==(d=c.properties)?void 0:d.$elements_chain)||"";return!!S&&(v=function(c){for(var u,h=[],d=/(?::|")text="(.*?)"/g;!j(u=d.exec(c));)h.includes(u[1])||h.push(u[1]);return h}(S),m=u.text,b=u.text_matching||"exact",v.some(c=>on(c,m,b)))}ni(c,u){if(null==u||!u.selector)return!0;var h,d,v=null==c||null==(h=c.properties)?void 0:h.$element_selectors;if(null!=v&&v.includes(u.selector))return!0;var m=(null==c||null==(d=c.properties)?void 0:d.$elements_chain)||"";if(u.selector_regex&&m)try{return new RegExp(u.selector_regex).test(m)}catch(c){}return!1}oi(c){var u;return null==(null==c||null==(u=c.properties)?void 0:u.$elements)?[]:null==c?void 0:c.properties.$elements}Qt(c,u){return null==u||!u.properties||0===u.properties.length||rs(u.properties.reduce((c,u)=>{var h=ec(u.value)?u.value.map(String):null!=u.value?[String(u.value)]:[];return c[u.key]={values:h,operator:u.operator||"exact"},c},{}),null==c?void 0:c.properties)}};let ln=class ln{constructor(c){this._instance=c,this.ai=new Map,this.li=new Map,this.ui=new Map}hi(c,u){return!!c&&rs(c.propertyFilters,null==u?void 0:u.properties)}di(c,u){var h=new Map;return c.forEach(c=>{var d;null==(d=c.conditions)||null==(d=d[u])||null==(d=d.values)||d.forEach(u=>{if(null!=u&&u.name){var d=h.get(u.name)||[];d.push(c.id),h.set(u.name,d)}})}),h}vi(c,u,h){var d=(h===iY.Activation?this.ai:this.li).get(c),v=[];return this.ci(c=>{v=c.filter(c=>null==d?void 0:d.includes(c.id))}),v.filter(d=>{var v,m=null==(v=d.conditions)||null==(v=v[h])||null==(v=v.values)?void 0:v.find(u=>u.name===c);return this.hi(m,u)})}register(c){var u;O(null==(u=this._instance)?void 0:u._addCaptureHook)||(this.fi(c),this.pi(c))}pi(c){var u=c.filter(c=>{var u,h;return(null==(u=c.conditions)?void 0:u.actions)&&(null==(h=c.conditions)||null==(h=h.actions)||null==(h=h.values)?void 0:h.length)>0});0!==u.length&&(null==this.gi&&(this.gi=new an(this._instance),this.gi.init(),this.gi.ei(c=>{this.onAction(c)})),u.forEach(c=>{var u,h,d,v,m;c.conditions&&null!=(u=c.conditions)&&u.actions&&null!=(h=c.conditions)&&null!=(h=h.actions)&&h.values&&(null==(d=c.conditions)||null==(d=d.actions)||null==(d=d.values)?void 0:d.length)>0&&(null==(v=this.gi)||v.register(c.conditions.actions.values),null==(m
1=c.conditions)||null==(m=m.actions)||null==(m=m.values)||m.forEach(u=>{if(u&&u.name){var h=this.ui.get(u.name);h&&h.push(c.id),this.ui.set(u.name,h||[c.id])}}))}))}fi(c){var u,h=c.filter(c=>{var u,h;return(null==(u=c.conditions)?void 0:u.events)&&(null==(h=c.conditions)||null==(h=h.events)||null==(h=h.values)?void 0:h.length)>0}),d=c.filter(c=>{var u,h;return(null==(u=c.conditions)?void 0:u.cancelEvents)&&(null==(h=c.conditions)||null==(h=h.cancelEvents)||null==(h=h.values)?void 0:h.length)>0});(0!==h.length||0!==d.length)&&(null==(u=this._instance)||u._addCaptureHook((c,u)=>{this.onEvent(c,u)}),this.ai=this.di(c,iY.Activation),this.li=this.di(c,iY.Cancellation))}onEvent(c,u){var h,d=this.mi(),v=this.bi(),m=this.yi(),b=(null==(h=this._instance)||null==(h=h.persistence)?void 0:h.props[v])||[];if(m===c&&u&&b.length>0){d.info("event matched, removing item from activated items",{event:c,eventPayload:u,existingActivatedItems:b});var S,k,T=(null==u||null==(S=u.properties)?void 0:S.$survey_id)||(null==u||null==(k=u.properties)?void 0:k.$product_tour_id);if(T){var P=b.indexOf(T);P>=0&&(b.splice(P,1),this.wi(b))}}else{if(this.li.has(c)){var C=this.vi(c,u,iY.Cancellation);C.length>0&&(d.info("cancel event matched, cancelling items",{event:c,itemsToCancel:C.map(c=>c.id)}),C.forEach(c=>{var u=b.indexOf(c.id);u>=0&&b.splice(u,1),this.xi(c.id)}),this.wi(b))}if(this.ai.has(c)){d.info("event name matched",{event:c,eventPayload:u,items:this.ai.get(c)});var $=this.vi(c,u,iY.Activation);this.wi(b.concat($.map(c=>c.id)||[]))}}}onAction(c){var u,h=this.bi(),d=(null==(u=this._instance)||null==(u=u.persistence)?void 0:u.props[h])||[];this.ui.has(c)&&this.wi(d.concat(this.ui.get(c)||[]))}wi(c){var u,h=this.mi(),d=this.bi(),v=[...new Set(c)].filter(c=>!this.$i(c));h.info("updating activated items",{activatedItems:v}),null==(u=this._instance)||null==(u=u.persistence)||u.register({[d]:v})}getActivatedIds(){var c,u=this.bi();return(null==(c=this._instance)||null==(c=c.persistence)?void 0:c.props[u])||[]}getEventToItemsMap(){return this.ai}Ei(){return this.gi}};let un=class un extends ln{constructor(c){super(c)}bi(){return"$surveys_activated"}yi(){return iX.SHOWN}ci(c){var u;null==(u=this._instance)||u.getSurveys(c)}xi(c){var u;null==(u=this._instance)||u.cancelPendingSurvey(c)}mi(){return iQ}$i(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};let hn=class hn{constructor(c){this.Si=void 0,this._surveyManager=null,this.ki=!1,this.Pi=[],this.Ti=null,this._instance=c,this._surveyEventReceiver=null}onRemoteConfig(c){if(!this._instance.config.disable_surveys){var u=c.surveys;if(j(u))return iQ.warn("Flags not loaded yet. Not loading surveys.");var h=ec(u);this.Si=h?u.length>0:u,iQ.info("flags response received, isSurveysEnabled: "+this.Si),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var c=[],u=0;u<localStorage.length;u++){var h=localStorage.key(u);(null!=h&&h.startsWith(i0)||null!=h&&h.startsWith("inProgressSurvey_"))&&c.push(h)}c.forEach(c=>localStorage.removeItem(c))}loadIfEnabled(){if(!this._surveyManager){if(this.ki)iQ.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)iQ.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())iQ.info("Not loading surveys in cookieless mode without consent.");else{var c=null==Z?void 0:Z.__PosthogExtensions__;if(c){if(!O(this.Si)||this._instance.config.advanced_enable_surveys){var u=this.Si||this._instance.config.advanced_enable_surveys;this.ki=!0;try{var h=c.generateSurveys;if(h)return void this.Ci(h,u);var d=c.loadExternalDependency;if(!d)return void this.Ii("PostHog loadExternalDependency extension not found.");d(this._instance,"surveys",h=>{h||!c.generateSurveys?this.Ii("Could not load surveys script",h):this.Ci(c.generateSurveys,u)})}catch(c){throw this.Ii("Error initializing surveys",c),c}finally{this.ki=!1}}}else iQ.error("PostHog Extensions not found.")}}}Ci(c,u){this._surveyManager=c(this._instance,u),this._surveyEventReceiver=new un(this._instance),iQ.info("Surveys loaded successfully"),this.Ri({isLoaded:!0})}Ii(c,u){iQ.error(c,u),this.Ri({isLoaded:!1,error:c})}onSurveysLoaded(c){return this.Pi.push(c),this._surveyManager&&this.Ri({isLoaded:!0}),()=>{this.Pi=this.Pi.filter(u=>u!==c)}}getSurveys(c,u){if(void 0===u&&(u=!1),this._instance.config.disable_surveys)return iQ.info("Disabled. Not loading surveys."),c([]);var h,d=this._instance.get_property(tA);if(d&&!u)return c(d,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ti?this.Ti.then(u=>{var{surveys:h,context:d}=u;return c(h,d)}):("undefined"!=typeof Promise&&(this.Ti=new Promise(c=>{h=c})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:u=>{this.Ti=null;var d=u.statusCode;if(200!==d||!u.json){var v="Surveys API could not be loaded, status: "+d;iQ.error(v);var m={isLoaded:!1,error:v};return c([],m),void(null==h||h({surveys:[],context:m}))}var b,S,k=u.json.surveys||[],T=k.filter(c=>{var u,h;return!(!c.start_date||c.end_date)&&(!(null==(u=c.conditions)||null==(u=u.events)||null==(u=u.values)||!u.length)||!(null==(h=c.conditions)||null==(h=h.actions)||null==(h=h.values)||!h.length))});T.length>0&&(null==(S=this._surveyEventReceiver)||S.register(T)),null==(b=this._instance.persistence)||b.register({[tA]:k});var P={isLoaded:!0};c(k,P),null==h||h({surveys:k,context:P})}}))}
1Ri(c){for(var u of this.Pi)try{if(!c.isLoaded)return u([],c);this.getSurveys(u)}catch(c){iQ.error("Error in survey callback",c)}}getActiveMatchingSurveys(c,u){if(void 0===u&&(u=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(c,u);iQ.warn("init was not called")}Fi(c){var u=null;return this.getSurveys(h=>{var d;u=null!==(d=h.find(u=>u.id===c))&&void 0!==d?d:null}),u}Oi(c){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var u="string"==typeof c?this.Fi(c):c;return u?this._surveyManager.checkSurveyEligibility(u):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(c){if(j(this._surveyManager))return iQ.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var u=this.Oi(c);return{visible:u.eligible,disabledReason:u.reason}}canRenderSurveyAsync(c,u){return j(this._surveyManager)?(iQ.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(h=>{this.getSurveys(u=>{var d,v=null!==(d=u.find(u=>u.id===c))&&void 0!==d?d:null;if(v){var m=this.Oi(v);h({visible:m.eligible,disabledReason:m.reason})}else h({visible:!1,disabledReason:"Survey not found"})},u)})}renderSurvey(c,u,h){var d;if(j(this._surveyManager))iQ.warn("init was not called");else{var v="string"==typeof c?this.Fi(c):c;if(null!=v&&v.id){if(i1.includes(v.type)){var m=null==T?void 0:T.querySelector(u);if(m)return null!=(d=v.appearance)&&d.surveyPopupDelaySeconds?(iQ.info("Rendering survey "+v.id+" with delay of "+v.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var c,u;iQ.info("Rendering survey "+v.id+" with delay of "+(null==(c=v.appearance)?void 0:c.surveyPopupDelaySeconds)+" seconds"),null==(u=this._surveyManager)||u.renderSurvey(v,m,h),iQ.info("Survey "+v.id+" rendered")},1e3*v.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(v,m,h);iQ.warn("Survey element not found")}else iQ.warn("Surveys of type "+v.type+" cannot be rendered in the app")}else iQ.warn("Survey not found")}}displaySurvey(c,u){var h;if(j(this._surveyManager))iQ.warn("init was not called");else{var d=this.Fi(c);if(d){var v=d;if(null!=(h=d.appearance)&&h.surveyPopupDelaySeconds&&u.ignoreDelay&&(v=_({},d,{appearance:_({},d.appearance,{surveyPopupDelaySeconds:0})})),u.displayType!==iJ.Popover&&u.initialResponses&&iQ.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===u.ignoreConditions){var m=this.canRenderSurvey(d);if(!m.visible)return void iQ.warn("Survey is not eligible to be displayed: ",m.disabledReason)}u.displayType!==iJ.Inline?this._surveyManager.handlePopoverSurvey(v,u):this.renderSurvey(v,u.selector,u.properties)}else iQ.warn("Survey not found")}}cancelPendingSurvey(c){j(this._surveyManager)?iQ.warn("init was not called"):this._surveyManager.cancelSurvey(c)}handlePageUnload(){var c;null==(c=this._surveyManager)||c.handlePageUnload()}};var i3=tu("[Conversations]");let vn=class vn{constructor(c){this.Mi=void 0,this._conversationsManager=null,this.Ai=!1,this.Di=null,this._instance=c}onRemoteConfig(c){if(!this._instance.config.disable_conversations){var u=c.conversations;j(u)||(U(u)?this.Mi=u:(this.Mi=u.enabled,this.Di=u),this.loadIfEnabled())}}reset(){var c;null==(c=this._conversationsManager)||c.reset(),this._conversationsManager=null,this.Mi=void 0,this.Di=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ai||this._instance.config.disable_conversations||Hi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var c=null==Z?void 0:Z.__PosthogExtensions__;if(c&&!O(this.Mi)&&this.Mi){if(this.Di&&this.Di.token){this.Ai=!0;try{var u=c.initConversations;if(u)return this.ji(u),void(this.Ai=!1);var h=c.loadExternalDependency;if(!h)return void this.Li("PostHog loadExternalDependency extension not found.");h(this._instance,"conversations",u=>{u||!c.initConversations?this.Li("Could not load conversations script",u):this.ji(c.initConversations),this.Ai=!1})}catch(c){this.Li("Error initializing conversations",c),this.Ai=!1}}else i3.error("Conversations enabled but missing token in remote config.")}}}ji(c){if(this.Di)try{this._conversationsManager=c(this.Di,this._instance),i3.info("Conversations loaded successfully")}catch(c){this.Li("Error completing conversations initialization",c)}else i3.error("Cannot complete initialization: remote config is null")}Li(c,u){i3.error(c,u),this._conversationsManager=null,this.Ai=!1}show(){this._conversationsManager?this._conversationsManager.show():i3.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Mi&&!D(this._conversationsManager)}isVisible(){var c,u;return null!==(c=null==(u=this._conversationsManager)?void 0:u.isVisible())&&void 0!==c&&c}sendMessage(c,u,h){var d=this;return p(function*(){return d._conversationsManager?d._conversationsManager.sendMessage(c,u,h):(i3.warn("Conversations not available yet."),null)})()}getMessages(c,u){var h=this;return p(function*(){return h._conversationsManager?h._conversationsManager.getMessages(c,u):(i3.warn("Conversations not available yet."),null)})()}markAsRead(c){var u=this;return p(function*(){return u._conversationsManager?u._conversationsManager.markAsRead(c):(i3.warn("Conversations not available yet."),null)})()}getTickets(c){var u=this;return p(function*(){return u._conversationsManager?u._conversationsManager.getTickets(c):(i3.warn("Conversations not available yet."),null)})()}requestRestoreLink(c){var u=this;return p(function*(){return u._conversationsManager?u._conversationsManager.requestRestoreLink(c):(i3.warn("Conversations not available yet."),null)})()}restoreFromToken(c){var u=this;return p(function*(){return u._conversationsManager?u._conversationsManager.restoreFromToken(c):(i3.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var c=this;return p(function*(){return c._conversationsManager?c._conversationsManager.restoreFromUrlToken():(i3.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var c,u;return null!==(c=null==(u=this._conversationsManager)?void 0:u.getCurrentTicketId())&&void 0!==c?c:null}getWidgetSessionId(){var c,u;return null!==(c=null==(u=this._conversationsManager)?void 0:u.getWidgetSessionId())&&void 0!==c?c:null}};var i5=((rK={}).SHOWN="product tour shown",rK.DISMISSED="product tour dismissed",rK.COMPLETED="product tour completed",rK.STEP_SHOWN="product tour step shown",rK.STEP_COMPLETED="product tour step completed",rK.BUTTON_CLICKED="product tour button clicked",rK.STEP_SELECTOR_FAILED="product tour step selector failed",rK.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",rK.BANNER_ACTION_CLICKED="product tour banner action clicked",rK),i4=((rX={}).TOUR_ID="$product_tour_id",rX.TOUR_NAME="$product_tour_name",rX.TOUR_ITERATION="$product_tour_iteration",rX.TOUR_RENDER_REASON="$product_tour_render_reason",rX.TOUR_STEP_ID="$product_tour_step_id",rX.TOUR_STEP_ORDER="$product_tour_step_order",rX.TOUR_STEP_TYPE="$product_tour_step_type",rX.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",rX.TOUR_BUTTON_TEXT="$product_tour_button_text",rX.TOUR_BUTTON_ACTION="$product_tour_button_action",rX.TOUR_BUTTON_LINK="$product_tour_button_link",rX.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",rX.TOUR_STEPS_COUNT="$product_tour_steps_count",rX.TOUR_STEP_SELECTOR="$product_tour_step_selector",rX.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",rX.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",rX.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",rX.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",rX.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",rX.TOUR_ERROR="$product_tour_error",rX.TOUR_MATCHES_COUNT="$product_tour_matches_count",rX.TOUR_FAILURE_PHASE="$product_tour_failure_phase",rX.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",rX.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",rX.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",rX.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",rX.USE_MANUAL_SELECTOR="$use_manual_selector",rX.INFERENCE_DATA_PRESENT="$inference_data_present",rX.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",rX.TOUR_TYPE="$product_tour_type",rX);let _n=class _n{constructor(c){var u;this.Ni=!1,this.Ui=!1,this._instance=c,this._instance&&null!=(u=this._instance.config.logs)&&u.captureConsoleLogs&&(this.Ni=!0)}onRemoteConfig(c){var u,h=null==(u=c.logs)?void 0:u.captureConsoleLogs;
1!j(h)&&h&&(this.Ni=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ni&&!this.Ui){var c=tu("[logs]"),u=null==Z?void 0:Z.__PosthogExtensions__;if(u){var h=u.loadExternalDependency;h?h(this._instance,"logs",h=>{var d;h||null==(d=u.logs)||!d.initializeLogs?c.error("Could not load logs script",h):(u.logs.initializeLogs(this._instance),this.Ui=!0)}):c.error("PostHog loadExternalDependency extension not found.")}else c.error("PostHog Extensions not found.")}}};var i6=tu("[RateLimiter]");let mn=class mn{constructor(c){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=c=>{var u=c.text;if(u&&u.length)try{(JSON.parse(u).quota_limited||[]).forEach(c=>{i6.info((c||"events")+" is quota limited."),this.serverLimits[c]=(new Date).getTime()+6e4})}catch(c){return void i6.warn('could not rate limit - continuing. Error: "'+(null==c?void 0:c.message)+'"',{text:u})}},this.instance=c,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var c;return(null==(c=this.instance.config.rate_limiting)?void 0:c.events_per_second)||10}get captureEventsBurstLimit(){var c;return Math.max((null==(c=this.instance.config.rate_limiting)?void 0:c.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(c){void 0===c&&(c=!1);var u,h,d,{captureEventsBurstLimit:v,captureEventsPerSecond:m}=this,b=(new Date).getTime(),S=null!==(u=null==(h=this.instance.persistence)?void 0:h.get_property(tU))&&void 0!==u?u:{tokens:v,last:b};S.tokens+=(b-S.last)/1e3*m,S.last=b,S.tokens>v&&(S.tokens=v);var k=S.tokens<1;return k||c||(S.tokens=Math.max(0,S.tokens-1)),!k||this.lastEventRateLimited||c||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+m+" events per second and "+v+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=k,null==(d=this.instance.persistence)||d.set_property(tU,S),{isRateLimited:k,remainingTokens:S.tokens}}isServerRateLimited(c){var u=this.serverLimits[c||"events"]||!1;return!1!==u&&(new Date).getTime()<u}};var i8=tu("[RemoteConfig]");let yn=class yn{constructor(c){this._instance=c}get remoteConfig(){var c;return null==(c=Z._POSTHOG_REMOTE_CONFIG)||null==(c=c[this._instance.config.token])?void 0:c.config}zi(c){var u,h;null!=(u=Z.__PosthogExtensions__)&&u.loadExternalDependency?null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,"remote-config",()=>c(this.remoteConfig)):c()}Hi(c){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:u=>{c(u.json)}})}load(){try{if(this.remoteConfig)return i8.info("Using preloaded remote config",this.remoteConfig),this.Bi(this.remoteConfig),void this.qi();if(this._instance.At())return void i8.warn("Remote config is disabled. Falling back to local config.");this.zi(c=>{if(!c)return i8.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hi(c=>{this.Bi(c),this.qi()});this.Bi(c),this.qi()})}catch(c){i8.error("Error loading remote config",c)}}stop(){this.Wi&&(clearInterval(this.Wi),this.Wi=void 0)}refresh(){this._instance.At()||"hidden"===(null==T?void 0:T.visibilityState)||this._instance.featureFlags.reloadFeatureFlags()}qi(){var c;if(!this.Wi){var u=null!==(c=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==c?c:3e5;0!==u&&(this.Wi=setInterval(()=>{this.refresh()},u))}}Bi(c){c||i8.error("Failed to fetch remote config from PostHog."),this._instance.Bi(null!=c?c:{}),!1!==(null==c?void 0:c.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}};let xn=class xn{constructor(c,u){this.Gi=!0,this.Vi=[],this.Ji=K((null==u?void 0:u.flush_interval_ms)||3e3,250,5e3,tc.createLogger("flush interval"),3e3),this.Ki=c}enqueue(c){this.Vi.push(c),this.Yi||this.Xi()}unload(){this.Qi();var c=Object.values(this.Vi.length>0?this.Zi():{});[...c.filter(c=>0===c.url.indexOf("/e")),...c.filter(c=>0!==c.url.indexOf("/e"))].map(c=>{this.Ki(_({},c,{transport:"sendBeacon"}))})}enable(){this.Gi=!1,this.Xi()}Xi(){var c=this;this.Gi||(this.Yi=setTimeout(()=>{if(this.Qi(),this.Vi.length>0){var u=this.Zi();for(var h in u)!function(){var d=u[h],v=(new Date).getTime();d.data&&ec(d.data)&&Ii(d.data,c=>{c.offset=Math.abs(c.timestamp-v),delete c.timestamp}),c.Ki(d)}()}},this.Ji))}Qi(){clearTimeout(this.Yi),this.Yi=void 0}Zi(){var c={};return Ii(this.Vi,u=>{var h,d=(u?u.batchKey:null)||u.url;O(c[d])&&(c[d]=_({},u,{data:[]})),null==(h=c[d].data)||h.push(u.data)}),this.Vi=[],c}};var i7=["retriesPerformedSoFar"];let En=class En{constructor(c){this.te=!1,this.ie=3e3,this.Vi=[],this._instance=c,this.Vi=[],this.ee=!0,!O(d)&&"onLine"in d.navigator&&(this.ee=d.navigator.onLine,this.re=()=>{this.ee=!0,this.se()},this.ne=()=>{this.ee=!1},zi(d,"online",this.re),zi(d,"offline",this.ne))}get length(){return this.Vi.length}retriableRequest(c){var{retriesPerformedSoFar:u}=c,h=g(c,i7);N(u)&&(h.url=Kr(h.url,{retry_count:u})),this._instance._send_request(_({},h,{callback:c=>{200!==c.statusCode&&(c.statusCode<400||c.statusCode>=500)&&(null!=u?u:0)<10?this.oe(_({retriesPerformedSoFar:u},h)):null==h.callback||h.callback(c)}}))}oe(c){var u,h,d,v=c.retriesPerformedSoFar||0;c.retriesPerformedSoFar=v+1;var m=(d=(Math.random()-.5)*((h=Math.min(18e5,u=3e3*Math.pow(2,v)))-u/2),Math.ceil(h+d)),b=Date.now()+m;this.Vi.push({retryAt:b,requestOptions:c});var S="Enqueued failed request for retry in "+m;navigator.onLine||(S+=" (Browser is offline)"),tc.warn(S),this.te||(this.te=!0,this.ae())}ae(){if(this.le&&clearTimeout(this.le),0===this.Vi.length)return this.te=!1,void(this.le=void 0);this.le=setTimeout(()=>{this.ee&&this.Vi.length>0&&this.se(),this.ae()},this.ie)}se(){var c=Date.now(),u=[],h=this.Vi.filter(h=>
1h.retryAt<c||(u.push(h),!1));if(this.Vi=u,h.length>0)for(var{requestOptions:d}of h)this.retriableRequest(d)}unload(){for(var{requestOptions:c}of(this.le&&(clearTimeout(this.le),this.le=void 0),this.te=!1,O(d)||(this.re&&(d.removeEventListener("online",this.re),this.re=void 0),this.ne&&(d.removeEventListener("offline",this.ne),this.ne=void 0)),this.Vi))try{this._instance._send_request(_({},c,{transport:"sendBeacon"}))}catch(c){tc.error(c)}this.Vi=[]}};let Sn=class Sn{constructor(c){this.ue=()=>{this.he||(this.he={});var c,u,h,d,v=this.scrollElement(),m=this.scrollY(),b=v?Math.max(0,v.scrollHeight-v.clientHeight):0,S=m+((null==v?void 0:v.clientHeight)||0),k=(null==v?void 0:v.scrollHeight)||0;this.he.lastScrollY=Math.ceil(m),this.he.maxScrollY=Math.max(m,null!==(c=this.he.maxScrollY)&&void 0!==c?c:0),this.he.maxScrollHeight=Math.max(b,null!==(u=this.he.maxScrollHeight)&&void 0!==u?u:0),this.he.lastContentY=S,this.he.maxContentY=Math.max(S,null!==(h=this.he.maxContentY)&&void 0!==h?h:0),this.he.maxContentHeight=Math.max(k,null!==(d=this.he.maxContentHeight)&&void 0!==d?d:0)},this._instance=c}getContext(){return this.he}resetContext(){var c=this.he;return setTimeout(this.ue,0),c}startMeasuringScrollPosition(){zi(d,"scroll",this.ue,{capture:!0}),zi(d,"scrollend",this.ue,{capture:!0}),zi(d,"resize",this.ue)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==d?void 0:d.document.documentElement;for(var c of ec(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var u=null==d?void 0:d.document.querySelector(c);if(u)return u}}scrollY(){if(this._instance.config.scroll_root_selector){var c=this.scrollElement();return c&&c.scrollTop||0}return d&&(d.scrollY||d.pageYOffset||d.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var c=this.scrollElement();return c&&c.scrollLeft||0}return d&&(d.scrollX||d.pageXOffset||d.document.documentElement.scrollLeft)||0}};var kn=c=>_s(null==c?void 0:c.config.mask_personal_data_properties,null==c?void 0:c.config.custom_personal_data_properties);let Pn=class Pn{constructor(c,u,h,d){this.de=c=>{var u=this.ve();if(!u||u.sessionId!==c){var h={sessionId:c,props:this.ce(this._instance)};this.fe.register({[tj]:h})}},this._instance=c,this.pe=u,this.fe=h,this.ce=d||kn,this.pe.onSessionId(this.de)}ve(){return this.fe.props[tj]}getSetOnceProps(){var c,u=null==(c=this.ve())?void 0:c.props;return u?"r"in u?gs(u):{$referring_domain:u.referringDomain,$pathname:u.initialPathName,utm_source:u.utm_source,utm_campaign:u.utm_campaign,utm_medium:u.utm_medium,utm_content:u.utm_content,utm_term:u.utm_term}:{}}getSessionProps(){var c={};return Ii(Di(this.getSetOnceProps()),(u,h)=>{"$current_url"===h&&(h="url"),c["$session_entry_"+E(h)]=u}),c}};var i9=tu("[SessionId]");let Cn=class Cn{on(c,u){return this._e.on(c,u)}constructor(c,u,h){if(this.ge=[],this.me=void 0,this._e=new nn,this.be=(c,u)=>!(!N(c)||!N(u))&&Math.abs(c-u)>this.sessionTimeoutMs,!c.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===c.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=c.config,this.fe=c.persistence,this.ye=void 0,this.we=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.xe=u||Ce,this.$e=h||Ce;var d,v=this.N.persistence_name||this.N.token,m=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*K(m,60,36e3,i9.createLogger("session_idle_timeout_seconds"),1800),c.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ee(),this.Se="ph_"+v+"_window_id",this.ke="ph_"+v+"_primary_window_exists",this.Pe()){var b=t4.D(this.Se),S=t4.D(this.ke);b&&!S?this.ye=b:t4.L(this.Se),t4.j(this.ke,!0)}if(null!=(d=this.N.bootstrap)&&d.sessionID)try{var k=(c=>{var u=c.replace(/-/g,"");if(32!==u.length)throw Error("Not a valid UUID");if("7"!==u[12])throw Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Te(this.N.bootstrap.sessionID,(new Date).getTime(),k)}catch(c){i9.error("Invalid sessionID in bootstrap",c)}this.Ce()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(c){return O(this.ge)&&(this.ge=[]),this.ge.push(c),this.we&&c(this.we,this.ye),()=>{this.ge=this.ge.filter(u=>u!==c)}}Pe(){return"memory"!==this.N.persistence&&!this.fe.zt&&t4.O()}Ie(c){c!==this.ye&&(this.ye=c,this.Pe()&&t4.j(this.Se,c))}Re(){return this.ye?this.ye:this.Pe()?t4.D(this.Se):null}Te(c,u,h){c===this.we&&u===this._sessionActivityTimestamp&&h===this._sessionStartTimestamp||(this._sessionStartTimestamp=h,this._sessionActivityTimestamp=u,this.we=c,this.fe.register({[tR]:[u,c,h]}))}Fe(){var c=this.fe.props[tR];return ec(c)&&2===c.length&&c.push(c[0]),c||[0,null,0]}resetSessionId(){this.Te(null,null,null)}
vendor: 5,494 bytes, line 1
1destroy(){clearTimeout(this.Oe),this.Oe=void 0,this.me&&d&&(d.removeEventListener("beforeunload",this.me,{capture:!1}),this.me=void 0),this.ge=[]}Ce(){this.me=()=>{this.Pe()&&t4.L(this.ke)},zi(d,"beforeunload",this.me,{capture:!1})}checkAndGetSessionAndWindowId(c,u){if(void 0===c&&(c=!1),void 0===u&&(u=null),"always"===this.N.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var h=u||(new Date).getTime(),[d,v,m]=this.Fe(),b=this.Re(),S=N(m)&&Math.abs(h-m)>864e5,k=!1,T=!v,P=!T&&!c&&this.be(h,d);T||P||S?(v=this.xe(),b=this.$e(),i9.info("new session ID generated",{sessionId:v,windowId:b,changeReason:{noSessionId:T,activityTimeout:P,sessionPastMaximumLength:S}}),m=h,k=!0):b||(b=this.$e(),k=!0);var C=N(d)&&c&&!S?d:h,$=N(m)?m:(new Date).getTime();return this.Ie(b),this.Te(v,C,$),c||this.Ee(),k&&this.ge.forEach(c=>c(v,b,k?{noSessionId:T,activityTimeout:P,sessionPastMaximumLength:S}:void 0)),{sessionId:v,windowId:b,sessionStartTimestamp:$,changeReason:k?{noSessionId:T,activityTimeout:P,sessionPastMaximumLength:S}:void 0,lastActivityTimestamp:d}}Ee(){clearTimeout(this.Oe),this.Oe=setTimeout(()=>{var[c]=this.Fe();if(this.be((new Date).getTime(),c)){var u=this.we;this.resetSessionId(),this._e.emit("forcedIdleReset",{idleSessionId:u})}},1.1*this.sessionTimeoutMs)}};var In=function(c,u){if(!c)return!1;var h=c.userAgent;if(h&&y(h,u))return!0;try{var d=null==c?void 0:c.userAgentData;if(null!=d&&d.brands&&d.brands.some(c=>y(null==c?void 0:c.brand,u)))return!0}catch(c){}return!!c.webdriver},re=((rZ={}).US="us",rZ.EU="eu",rZ.CUSTOM="custom",rZ),rt="i.posthog.com";let On=class On{constructor(c){this.Me={},this.instance=c}get apiHost(){var c=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===c?"https://us.i.posthog.com":c}get flagsApiHost(){var c=this.instance.config.flags_api_host;return c?c.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var c,u=null==(c=this.instance.config.ui_host)?void 0:c.replace(/\/$/,"");return u||(u=this.apiHost.replace("."+rt,".posthog.com")),"https://app.posthog.com"===u?"https://us.posthog.com":u}get region(){return this.Me[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=re.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=re.EU:this.Me[this.apiHost]=re.CUSTOM),this.Me[this.apiHost]}endpointFor(c,u){if(void 0===u&&(u=""),u&&(u="/"===u[0]?u:"/"+u),"ui"===c)return this.uiHost+u;if("flags"===c)return this.flagsApiHost+u;if(this.region===re.CUSTOM)return this.apiHost+u;var h=rt+u;switch(c){case"assets":return"https://"+this.region+"-assets."+h;case"api":return"https://"+this.region+"."+h}}};var ri={icontains:(c,u)=>!!d&&u.href.toLowerCase().indexOf(c.toLowerCase())>-1,not_icontains:(c,u)=>!!d&&-1===u.href.toLowerCase().indexOf(c.toLowerCase()),regex:(c,u)=>!!d&&Zr(u.href,c),not_regex:(c,u)=>!!d&&!Zr(u.href,c),exact:(c,u)=>u.href===c,is_not:(c,u)=>u.href!==c};let An=class An{constructor(c){var u=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(c){void 0===c&&(c=!1),u.getWebExperiments(c=>{An.Ae("retrieved web experiments from the server"),u.De=new Map,c.forEach(c=>{if(c.feature_flag_key){u.De&&(An.Ae("setting flag key ",c.feature_flag_key," to web experiment ",c),null==(h=u.De)||h.set(c.feature_flag_key,c));var h,d=u._instance.getFeatureFlag(c.feature_flag_key);M(d)&&c.variants[d]&&u.je(c.name,d,c.variants[d].transforms)}else if(c.variants)for(var v in c.variants){var m=c.variants[v];An.Le(m)&&u.je(c.name,v,m.transforms)}})},c)},this._instance=c,this._instance.onFeatureFlags(c=>{this.onFeatureFlags(c)})}onFeatureFlags(c){if(this._is_bot())An.Ae("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.De))return this.De=new Map,this.loadIfEnabled(),void this.previewWebExperiment();An.Ae("applying feature flags",c),c.forEach(c=>{var u;if(this.De&&null!=(u=this.De)&&u.has(c)){var h,d=this._instance.getFeatureFlag(c),v=null==(h=this.De)?void 0:h.get(c);d&&null!=v&&v.variants[d]&&this.je(v.name,d,v.variants[d].transforms)}})}}previewWebExperiment(){var c=An.getWindowLocation();if(null!=c&&c.search){var u=ir(null==c?void 0:c.search,"__experiment_id"),h=ir(null==c?void 0:c.search,"__experiment_variant");u&&h&&(An.Ae("previewing web experiments "+u+" && "+h),this.getWebExperiments(c=>{this.Ne(parseInt(u),h,c)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(c,u,h){if(this._instance.config.disable_web_experiments&&!h)return c([]);var d=this._instance.get_property("$web_experiments");if(d&&!u)return c(d);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:u=>200===u.statusCode&&u.json?c(u.json.experiments||[]):c([])})}Ne(c,u,h){var d=h.filter(u=>u.id===c);d&&d.length>0&&(An.Ae("Previewing web experiment ["+d[0].name+"] with variant ["+u+"]"),this.je(d[0].name,u,d[0].variants[u].transforms))}static Le(c){return!j(c.conditions)&&An.Ue(c)&&An.ze(c)}static Ue(c){if(j(c.conditions)||j(null==(u=c.conditions)?void 0:u.url))return!0;var u,h,d,v,m=An.getWindowLocation();return!!m&&(null==(h=c.conditions)||!h.url||ri[null!==(d=null==(v=c.conditions)?void 0:v.urlMatchType)&&void 0!==d?d:"icontains"](c.conditions.url,m))}
1static getWindowLocation(){return null==d?void 0:d.location}static ze(c){if(j(c.conditions)||j(null==(h=c.conditions)?void 0:h.utm))return!0;var u=ds();if(u.utm_source){var h,d,v,m,b,S,k,T,P,C=null==(d=c.conditions)||null==(d=d.utm)||!d.utm_campaign||(null==(v=c.conditions)||null==(v=v.utm)?void 0:v.utm_campaign)==u.utm_campaign,$=null==(m=c.conditions)||null==(m=m.utm)||!m.utm_source||(null==(b=c.conditions)||null==(b=b.utm)?void 0:b.utm_source)==u.utm_source,G=null==(S=c.conditions)||null==(S=S.utm)||!S.utm_medium||(null==(k=c.conditions)||null==(k=k.utm)?void 0:k.utm_medium)==u.utm_medium,X=null==(T=c.conditions)||null==(T=T.utm)||!T.utm_term||(null==(P=c.conditions)||null==(P=P.utm)?void 0:P.utm_term)==u.utm_term;return C&&G&&X&&$}return!1}static Ae(c){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];tc.info("[WebExperiments] "+c,h)}je(c,u,h){this._is_bot()?An.Ae("Refusing to render web experiment since the viewer is a likely bot"):"control"!==u?h.forEach(h=>{if(h.selector){An.Ae("applying transform of variant "+u+" for experiment "+c+" ",h);var d,v=null==(d=document)?void 0:d.querySelectorAll(h.selector);null==v||v.forEach(c=>{h.html&&(c.innerHTML=h.html),h.css&&c.setAttribute("style",h.css)})}}):An.Ae("Control variants leave the page unmodified.")}_is_bot(){return k&&this._instance?In(k,this._instance.config.custom_blocked_useragents):void 0}};var rn=tu("[PostHog ExternalIntegrations]"),ra={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};let Ln=class Ln{constructor(c){this._instance=c}V(c,u){var h;null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,c,c=>{if(c)return rn.error("failed to load script",c);u()})}startIfEnabledOrStop(){var c,u=this,i=function(c){var h,v,m;!d||null!=(h=Z.__PosthogExtensions__)&&null!=(h=h.integrations)&&h[c]||u.V(ra[c],()=>{var h;null==(h=Z.__PosthogExtensions__)||null==(h=h.integrations)||null==(h=h[c])||h.start(u._instance)}),!d&&null!=(v=Z.__PosthogExtensions__)&&null!=(v=v.integrations)&&v[c]&&(null==(m=Z.__PosthogExtensions__)||null==(m=m.integrations)||null==(m=m[c])||m.stop())};for(var[h,d]of Object.entries(null!==(c=this._instance.config.integrations)&&void 0!==c?c:{}))i(h)}};var rl={},rc=0,zn=()=>{},ru="posthog",rh=!iP&&-1===(null==X?void 0:X.indexOf("MSIE"))&&-1===(null==X?void 0:X.indexOf("Mozilla")),qn=c=>{var u;return _({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(c){var u=null==c?void 0:c.hostname;if(!M(u))return!1;var h=u.split(".").slice(-2).join(".");for(var d of tp)if(h===d)return!1;return!0}(null==T?void 0:T.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:zn,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=c?c:"unset",__preview_deferred_init_extensions:!1,debug:P&&M(null==P?void 0:P.search)&&-1!==P.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==d||null==(u=d.location)?void 0:u.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:c=>{var u="Bad HTTP status: "+c.statusCode+" "+c.text;tc.error(u)},get_device_id:c=>c,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:zn,__preview_eager_load_replay:!1},{rageclick:!(c&&c>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(c&&c>="2025-05-24")||"history_change",session_recording:c&&c>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:c&&c>="2026-01-30"?"head":"body",internal_or_test_user_hostname:c&&c>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0})},Wn=c=>{var u={};O(c.process_person)||(u.person_profiles=c.process_person),O(c.xhr_headers)||(u.request_headers=c.xhr_headers),O(c.cookie_name)||(u.persistence_name=c.cookie_name),O(c.disable_cookie)||(u.disable_persistence=c.disable_cookie),O(c.store_google)||(u.save_campaign_params=c.store_google),O(c.verbose)||(u.debug=c.verbose);var h=Ri({},u,c);return ec(c.property_blacklist)&&(O(c.property_denylist)?h.property_denylist=c.property_blacklist:ec(c.property_denylist)?h.property_denylist=[...c.property_blacklist,...c.property_denylist]:tc.error("Invalid value for property_denylist config: "+c.property_denylist)),h};let Gn=class Gn{constructor(){this.__forceAllowLocalhost=!1}get He(){return this.__forceAllowLocalhost}set He(c){tc.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=c}};let Vn=class Vn{get decideEndpointWasHit(){var c,u;return null!==(c=null==(u=this.featureFlags)?void 0:u.hasLoadedFlags)&&void 0!==c&&c}get flagsEndpointWasHit(){var c,u;return null!==(c=null==(u=this.featureFlags)?void 0:u.hasLoadedFlags)&&void 0!==c&&c}constructor(){this.webPerformance=new Gn,this.Be=!1,this.version=J.LIB_VERSION,this.Ft=new nn,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=qn(),this.SentryIntegration=Qe,this.sentryIntegration=c=>{var u;return u=Xe(this,c),{name:t9,processEvent:c=>u(c)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qe=!1,this.We=null,this.Ge=null,this.Ve=null,this.featureFlags=new Ls(this),this.toolbar=ne
vendor: 4,337 bytes, line 1
1w lr(this),this.scrollManager=new Sn(this),this.pageViewManager=new ur(this),this.surveys=new hn(this),this.conversations=new vn(this),this.logs=new _n(this),this.experiments=new An(this),this.exceptions=new ns(this),this.rateLimiter=new mn(this),this.requestRouter=new On(this),this.consent=new Be(this),this.externalIntegrations=new Ln(this),this.people={set:(c,u,h)=>{var d=M(c)?{[c]:u}:c;this.setPersonProperties(d),null==h||h({})},set_once:(c,u,h)=>{var d=M(c)?{[c]:u}:c;this.setPersonProperties(void 0,d),null==h||h({})}},this.on("eventCaptured",c=>tc.info('send "'+(null==c?void 0:c.event)+'"',c))}init(c,u,h){if(h&&h!==ru){var d,v=null!==(d=rl[h])&&void 0!==d?d:new Vn;return v._init(c,u,h),rl[h]=v,rl[ru][h]=v,v}return this._init(c,u,h)}_init(c,u,h){if(void 0===u&&(u={}),O(c)||A(c))return tc.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},u.debug=this.Je(u.debug),this.Ke=u,this.Ye=[],u.person_profiles?this.Ge=u.person_profiles:u.process_person&&(this.Ge=u.process_person),this.set_config(Ri({},qn(u.defaults),Wn(u),{name:h,token:c})),this.config.on_xhr_error&&tc.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=u.disable_compression?void 0:il.GZipJS;var v=this.Xe();this.persistence=new Us(this.config,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Us(_({},this.config,{persistence:"sessionStorage"}),v);var m=_({},this.persistence.props),b=_({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Qe=new xn(c=>this.Ze(c),this.config.request_queue_config),this.tr=new En(this),this.__request_queue=[];var S="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(S||(this.sessionManager=new Cn(this),this.sessionPropsManager=new Pn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tc.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ir(S)},0)):(tc.info("Initializing extensions synchronously"),this.ir(S)),J.DEBUG=J.DEBUG||this.config.debug,J.DEBUG&&tc.info("Starting in debug mode",{this:this,config:u,thisC:_({},this.config),p:m,s:b}),void 0!==(null==(k=u.bootstrap)?void 0:k.distinctID)){var k,T,P,C=this.config.get_device_id(Ce()),$=null!=(T=u.bootstrap)&&T.isIdentifiedID?C:u.bootstrap.distinctID;this.persistence.set_property(tD,null!=(P=u.bootstrap)&&P.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:u.bootstrap.distinctID,$device_id:$})}if(this.er()){var G,X,Z=Object.keys((null==(G=u.bootstrap)?void 0:G.featureFlags)||{}).filter(c=>{var h;return!(null==(h=u.bootstrap)||null==(h=h.featureFlags)||!h[c])}).reduce((c,h)=>{var d;return c[h]=(null==(d=u.bootstrap)||null==(d=d.featureFlags)?void 0:d[h])||!1,c},{}),Q=Object.keys((null==(X=u.bootstrap)?void 0:X.featureFlagPayloads)||{}).filter(c=>Z[c]).reduce((c,h)=>{var d,v;return null!=(d=u.bootstrap)&&null!=(d=d.featureFlagPayloads)&&d[h]&&(c[h]=null==(v=u.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[h]),c},{});this.featureFlags.receivedFeatureFlags({featureFlags:Z,featureFlagPayloads:Q})}if(S)this.register_once({distinct_id:tW,$device_id:null},"");else if(!this.get_distinct_id()){var ee=this.config.get_device_id(Ce());this.register_once({distinct_id:ee,$device_id:ee},""),this.persistence.set_property(tD,"anonymous")}return zi(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),u.segment?function(c,u){var h=c.config.segment;if(!h)return u();!function(c,u){var h=c.config.segment;if(!h)return u();var r=h=>{var r=()=>h.anonymousId()||Ce();c.config.get_device_id=r,h.id()&&(c.register({distinct_id:h.id(),$device_id:r()}),c.persistence.set_property(tD,"identified")),u()},d=h.user();"then"in d&&I(d.then)?d.then(r):r(d)}(c,()=>{var d;h.register((Promise&&Promise.resolve||t7.warn("This browser does not have Promise support, and can not use the segment integration"),d=(u,h)=>
1{if(!h)return u;u.event.userId||u.event.anonymousId===c.get_distinct_id()||(t7.info("No userId set, resetting PostHog"),c.reset()),u.event.userId&&u.event.userId!==c.get_distinct_id()&&(t7.info("UserId set, identifying with PostHog"),c.identify(u.event.userId));var d=c.calculateEventProperties(h,u.event.properties);return u.event.properties=Object.assign({},d,u.event.properties),u},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:c=>d(c,c.event.event),page:c=>d(c,"$pageview"),identify:c=>d(c,"$identify"),screen:c=>d(c,"$screen")})).then(()=>{u()})})}(this,()=>this.rr()):this.rr(),I(this.config._onCapture)&&this.config._onCapture!==zn&&(tc.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",c=>this.config._onCapture(c.event,c))),this.config.ip&&tc.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}ir(c){var u=performance.now(),h=_({},Vn.__defaultExtensionClasses,this.config.__extensionClasses);h.historyAutocapture&&(this.historyAutocapture=new h.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var d=[];h.tracingHeaders&&d.push(()=>{new h.tracingHeaders(this).startIfEnabledOrStop()}),h.siteApps&&d.push(()=>{var c;this.siteApps=new h.siteApps(this),null==(c=this.siteApps)||c.init()}),!c&&h.sessionRecording&&d.push(()=>{this.sessionRecording=new h.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&d.push(()=>{this.autocapture=new h.autocapture(this),this.autocapture.startIfEnabled()}),d.push(()=>{this.surveys.loadIfEnabled()}),d.push(()=>{this.logs.loadIfEnabled()}),d.push(()=>{this.conversations.loadIfEnabled()}),h.productTours&&d.push(()=>{this.productTours=new h.productTours(this),this.productTours.loadIfEnabled()}),h.heatmaps&&d.push(()=>{this.heatmaps=new h.heatmaps(this),this.heatmaps.startIfEnabled()}),h.webVitalsAutocapture&&d.push(()=>{this.webVitalsAutocapture=new h.webVitalsAutocapture(this)}),h.exceptionObserver&&d.push(()=>{this.exceptionObserver=new h.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),h.deadClicksAutocapture&&d.push(()=>{this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Ge),this.deadClicksAutocapture.startIfEnabledOrStop()}),d.push(()=>{if(this.sr){var c=this.sr;this.sr=void 0,this.Bi(c)}}),this.nr(d,u)}nr(c,u){for(;c.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-u>=30&&c.length>0)return void setTimeout(()=>{this.nr(c,u)},0);var h=c.shift();if(h)try{h()}catch(c){tc.error("Error initializing extension:",c)}}var d=Math.round(performance.now()-u);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:d}),this.config.__preview_deferred_init_extensions&&tc.info("PostHog extensions initialized ("+d+"ms)")}Bi(c){var u,h,d,v,m,b,S,k,P;if(!T||!T.body)return tc.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Bi(c)},500);this.config.__preview_deferred_init_extensions&&(this.sr=c),this.compression=void 0,c.supportedCompression&&!this.config.disable_compression&&(this.compression=w(c.supportedCompression,il.GZipJS)?il.GZipJS:w(c.supportedCompression,il.Base64)?il.Base64:void 0),null!=(u=c.analytics)&&u.endpoint&&(this.analyticsDefaultEndpoint=c.analytics.endpoint),this.set_config({person_profiles:this.Ge?this.Ge:"identified_only"}),null==(h=this.siteApps)||h.onRemoteConfig(c),null==(d=this.sessionRecording)||d.onRemoteConfig(c),null==(v=this.autocapture)||v.onRemoteConfig(c),null==(m=this.heatmaps)||m.onRemoteConfig(c),this.surveys.onRemoteConfig(c),this.logs.onRemoteConfig(c),this.conversations.onRemoteConfig(c),null==(b=this.productTours)||b.onRemoteConfig(c),null==(S=this.webVitalsAutocapture)||S.onRemoteConfig(c),null==(k=this.exceptionObserver)||k.onRemoteConfig(c),this.exceptions.onRemoteConfig(c),null==(P=this.deadClicksAutocapture)||P.onRemoteConfig(c)}rr(){try{this.config.loaded(this)}catch(c){tc.critical("`loaded` function failed",c)}if(this.ar(),this.config.internal_or_test_user_hostname&&null!=P&&P.hostname){var c=P.hostname,u=this.config.internal_or_test_user_hostname;("string"==typeof u?c===u:u.test(c))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.lr()},1),this.ur=new yn(this),this.ur.load()}ar(){var c;this.is_capturing()&&this.config.request_batching&&(null==(c=this.Qe)||c.enable())}_dom_loaded(){this.is_capturing()&&Ci(this.__request_queue,c=>this.Ze(c)),this.__request_queue=[],this.ar()}_handle_unload(){var c,u;this.surveys.handlePageUnload(),this.config.request_batching?(this.hr()&&this.capture("$pageleave"),null==(c=this.Qe)||c.unload(),null==(u=this.tr)||u.unload()):this.hr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(c){this.__loaded&&(rh?this.__request_queue.push(c):this.rateLimiter.isServerRateLimited(c.batchKey)||(c.transport=c.transport||this.config.api_transport,c.url=Kr(c.url,{ip:this.config.ip?1:0}),c.headers=_({},this.config.request_headers,c.headers),c.compression="best-available"===c.compression?this.compression:c.compression,c.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(c.disableTransport=["sendBeacon"]),c.fetchOptions=c.fetchOptions||this.config.fetch_options,
1(c=>{var u,h,d,v=_({},c);v.timeout=v.timeout||6e4,v.url=Kr(v.url,{_:(new Date).getTime().toString(),ver:J.LIB_VERSION,compression:v.compression});var m=null!==(u=v.transport)&&void 0!==u?u:"fetch",b=iI.filter(c=>!v.disableTransport||!c.transport||!v.disableTransport.includes(c.transport)),S=null!==(h=null==(d=Ui(b,c=>c.transport===m))?void 0:d.method)&&void 0!==h?h:b[0].method;if(!S)throw Error("No available transport method");S(v)})(_({},c,{callback:u=>{var h,d;this.rateLimiter.checkForLimiting(u),u.statusCode>=400&&(null==(h=(d=this.config).on_request_error)||h.call(d,u)),null==c.callback||c.callback(u)}}))))}Ze(c){this.tr?this.tr.retriableRequest(c):this._send_request(c)}_execute_array(c){rc++;try{var u,h=[],d=[],v=[];Ci(c,c=>{c&&(u=c[0],ec(u)?v.push(c):I(c)?c.call(this):ec(c)&&"alias"===u?h.push(c):ec(c)&&-1!==u.indexOf("capture")&&I(this[u])?v.push(c):d.push(c))});var n=function(c,u){Ci(c,function(c){if(ec(c[0])){var h=u;Ii(c,function(c){h=h[c[0]].apply(h,c.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};n(h,this),n(d,this),n(v,this)}finally{rc--}}er(){var c,u;return(null==(c=this.config.bootstrap)?void 0:c.featureFlags)&&Object.keys(null==(u=this.config.bootstrap)?void 0:u.featureFlags).length>0||!1}push(c){if(rc>0&&ec(c)&&M(c[0])){var u=Vn.prototype[c[0]];I(u)&&u.apply(this,c.slice(1))}else this._execute_array([c])}capture(c,u,h){var d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Qe){if(this.is_capturing()){if(!O(c)&&M(c)){var v=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(v&&!this.config.__preview_capture_bot_pageviews)){var m=null!=h&&h.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==m||!m.isRateLimited){null!=u&&u.$current_url&&!M(null==u?void 0:u.$current_url)&&(tc.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==u||delete u.$current_url),"$exception"!==c||null!=h&&h.ft||tc.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var b,S,k,T,P=new Date,C=(null==h?void 0:h.timestamp)||P,$=Ce(),G={uuid:$,event:c,properties:this.calculateEventProperties(c,u||{},C,$)};"$pageview"===c&&this.config.__preview_capture_bot_pageviews&&v&&(G.event="$bot_pageview",G.properties.$browser_type="bot"),m&&(G.properties.$lib_rate_limit_remaining_tokens=m.remainingTokens),(null==h?void 0:h.$set)&&(G.$set=null==h?void 0:h.$set);var X,Z="$groupidentify"!==c,J=this.dr(null==h?void 0:h.$set_once,Z);if(J&&(G.$set_once=J),(b=G,S=null!=h&&h._noTruncate?null:this.config.properties_string_max_length,k=c=>M(c)&&!D(S)?c.slice(0,S):c,T=new Set,G=function t(c,u){var h;return c!==Object(c)?k?k(c,u):c:T.has(c)?void 0:(T.add(c),ec(c)?(h=[],Ci(c,c=>{h.push(t(c))})):(h={},Ii(c,(c,u)=>{T.has(c)||(h[u]=t(c,u))})),h)}(b)).timestamp=C,O(null==h?void 0:h.timestamp)||(G.properties.$event_time_override_provided=!0,G.properties.$event_time_override_system_time=P),c===iX.DISMISSED||c===iX.SENT){var Q=null==u?void 0:u[iZ.SURVEY_ID],ee=null==u?void 0:u[iZ.SURVEY_ITERATION];X={id:Q,current_iteration:ee},localStorage.getItem(en(X))||localStorage.setItem(en(X),"true"),G.$set=_({},G.$set,{[tn({id:Q,current_iteration:ee},c===iX.SENT?"responded":"dismissed")]:!0})}else c===iX.SHOWN&&(G.$set=_({},G.$set,{[iZ.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(c===i5.SHOWN){var et=null==u?void 0:u[i4.TOUR_TYPE];et&&(G.$set=_({},G.$set,{[i4.TOUR_LAST_SEEN_DATE+"/"+et]:(new Date).toISOString()}))}var ei=_({},G.properties.$set,G.$set);if(F(ei)||this.setPersonPropertiesForFlags(ei),!j(this.config.before_send)){var ea=this.vr(G);if(!ea)return;G=ea}this.Ft.emit("eventCaptured",G);var el={method:"POST",url:null!==(d=null==h?void 0:h._url)&&void 0!==d?d:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:G,compression:"best-available",batchKey:null==h?void 0:h._batchKey};return!this.config.request_batching||h&&(null==h||!h._batchKey)||null!=h&&h.send_instantly?this.Ze(el):this.Qe.enqueue(el),G}tc.critical("This capture call is ignored due to client rate limiting.")}}else tc.error("No event name provided to posthog.capture")}}else tc.uninitializedWarning("posthog.capture")}_addCaptureHook(c){return this.on("eventCaptured",u=>c(u.event,u))}calculateEventProperties(c,u,h,v,m){if(h=h||new Date,!this.persistence||!this.sessionPersistence)return u;var b,S=m?void 0:this.persistence.remove_event_timer(c),k=_({},u);if(k.token=this.config.token,k.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(k.$cookieless_mode=!0),"$snapshot"===c){var C=_({},this.persistence.properties(),this.sessionPersistence.properties());return k.distinct_id=C.distinct_id,(!M(k.distinct_id)&&!L(k.distinct_id)||A(k.distinct_id))&&tc.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),k}var $,G=function(c,u){if(!X)return{};var h,v,m,b,S,k,T,C,$,G=c?Fi([],iM,u||[]):[],[Z,Q]=function(c){for(var u=0;u<e4.length;u++){var[h,d]=e4[u],v=h.exec(c),m=v&&(I(d)?d(v,c):d);if(m)return m}return["",""]}(X),ee=(C=Kt(X))===ey||C===em||"Kobo"===C||"Kindle Fire"===C||C===eK?ef:C===eD||C===eU||C===ej||C===eW?"Console":C===ew?"Wearable":C?eg:"Desktop";return"Desktop"===ee&&"Android"===(null==(k=navigator)||null==(k=k.userAgentData)?void 0:k.platform)&&(null==(T=navigator)?void 0:T.maxTouchPoints)>0&&(ee=Math.min(null!==(h=null==d||null==(v=d.screen)?void 0:v.width)&&void 0!==h?h:0,null!==(m=null==d||null==(b=d.screen)?void 0:b.height)&&void 0!==m?m:0)/(null!==(S=null==d?void 0:d.devicePixelRatio)&&void 0!==S?S:1)>=600?"Tablet":"Mobile"),Ri(Di({$os:Z,$os_version:Q,$browser:Wt(X,navigator.vendor),$device:Kt(X),$device_type:ee,$timezone:ms(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(c){return}}()}),{$current_url:er(null==P?void 0:P.href,G,iL),$host:null==P?void 0:P.host,$pathname:null==P?void 0:P.pathname,$raw_user_agent:X.length>1e3?X.substring(0,997)+"...":X,$browser_version:Vt(X,navigator.vendor),$browser_language:fs(),$browser_language_prefix:"string"==typeof($=fs())?$.split("-")[0]:void 0,$screen_height:null==d?void 0:d.screen.height,$screen_width:null==d?void 0:d.screen.width,$viewport_height:null==d?void 0:d.innerHeight,$viewport_width:null==d?void 0:d.innerWidth,$lib:"web",$lib_version:J.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:Z,windowId:Q}=this.sessionManager.checkAndGetSessionAndWindowId(m,h.getTime());k.$session_id=Z,k.$window_id=Q}this.sessionPropsManager&&Ri(k,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&Ri(k,this.sessionRecording.sdkDebugProperties),k.$sdk_debug_retry_queue_size=null==(b=this.tr)?void 0:b.length}catch(c){k.$sdk_debug_error_capturing_properties=String(c)}if(this.requestRouter.region===re.CUSTOM&&(k.$lib_custom_api_host=this.config.api_host),$="$pageview"!==c||m?"$pageleave"!==c||m?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(h):this.pageViewManager.doPageView(h,v),k=Ri(k,$),"$pageview"===c&&T&&(k.title=T.title),!O(S)){var ee=h.getTime()-S;k.$duration=parseFloat((ee/1e3).toFixed(3))}X&&this.config.opt_out_useragent_filter&&(k.$browser_type=this._is_bot()?"bot":"browser"),(k=Ri({},G,this.persistence.properties(),this.sessionPersistence.properties(),k)).$is_identified=this._isIdentified(),ec(this.config.property_denylist)?Ii(this.config.property_denylist,function(c){delete k[c]}):tc.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var et=this.config.sanitize_properties;et&&(tc.error("sanitize_properties is deprecated. Use before_send instead"),k=et(k,c));var ei=this.cr();return k.$process_person_profile=ei,ei&&!m&&this.pr("_calculate_event_properties"),k}dr(c,u){if(void 0===u&&(u=!0),!this.persistence||!this.cr()||this.Be)return c;var h,d=Ri({},this.persistence.get_initial_props(),(null==(h=this.sessionPropsManager)?void 0:h.getSetOnceProps())||{},c||{}),v=this.config.sanitize_properties;return v&&(tc.error("sanitize_properties is deprecated. Use before_send instead"),d=v(d,"$set_once")),u&&(this.Be=!0),F(d)?void 0:d}register(c,u){var h;null==(h=this.persistence)||h.register(c,u)}register_once(c,u,h){var d;null==(d=this.persistence)||d.register_once(c,u,h)}register_for_session(c){var u;null==(u=this.sessionPersistence)||u.register(c)}unregister(c){var u;null==(u=this.persistence)||u.unregister(c)}unregister_for_session(c){var u;null==(u=this.sessionPersistence)||u.unregister(c)}_r(c,u){this.register({[c]:u})}getFeatureFlag(c,u){return this.featureFlags.getFeatureFlag(c,u)}getFeatureFlagPayload(c){return this.featureFlags.getFeatureFlagPayload(c)}getFeatureFlagResult(c,u){return this.featureFlags.getFeatureFlagResult(c,u)}isFeatureEnabled(c,u){return this.featureFlags.isFeatureEnabled(c,u)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(c,u,h){var d=null!=h&&h.merge?this.featureFlags.getFlagVariants():{},v=null!=h&&h.merge?this.featureFlags.getFlagPayloads():{},m=_({},d,c),b=_({},v,u),S={};for(var[k,T]of Object.entries(m)){var P="string"==typeof T;S[k]={key:k,enabled:!!P||!!T,variant:P?T:void 0,reason:void 0,metadata:O(null==b?void 0:b[k])?void 0:{id:0,version:void 0,description:void 0,payload:b[k]}}}this.featureFlags.receivedFeatureFlags({flags:S})}updateEarlyAccessFeatureEnrollment(c,u,h){this.featureFlags.updateEarlyAccessFeatureEnrollment(c,u,h)}getEarlyAccessFeatures(c,u,h){return void 0===u&&(u=!1),this.featureFlags.getEarlyAccessFeatures(c,u,h)}on(c,u){return this.Ft.on(c,u)}onFeatureFlags(c){return this.featureFlags.onFeatureFlags(c)}onSurveysLoaded(c){return this.surveys.onSurveysLoaded(c)}onSessionId(c){var u,h;return null!==(u=null==(h=this.sessionManager)?void 0:h.onSessionId(c))&&void 0!==u?u:()=>{}}getSurveys(c,u){void 0===u&&(u=!1),this.surveys.getSurveys(c,u)}getActiveMatchingSurveys(c,u){void 0===u&&(u=!1),this.surveys.getActiveMatchingSurveys(c,u)}renderSurvey(c,u){this.surveys.renderSurvey(c,u)}displaySurvey(c,u){void 0===u&&(u=i2),this.surveys.displaySurvey(c,u)}cancelPendingSurvey(c){this.surveys.cancelPendingSurvey(c)}canRenderSurvey(c){return this.surveys.canRenderSurvey(c)}canRenderSurveyAsync(c,u){return void 0===u&&(u=!1),this.surveys.canRenderSurveyAsync(c,u)}identify(c,u,h){if(!this.__loaded||!this.persistence)return tc.uninitializedWarning("posthog.identify");if(L(c)&&(c=c.toString(),tc.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),c){if(["distinct_id","distinctid"].includes(c.toLowerCase()))tc.critical('The string "'+c+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(c!==tW){if(this.pr("posthog.identify")){var d=this.get_distinct_id();this.register({$user_id:c}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:d},""),c!==d&&c!==this.get_property(tg)&&(this.unregister(tg),this.register({distinct_id:c}));var v="anonymous"===(this.persistence.get_property(tD)||"anonymous");c!==d&&v?(this.persistence.set_property(tD,"identified"),this.setPersonPropertiesForFlags(_({},h||{},u||{}),!1),this.capture("$identify",{distinct_id:c,$anon_distinct_id:d},{$set:u||{},$set_once:h||{}}),this.Ve=ts(c,u,h),this.featureFlags.setAnonymousDistinctId(d)):(u||h)&&this.setPersonProperties(u,h),c!==d&&(this.reloadFeatureFlags(),this.unregister(tM))}}else tc.critical('The string "'+tW+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.')}else tc.error("Unique user id has not been set in posthog.identify")}setPersonProperties(c,u){if((c||u)&&this.pr("posthog.setPersonProperties")){var h=ts(this.get_distinct_id(),c,u);this.Ve!==h?(this.setPersonPropertiesForFlags(_({},u||{},c||{})),this.capture("$set",{$set:c||{},$set_once:u||{}}),this.Ve=h):tc.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(c,u,h){if(c&&u){var d=this.getGroups();d[c]!==u&&this.resetGroupPropertiesForFlags(c),this.register({$groups:_({},d,{[c]:u})}),h&&(this.capture("$groupidentify",{$group_type:c,$group_key:u,$group_set:h}),this.setGroupPropertiesForFlags({[c]:h})),d[c]===u||h||this.reloadFeatureFlags()}else tc.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(c,u){void 0===u&&(u=!0),this.featureFlags.setPersonPropertiesForFlags(c,u)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(c,u){void 0===u&&(u=!0),this.pr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(c,u)}resetGroupPropertiesForFlags(c){this.featureFlags.resetGroupPropertiesForFlags(c)}reset(c){if(tc.info("reset"),!this.__loaded)return tc.uninitializedWarning("posthog.reset");var u,h,d,v,m,b=this.get_property("$device_id");if(this.consent.reset(),null==(u=this.persistence)||u.clear(),null==(h=this.sessionPersistence)||h.clear(),this.surveys.reset(),null==(d=this.ur)||d.stop(),this.featureFlags.reset(),null==(v=this.persistence)||v.set_property(tD,"anonymous"),null==(m
vendor: 4,105 bytes, line 1
1=this.sessionManager)||m.resetSessionId(),this.Ve=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:tW,$device_id:null},"");else{var S=this.config.get_device_id(Ce());this.register_once({distinct_id:S,$device_id:c?S:b},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var c,u;return null!==(c=null==(u=this.sessionManager)?void 0:u.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==c?c:""}get_session_replay_url(c){if(!this.sessionManager)return"";var{sessionId:u,sessionStartTimestamp:h}=this.sessionManager.checkAndGetSessionAndWindowId(!0),d=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+u);if(null!=c&&c.withTimestamp&&h){var v,m=null!==(v=c.timestampLookBack)&&void 0!==v?v:10;if(!h)return d;d+="?t="+Math.max(Math.floor(((new Date).getTime()-h)/1e3)-m,0)}return d}alias(c,u){return c===this.get_property(t_)?(tc.critical("Attempting to create alias for existing People user - aborting."),-2):this.pr("posthog.alias")?(O(u)&&(u=this.get_distinct_id()),c!==u?(this._r(tg,c),this.capture("$create_alias",{alias:c,distinct_id:u})):(tc.warn("alias matches current distinct_id - skipping api call."),this.identify(c),-1)):void 0}set_config(c){var u=_({},this.config);if(R(c)){Ri(this.config,Wn(c));var h,d,v,m,b,S,k,T,P=this.Xe();null==(h=this.persistence)||h.update_config(this.config,u,P),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Us(_({},this.config,{persistence:"sessionStorage"}),P);var C=this.Je(this.config.debug);U(C)&&(this.config.debug=C),U(this.config.debug)&&(this.config.debug?(J.DEBUG=!0,t0.O()&&t0.j("ph_debug","true"),tc.info("set_config",{config:c,oldConfig:u,newConfig:_({},this.config)})):(J.DEBUG=!1,t0.O()&&t0.L("ph_debug"))),null==(d=this.exceptionObserver)||d.onConfigChange(),null==(v=this.sessionRecording)||v.startIfEnabledOrStop(),null==(m=this.autocapture)||m.startIfEnabled(),null==(b=this.heatmaps)||b.startIfEnabled(),null==(S=this.exceptionObserver)||S.startIfEnabledOrStop(),null==(k=this.deadClicksAutocapture)||k.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.gr(),null==(T=this.externalIntegrations)||T.startIfEnabledOrStop()}}startSessionRecording(c){var u,h,d,v,m,b=!0===c,S={sampling:b||!(null==c||!c.sampling),linked_flag:b||!(null==c||!c.linked_flag),url_trigger:b||!(null==c||!c.url_trigger),event_trigger:b||!(null==c||!c.event_trigger)};Object.values(S).some(Boolean)&&(null==(u=this.sessionManager)||u.checkAndGetSessionAndWindowId(),S.sampling&&(null==(h=this.sessionRecording)||h.overrideSampling()),S.linked_flag&&(null==(d=this.sessionRecording)||d.overrideLinkedFlag()),S.url_trigger&&(null==(v=this.sessionRecording)||v.overrideTrigger("url")),S.event_trigger&&(null==(m=this.sessionRecording)||m.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var c;return!(null==(c=this.sessionRecording)||!c.started)}captureException(c,u){var h=Error("PostHog syntheticException"),d=this.exceptions.buildProperties(c,{handled:!0,syntheticException:h});return this.exceptions.sendExceptionEvent(_({},d,u))}startExceptionAutocapture(c){this.set_config({capture_exceptions:null==c||c})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(c){return this.toolbar.loadToolbar(c)}get_property(c){var u;return null==(u=this.persistence)?void 0:u.props[c]}getSessionProperty(c){var u;return null==(u=this.sessionPersistence)?void 0:u.props[c]}toString(){var c,u=null!==(c=this.config.name)&&void 0!==c?c:ru;return u!==ru&&(u=ru+"."+u),u}_isIdentified(){var c,u;return"identified"===(null==(c=this.persistence)?void 0:c.get_property(tD))||"identified"===(null==(u=this.sessionPersistence)?void 0:u.get_property(tD))}cr(){var c,u;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
1!this._isIdentified()&&F(this.getGroups())&&(null==(c=this.persistence)||null==(c=c.props)||!c[tg])&&(null==(u=this.persistence)||null==(u=u.props)||!u[tV]))}hr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.cr()||this.pr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pr(c){return"never"===this.config.person_profiles?(tc.error(c+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._r(tV,!0),!0)}Xe(){if("always"===this.config.cookieless_mode)return!0;var c=this.consent.isOptedOut(),u=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||c&&!!u}gr(){var c,u,h,d,v=this.Xe();return(null==(c=this.persistence)?void 0:c.zt)!==v&&(null==(h=this.persistence)||h.set_disabled(v)),(null==(u=this.sessionPersistence)?void 0:u.zt)!==v&&(null==(d=this.sessionPersistence)||d.set_disabled(v)),v}opt_in_capturing(c){var u;if("always"!==this.config.cookieless_mode){if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()){this.reset(!0),null==(d=this.sessionManager)||d.destroy(),null==(v=this.pageViewManager)||v.destroy(),this.sessionManager=new Cn(this),this.pageViewManager=new ur(this),this.persistence&&(this.sessionPropsManager=new Pn(this,this.sessionManager,this.persistence));var h,d,v,m,b,S,k=null!==(m=null==(b=this.config.__extensionClasses)?void 0:b.sessionRecording)&&void 0!==m?m:null==(S=Vn.__defaultExtensionClasses)?void 0:S.sessionRecording;k&&(this.sessionRecording=new k(this),this.sessionRecording.startIfEnabledOrStop())}this.consent.optInOut(!0),this.gr(),this.ar(),null==(u=this.sessionRecording)||u.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(O(null==c?void 0:c.captureEventName)||null!=c&&c.captureEventName)&&this.capture(null!==(h=null==c?void 0:c.captureEventName)&&void 0!==h?h:"$opt_in",null==c?void 0:c.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.lr()}else tc.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var c,u,h;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gr(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:tW,$device_id:null}),null==(c=this.sessionManager)||c.destroy(),null==(u=this.pageViewManager)||u.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(h=this.sessionRecording)||h.stopRecording(),this.sessionRecording=void 0,this.lr())):tc.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var c=this.consent.consent;return c===t6.GRANTED?"granted":c===t6.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gr()}_is_bot(){return k?In(k,this.config.custom_blocked_useragents):void 0}lr(){T&&("visible"===T.visibilityState?this.qe||(this.qe=!0,this.capture("$pageview",{title:T.title},{send_instantly:!0}),this.We&&(T.removeEventListener("visibilitychange",this.We),this.We=null)):this.We||(this.We=this.lr.bind(this),zi(T,"visibilitychange",this.We)))}debug(c){!1===c?(null==d||d.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==d||d.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}At(){var c,u,h,d,v=this.Ke||{};return"advanced_disable_flags"in v?!!v.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tc.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(u="advanced_disable_decide",h=(c="advanced_disable_flags")in v&&!j(v[c]),d=u in v&&!j(v[u]),h?v[c]:!!d&&(tc&&tc.warn("Config field '"+u+"' is deprecated. Please use '"+c+"' instead. The old field will be removed in a future major version."),v[u]))}vr(c){if(j(this.config.before_send))return c;var u=ec(this.config.before_send)?this.config.before_send:[this.config.before_send],h=c;for(var d of u){if(j(h=d(h))){var v="Event '"+c.event+"' was rejected in beforeSend function";return H(c.event)?tc.warn(v+". This can cause unexpected behavior."):tc.info(v),null}h.properties&&!F(h.properties)||tc.warn("Event '"+c.event+"' has no properties after beforeSend function, this is likely an error.")}return h}getPageViewId(){var c;
1return null==(c=this.pageViewManager.it)?void 0:c.pageViewId}captureTraceFeedback(c,u){this.capture("$ai_feedback",{$ai_trace_id:String(c),$ai_feedback_text:u})}captureTraceMetric(c,u,h){this.capture("$ai_metric",{$ai_trace_id:String(c),$ai_metric_name:u,$ai_metric_value:String(h)})}Je(c){var u=U(c)&&!c,h=t0.O()&&"true"===t0.A("ph_debug");return!u&&(!!h||c)}};function Jn(c){return c instanceof Element&&(c.id===tB||!(null==c.closest||!c.closest(".toolbar-global-fade-container")))}function Kn(c){return!!c&&1===c.nodeType}function Yn(c,u){return!!c&&!!c.tagName&&c.tagName.toLowerCase()===u.toLowerCase()}function Xn(c){return!!c&&3===c.nodeType}function Qn(c){return!!c&&11===c.nodeType}function Zn(c){return c?x(c).split(/\s+/):[]}function to(c){var u=null==d?void 0:d.location.href;return!!(u&&c&&c.some(c=>u.match(c)))}function io(c){var u="";switch(typeof c.className){case"string":u=c.className;break;case"object":u=(c.className&&"baseVal"in c.className?c.className.baseVal:null)||c.getAttribute("class")||"";break;default:u=""}return Zn(u)}function eo(c){return j(c)?null:x(c).split(/(\s+)/).filter(c=>Eo(c)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ro(c){var u="";return _o(c)&&!go(c)&&c.childNodes&&c.childNodes.length&&Ii(c.childNodes,function(c){var h;Xn(c)&&c.textContent&&(u+=null!==(h=eo(c.textContent))&&void 0!==h?h:"")}),x(u)}function so(c){var u;return O(c.target)?c.srcElement||null:null!=(u=c.target)&&u.shadowRoot?c.composedPath()[0]||null:c.target||null}Vn.__defaultExtensionClasses={},function(c,u){for(var h=0;h<u.length;h++)c.prototype[u[h]]=Ai(c.prototype[u[h]])}(Vn,["identify"]);var rd=["a","button","form","input","select","textarea","label"];function oo(c,u){if(O(u))return!0;var h,r=function(c){if(u.some(u=>c.matches(u)))return{v:!0}};for(var d of c)if(h=r(d))return h.v;return!1}function ao(c){var u=c.parentNode;return!(!u||!Kn(u))&&u}var rp=["next","previous","prev",">","<"],r_=[".ph-no-rageclick",".ph-no-capture"],co=c=>!c||Yn(c,"html")||!Kn(c),fo=(c,u)=>{if(!d||co(c))return{parentIsUsefulElement:!1,targetElementList:[]};for(var h=!1,v=[c],m=c;m.parentNode&&!Yn(m,"body");)if(Qn(m.parentNode))v.push(m.parentNode.host),m=m.parentNode.host;else{var b=ao(m);if(!b)break;if(u||rd.indexOf(b.tagName.toLowerCase())>-1)h=!0;else{var S=d.getComputedStyle(b);S&&"pointer"===S.getPropertyValue("cursor")&&(h=!0)}v.push(b),m=b}return{parentIsUsefulElement:h,targetElementList:v}};function _o(c){for(var u=c;u.parentNode&&!Yn(u,"body");u=u.parentNode){var h=io(u);if(w(h,"ph-sensitive")||w(h,"ph-no-capture"))return!1}if(w(io(c),"ph-include"))return!0;var d=c.type||"";if(M(d))switch(d.toLowerCase()){case"hidden":case"password":return!1}var v=c.name||c.id||"";return!(M(v)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(v.replace(/[^a-zA-Z0-9]/g,"")))}function go(c){return!!(Yn(c,"input")&&!["button","checkbox","submit","reset"].includes(c.type)||Yn(c,"select")||Yn(c,"textarea")||"true"===c.getAttribute("contenteditable"))}var rg="(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})",rv=RegExp("^(?:"+rg+")$"),rf=new RegExp(rg),rm="\\d{3}-?\\d{2}-?\\d{4}",ry=RegExp("^("+rm+")$"),rb=RegExp("("+rm+")");function Eo(c,u){return void 0===u&&(u=!0),!(j(c)||M(c)&&(c=x(c),(u?rv:rf).test((c||"").replace(/[- ]/g,""))||(u?ry:rb).test(c)))}function So(c){var u=ro(c);return Eo(u=(u+" "+function ko(c){var u="";return c&&c.childNodes&&c.childNodes.length&&Ii(c.childNodes,function(c){var h;if(c&&"span"===(null==(h=c.tagName)?void 0:h.toLowerCase()))try{var d=ro(c);u=(u+" "+d).trim(),c.childNodes&&c.childNodes.length&&(u=(u+" "+ko(c)).trim())}catch(c){tc.error("[AutoCapture]",c)}}),u}(c)).trim())?u:""}function To(c){return c.replace(/"|\\"/g,'\\"')}let Io=class Io{constructor(c){this.disabled=!1===c;var u=R(c)?c:{};this.thresholdPx=u.threshold_px||30,this.timeoutMs=u.timeout_ms||1e3,this.clickCount=u.click_count||3,this.clicks=[]}isRageClick(c,u,h){if(this.disabled)return!1;var d=this.clicks[this.clicks.length-1];if(d&&Math.abs(c-d.x)+Math.abs(u-d.y)<this.thresholdPx&&h-d.timestamp<this.timeoutMs){if(this.clicks.push({x:c,y:u,timestamp:h}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:c,y:u,timestamp:h}];return!1}};var rw="$copy_autocapture",rE=tu("[AutoCapture]");function Oo(c,u){return u.length>c?u.slice(0,c)+"...":u}var rS=tu("[ExceptionAutocapture]");function Lo(c,u,h){try{if(!(u in c))return()=>{};var d=c[u],v=h(d);return I(v)&&(v.prototype=v.prototype||{},Object.defineProperties(v,{__posthog_wrapped__:{enumerable:!1,value:!0}})),c[u]=v,()=>{c[u]=d}}catch(c){return()=>{}}}var rx=tu("[TracingHeaders]"),rk=tu("[Web Vitals]");tu("[SessionRecording]");var rO="[SessionRecording]",rR=tu(rO),rT=tu("[Heatmaps]");function Wo(c){return R(c)&&"clientX"in c&&"clientY"in c&&L(c.clientX)&&L(c.clientY)}var rP=tu("[Product Tours]"),rF="ph_product_tours",rI=["$set_once","$set"],rC=tu("[
1SiteApps]"),r$=_({},{sessionRecording:class{get started(){var c;return!(null==(c=this.mr)||!c.isStarted)}get status(){return this.mr?this.mr.status:this.br?this.yr?"lazy_loading":"disabled":"pending_config"}constructor(c){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.wr=!1,this.$r=void 0,this._instance=c,!this._instance.sessionManager)throw rR.error("started without valid sessionManager"),Error(rO+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(rO+' cannot be used with cookieless_mode="always"')}get yr(){var c,u=!(null==(c=this._instance.get_property(tO))||!c.enabled),h=!this._instance.config.disable_session_recording,v=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return d&&u&&h&&!v}startIfEnabledOrStop(c){var u;if(this.br&&(!this.yr||null==(u=this.mr)||!u.isStarted)){var h=!O(Object.assign)&&!O(Array.from);this.yr&&h?(this.Er(c),rR.info("starting")):this.stopRecording()}}Er(c){var u,h,d;this.yr&&(null!=Z&&null!=(u=Z.__PosthogExtensions__)&&null!=(u=u.rrweb)&&u.record&&null!=(h=Z.__PosthogExtensions__)&&h.initSessionRecording?this.Sr(c):null==(d=Z.__PosthogExtensions__)||null==d.loadExternalDependency||d.loadExternalDependency(this._instance,this.kr,u=>{if(u)return rR.error("could not load recorder",u);this.Sr(c)}))}stopRecording(){var c,u;null==(c=this.$r)||c.call(this),this.$r=void 0,null==(u=this.mr)||u.stop()}Pr(){var c;null==(c=this._instance.persistence)||c.unregister(tT)}Tr(c){if(this._instance.persistence){var u,h,d=this._instance.persistence,s=()=>{var u=!1===c.sessionRecording?void 0:c.sessionRecording,h=null==u?void 0:u.sampleRate,v=j(h)?null:parseFloat(h);j(v)&&this.Pr();var m=null==u?void 0:u.minimumDurationMilliseconds;d.register({[tO]:_({cache_timestamp:Date.now(),enabled:!!u},u,{networkPayloadCapture:_({capturePerformance:c.capturePerformance},null==u?void 0:u.networkPayloadCapture),canvasRecording:{enabled:null==u?void 0:u.recordCanvas,fps:null==u?void 0:u.canvasFps,quality:null==u?void 0:u.canvasQuality},sampleRate:v,minimumDurationMilliseconds:O(m)?null:m,endpoint:null==u?void 0:u.endpoint,triggerMatchType:null==u?void 0:u.triggerMatchType,masking:null==u?void 0:u.masking,urlTriggers:null==u?void 0:u.urlTriggers})})};s(),null==(u=this.$r)||u.call(this),this.$r=null==(h=this._instance.sessionManager)?void 0:h.onSessionId(s)}}onRemoteConfig(c){"sessionRecording"in c?!1!==c.sessionRecording?(this.wr=!1,this.Tr(c),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:rR.info("skipping remote config with no sessionRecording",c)}log(c,u){var h;void 0===u&&(u="log"),null!=(h=this.mr)&&h.log?this.mr.log(c,u):rR.warn("log called before recorder was ready")}get kr(){var c,u,h=null==(c=this._instance)||null==(c=c.persistence)?void 0:c.get_property(tO);return(null==h||null==(u=h.scriptConfig)?void 0:u.script)||"lazy-recorder"}Cr(){var c,u=this._instance.get_property(tO);if(!u)return!1;var h=null!==(c=("object"==typeof u?u:JSON.parse(u)).cache_timestamp)&&void 0!==c?c:Date.now();return Date.now()-h<=3e5}Sr(c){var u,h;if(null==(u=Z.__PosthogExtensions__)||!u.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.mr||(this.mr=null==(h=Z.__PosthogExtensions__)?void 0:h.initSessionRecording(this._instance),this.mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Cr()?this.mr.start(c):this.wr||(this.wr=!0,rR.info("persisted remote config is stale, requesting fresh config before starting"),new yn(this._instance).load())}onRRwebEmit(c){var u;null==(u=this.mr)||null==u.onRRwebEmit||u.onRRwebEmit(c)}overrideLinkedFlag(){var c,u;this.mr||null==(u=this._instance.persistence)||u.register({$replay_override_linked_flag:!0}),null==(c=this.mr)||c.overrideLinkedFlag()}overrideSampling(){var c,u;this.mr||null==(u=this._instance.persistence)||u.register({$replay_override_sampling:!0}),null==(c=this.mr)||c.overrideSampling()}overrideTrigger(c){var u,h;this.mr||null==(h=this._instance.persistence)||h.register({["url"===c?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}
vendor: 1,171 bytes, line 1
1),null==(u=this.mr)||u.overrideTrigger(c)}get sdkDebugProperties(){var c;return(null==(c=this.mr)?void 0:c.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(c,u){var h;return!(null==(h=this.mr)||!h.tryAddCustomEvent(c,u))}}},{autocapture:class{constructor(c){this.Ir=!1,this.Rr=null,this.Fr=!1,this.instance=c,this.rageclicks=new Io(c.config.rageclick),this.Or=null}get N(){var c,u,h=R(this.instance.config.autocapture)?this.instance.config.autocapture:{};return h.url_allowlist=null==(c=h.url_allowlist)?void 0:c.map(c=>new RegExp(c)),h.url_ignorelist=null==(u=h.url_ignorelist)?void 0:u.map(c=>new RegExp(c)),h}Mr(){if(this.isBrowserSupported()){if(d&&T){var i=c=>{c=c||(null==d?void 0:d.event);try{this.Ar(c)}catch(c){rE.error("Failed to capture event",c)}};if(zi(T,"submit",i,{capture:!0}),zi(T,"change",i,{capture:!0}),zi(T,"click",i,{capture:!0}),this.N.capture_copied_text){var e=c=>{c=c||(null==d?void 0:d.event),this.Ar(c,rw)};zi(T,"copy",e,{capture:!0}),zi(T,"cut",e,{capture:!0})}}}else rE.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ir&&(this.Mr(),this.Ir=!0)}
1onRemoteConfig(c){c.elementsChainAsString&&(this.Fr=c.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tf]:!!c.autocapture_opt_out}),this.Rr=!!c.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(c){this.Or=c}getElementSelectors(c){var u,h=[];return null==(u=this.Or)||u.forEach(u=>{var d=null==T?void 0:T.querySelectorAll(u);null==d||d.forEach(d=>{c===d&&h.push(u)})}),h}get isEnabled(){var c,u,h=null==(c=this.instance.persistence)?void 0:c.props[tf];if(D(this.Rr)&&!U(h)&&!this.instance.At())return!1;var d=null!==(u=this.Rr)&&void 0!==u?u:!!h;return!!this.instance.config.autocapture&&!d}Ar(c,u){if(void 0===u&&(u="$autocapture"),this.isEnabled){var h,v=so(c);Xn(v)&&(v=v.parentNode||null),"$autocapture"===u&&"click"===c.type&&c instanceof MouseEvent&&this.instance.config.rageclick&&null!=(h=this.rageclicks)&&h.isRageClick(c.clientX,c.clientY,c.timeStamp||(new Date).getTime())&&function(c,u){if(!d||co(c)||(U(u)?(h=!!u&&r_,v=void 0):(h=null!==(m=null==u?void 0:u.css_selector_ignorelist)&&void 0!==m?m:r_,v=null==u?void 0:u.content_ignorelist),!1===h))return!1;var h,v,m,{targetElementList:b}=fo(c,!1);return!function(c,u){var h;if(!1===c||O(c))return!1;if(!0===c)h=rp;else{if(!ec(c))return!1;if(c.length>10)return tc.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map(c=>c.toLowerCase())}return u.some(c=>{var{safeText:u,ariaLabel:d}=c;return h.some(c=>u.includes(c)||d.includes(c))})}(v,b.map(c=>{var u;return{safeText:ro(c).toLowerCase(),ariaLabel:(null==(u=c.getAttribute("aria-label"))?void 0:u.toLowerCase().trim())||""}}))&&!oo(b,h)}(v,this.instance.config.rageclick)&&this.Ar(c,"$rageclick");var m=u===rw;if(v&&function(c,u,h,v,m){if(void 0===h&&(h=void 0),!d||co(c)||null!=(b=h)&&b.url_allowlist&&!to(h.url_allowlist)||null!=(S=h)&&S.url_ignorelist&&to(h.url_ignorelist))return!1;if(null!=(k=h)&&k.dom_event_allowlist){var b,S,k,T,P=h.dom_event_allowlist;if(P&&!P.some(c=>u.type===c))return!1}var{parentIsUsefulElement:C,targetElementList:$}=fo(c,v);if(!function(c,u){var h=null==u?void 0:u.element_allowlist;if(O(h))return!0;var d,s=function(c){if(h.some(u=>c.tagName.toLowerCase()===u))return{v:!0}};for(var v of c)if(d=s(v))return d.v;return!1}($,h)||!oo($,null==(T=h)?void 0:T.css_selector_allowlist))return!1;var G=d.getComputedStyle(c);if(G&&"pointer"===G.getPropertyValue("cursor")&&"click"===u.type)return!0;var X=c.tagName.toLowerCase();switch(X){case"html":return!1;case"form":return(m||["submit"]).indexOf(u.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(u.type)>=0;default:return C?(m||["click"]).indexOf(u.type)>=0:(m||["click"]).indexOf(u.type)>=0&&(rd.indexOf(X)>-1||"true"===c.getAttribute("contenteditable"))}}(v,c,this.N,m,m?["copy","cut"]:void 0)){var{props:b,explicitNoCapture:S}=function(c,u){for(var h,v,{e:m,maskAllElementAttributes:b,maskAllText:S,elementAttributeIgnoreList:k,elementsChainAsString:T}=u,P=[c],C=c;C.parentNode&&!Yn(C,"body");)Qn(C.parentNode)?(P.push(C.parentNode.host),C=C.parentNode.host):(P.push(C.parentNode),C=C.parentNode);var $,G=[],X={},Z=!1,J=!1;if(Ii(P,c=>{var u=_o(c);"a"===c.tagName.toLowerCase()&&(Z=c.getAttribute("href"),Z=u&&Z&&Eo(Z)&&Z),w(io(c),"ph-no-capture")&&(J=!0),G.push(function(c,u,h,d){var v=c.tagName.toLowerCase(),m={tag_name:v};rd.indexOf(v)>-1&&!h&&("a"===v.toLowerCase()||"button"===v.toLowerCase()?m.$el_text=Oo(1024,So(c)):m.$el_text=Oo(1024,ro(c)));var b=io(c);b.length>0&&(m.classes=b.filter(function(c){return""!==c})),Ii(c.attributes,function(h){var v;if((!go(c)||-1!==["name","id","class","aria-label"].indexOf(h.name))&&(null==d||!d.includes(h.name))&&!u&&Eo(h.value)&&(!M(v=h.name)||"_ngcontent"!==v.substring(0,10)&&"_nghost"!==v.substring(0,7))){var b=h.value;"class"===h.name&&(b=Zn(b).join(" ")),m["attr__"+h.name]=Oo(1024,b)}});for(var S=1,k=1,T=c;T=function(c){if(c.previousElementSibling)return c.previousElementSibling;var u=c;do u=u.previousSibling;while(u&&!Kn(u));return u}(T);)S++,T.tagName===c.tagName&&k++;return m.nth_child=S,m.nth_of_type=k,m}(c,b,S,k)),Ri(X,function(c){if(!_o(c))return{};var u={};return Ii(c.attributes,function(c){if(c.name&&0===c.name.indexOf("data-ph-capture-attribute")){var h=c.name.replace("data-ph-capture-attribute-",""),d=c.value;h&&d&&Eo(d)&&(u[h]=d)}}),u}(c))}),J)return{props:{},explicitNoCapture:J};if(S||("a"===c.tagName.toLowerCase()||"button"===c.tagName.toLowerCase()?G[0].$el_text=So(c):G[0].$el_text=ro(c)),Z){G[0].attr__href=Z;var Q,ee,et=null==(Q=Ze(Z))?void 0:Q.host,ei=null==d||null==(ee=d.location)?void 0:ee.host;et&&ei&&et!==ei&&($=Z)}return{props:Ri({$event_type:m.type,$ce_version:1},T?{}:{$elements:G},{$elements_chain:G.map(c=>{var u,h,d,v={text:null==(h=c.$el_text)?void 0:h.slice(0,400),tag_name:c.tag_name,href:null==(d=c.attr__href)?void 0:d.slice(0,2048),attr_class:(u=c.attr__class)?ec(u)?u:Zn(u):void 0,attr_id:c.attr__id,nth_child:c.nth_child,nth_of_type:c.nth_of_type,attributes:{}};return Oi(c).filter(c=>{var[u]=c;return 0===u.indexOf("attr__")}
vendor: 6,804 bytes, line 1
1).forEach(c=>{var[u,h]=c;return v.attributes[u]=h}),v}).map(c=>{var u,h,d="";if(c.tag_name&&(d+=c.tag_name),c.attr_class)for(var v of(c.attr_class.sort(),c.attr_class))d+="."+v.replace(/"/g,"");var m=_({},c.text?{text:c.text}:{},{"nth-child":null!==(u=c.nth_child)&&void 0!==u?u:0,"nth-of-type":null!==(h=c.nth_of_type)&&void 0!==h?h:0},c.href?{href:c.href}:{},c.attr_id?{attr_id:c.attr_id}:{},c.attributes),b={};return Oi(m).sort((c,u)=>{var[h]=c,[d]=u;return h.localeCompare(d)}).forEach(c=>{var[u,h]=c;return b[To(u.toString())]=To(h.toString())}),d+=":"+Oi(b).map(c=>{var[u,h]=c;return u+'="'+h+'"'}).join("")}).join(";")},null!=(h=G[0])&&h.$el_text?{$el_text:null==(v=G[0])?void 0:v.$el_text}:{},$&&"click"===m.type?{$external_click_url:$}:{},X)}}(v,{e:c,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Fr});if(S)return!1;var k=this.getElementSelectors(v);if(k&&k.length>0&&(b.$element_selectors=k),u===rw){var T,P=eo(null==d||null==(T=d.getSelection())?void 0:T.toString()),C=c.type||"clipboard";if(!P)return!1;b.$selected_content=P,b.$copy_type=C}return this.instance.capture(u,b),!0}}}isBrowserSupported(){return I(null==T?void 0:T.querySelectorAll)}},historyAutocapture:class{constructor(c){var u;this._instance=c,this.Dr=(null==d||null==(u=d.location)?void 0:u.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tc.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.jr&&this.jr(),this.jr=void 0,tc.info("History API monitoring stopped")}monitorHistoryChanges(){var c,u;if(d&&d.history){var h=this;null!=(c=d.history.pushState)&&c.__posthog_wrapped__||Lo(d.history,"pushState",c=>function(u,d,v){c.call(this,u,d,v),h.Lr("pushState")}),null!=(u=d.history.replaceState)&&u.__posthog_wrapped__||Lo(d.history,"replaceState",c=>function(u,d,v){c.call(this,u,d,v),h.Lr("replaceState")}),this.Nr()}}Lr(c){try{var u,h=null==d||null==(u=d.location)?void 0:u.pathname;if(!h)return;h!==this.Dr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:c}),this.Dr=h}catch(u){tc.error("Error capturing "+c+" pageview",u)}}Nr(){if(!this.jr){var i=()=>{this.Lr("popstate")};zi(d,"popstate",i),this.jr=()=>{d&&d.removeEventListener("popstate",i)}}}},heatmaps:class{constructor(c){var u;this.Ur=!1,this.Ir=!1,this.zr=null,this.instance=c,this.Ur=!(null==(u=this.instance.persistence)||!u.props[tm]),this.rageclicks=new Io(c.config.rageclick)}get flushIntervalMilliseconds(){var c=5e3;return R(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(c=this.instance.config.capture_heatmaps.flush_interval_milliseconds),c}get isEnabled(){return j(this.instance.config.capture_heatmaps)?j(this.instance.config.enable_heatmaps)?this.Ur:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Ir||(rT.info("starting..."),this.Hr(),this.Br());else{var c;clearInterval(null!==(c=this.zr)&&void 0!==c?c:void 0),this.qr(),this.getAndClearBuffer()}}onRemoteConfig(c){if("heatmaps"in c){var u=!!c.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tm]:u}),this.Ur=u,this.startIfEnabled()}}getAndClearBuffer(){var c=this.R;return this.R=void 0,c}Wr(c){this.Gr(c.originalEvent,"deadclick")}Br(){this.zr&&clearInterval(this.zr),this.zr="visible"===(null==T?void 0:T.visibilityState)?setInterval(this.se.bind(this),this.flushIntervalMilliseconds):null}Hr(){d&&T&&(this.Vr=this.se.bind(this),zi(d,"beforeunload",this.Vr),this.Jr=c=>this.Gr(c||(null==d?void 0:d.event)),zi(T,"click",this.Jr,{capture:!0}),this.Kr=c=>this.Yr(c||(null==d?void 0:d.event)),zi(T,"mousemove",this.Kr,{capture:!0}),this.Xr=new Ve(this.instance,We,this.Wr.bind(this)),this.Xr.startIfEnabledOrStop(),this.Qr=this.Br.bind(this),zi(T,"visibilitychange",this.Qr),this.Ir=!0)}qr(){var c;d&&T&&(this.Vr&&d.removeEventListener("beforeunload",this.Vr),this.Jr&&T.removeEventListener("click",this.Jr,{capture:!0}),this.Kr&&T.removeEventListener("mousemove",this.Kr,{capture:!0}),this.Qr&&T.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.Zr),null==(c=this.Xr)||c.stop(),this.Ir=!1)}ts(c,u){var h=this.instance.scrollManager.scrollY(),v=this.instance.scrollManager.scrollX(),m=this.instance.scrollManager.scrollElement(),b=function(c,u,h){for(var v=c;v&&Kn(v)&&!Yn(v,"body")&&v!==h;){if(w(u,null==d?void 0:d.getComputedStyle(v).position))return!0;v=ao(v)}return!1}(so(c),["fixed","sticky"],m);return{x:c.clientX+(b?0:v),y:c.clientY+(b?0:h),target_fixed:b,type:u}}Gr(c,u){var h;if(void 0===u&&(u="click"),!Jn(c.target)&&Wo(c)){var d=this.ts(c,u);null!=(h=this.rageclicks)&&h.isRageClick(c.clientX,c.clientY,(new Date).getTime())&&this.es(_({},d,{type:"rageclick"})),this.es(d)}}Yr(c){!Jn(c.target)&&Wo(c)&&(clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.es(this.ts(c,"mousemove"))},500))}es(c){if(d){var u=d.location.href,h=this.instance.config.mask_personal_data_properties,v=this.instance.config.custom_personal_data_properties,m=er(u,h?Fi([],iM,v||[]):[],iL);this.R=this.R||{},this.R[m]||(this.R[m]=[]),this.R[m].push(c)}}se(){this.R&&!F(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ve,webVitalsAutocapture:class{constructor(c){var u;this.Ur=!1,this.Ir=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rs=()=>{clearTimeout(this.ss),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((c,u)=>_({},c,{["$web_vitals_"+u.name+"_event"]:_({},u),["$web_vitals_"+u.name+"_value"]:u.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ns=c=>{var u,h=null==(u=this._instance.sessionManager)?void 0:u.checkAndGetSessionAndWindowId(!0);if(O(h))rk.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var d=this.os();O(d)||(j(null==c?void 0:c.name)||j(null==c?void 0:c.value)?rk.error("Invalid metric received",c):this.ls&&c.value>=this.ls?rk.error("Ignoring metric with value >= "+this.ls,c):(this.R.url!==d&&(this.rs(),this.ss=setTimeout(this.rs,this.flushToCaptureTimeoutMs)),O(this.R.url)&&(this.R.url=d),this.R.firstMetricTimestamp=O(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,c.attribution&&c.attribution.interactionTargetElement&&(c.attribution.interactionTargetElement=void 0),this.R.metrics.push(_({},c,{$current_url:d,$session_id:h.sessionId,$window_id:h.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.rs()))}},this.us=()=>
1{if(!this.Ir){var c,u,h,d,v=Z.__PosthogExtensions__;O(v)||O(v.postHogWebVitalsCallbacks)||({onLCP:c,onCLS:u,onFCP:h,onINP:d}=v.postHogWebVitalsCallbacks),c&&u&&h&&d?(this.allowedMetrics.indexOf("LCP")>-1&&c(this.ns.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&u(this.ns.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&h(this.ns.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&d(this.ns.bind(this)),this.Ir=!0):rk.error("web vitals callbacks not loaded - not starting")}},this._instance=c,this.Ur=!(null==(u=this._instance.persistence)||!u.props[tE]),this.startIfEnabled()}get allowedMetrics(){var c,u,h=R(this._instance.config.capture_performance)?null==(c=this._instance.config.capture_performance)?void 0:c.web_vitals_allowed_metrics:void 0;return j(h)?(null==(u=this._instance.persistence)?void 0:u.props[tk])||["CLS","FCP","INP","LCP"]:h}get flushToCaptureTimeoutMs(){return(R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var c=R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=c&&c}get ls(){var c=R(this._instance.config.capture_performance)&&L(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<c&&c<=6e4?9e5:c}get isEnabled(){var c=null==P?void 0:P.protocol;if("http:"!==c&&"https:"!==c)return rk.info("Web Vitals are disabled on non-http/https protocols"),!1;var u=R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:U(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return U(u)?u:this.Ur}startIfEnabled(){this.isEnabled&&!this.Ir&&(rk.info("enabled, starting..."),this.V(this.us))}onRemoteConfig(c){if("capturePerformance"in c){var u=R(c.capturePerformance)&&!!c.capturePerformance.web_vitals,h=R(c.capturePerformance)?c.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tE]:u}),this._instance.persistence.register({[tk]:h})),this.Ur=u,this.startIfEnabled()}}V(c){var u,h;if(null!=(u=Z.__PosthogExtensions__)&&u.postHogWebVitalsCallbacks)c();else{var d=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,d,u=>{u?rk.error("failed to load script",u):c()})}}os(){var c=d?d.location.href:void 0;if(c){var u=this._instance.config.mask_personal_data_properties,h=this._instance.config.custom_personal_data_properties;return er(c,u?Fi([],iM,h||[]):[],iL)}rk.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(c){var u,h,v;this.us=()=>{var c;if(d&&this.isEnabled&&null!=(c=Z.__PosthogExtensions__)&&c.errorWrappingFunctions){var u=Z.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,h=Z.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,v=Z.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hs&&this.N.capture_unhandled_errors&&(this.hs=u(this.captureException.bind(this))),!this.ds&&this.N.capture_unhandled_rejections&&(this.ds=h(this.captureException.bind(this))),!this.vs&&this.N.capture_console_errors&&(this.vs=v(this.captureException.bind(this)))}catch(c){rS.error("failed to start",c),this.cs()}}},this._instance=c,this.fs=!(null==(u=this._instance.persistence)||!u.props[ty]),this.ps=new Y({refillRate:null!==(h=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==h?h:1,bucketSize:null!==(v=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==v?v:10,refillInterval:1e4,h:rS}),this.N=this._s(),this.startIfEnabledOrStop()}_s(){var c=this._instance.config.capture_exceptions,u={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return R(c)?u=_({},u,c):(O(c)?this.fs:c)&&(u=_({},u,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),u}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(rS.info("enabled"),this.cs(),this.V(this.us)):this.cs()}V(c){var u,h;null!=(u=Z.__PosthogExtensions__)&&u.errorWrappingFunctions&&c(),null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,"exception-autocapture",u=>{if(u)return rS.error("failed to load script",u);c()})}cs(){var c,u,h;null==(c=this.hs)||c.call(this),this.hs=void 0,null==(u=this.ds)||u.call(this),this.ds=void 0,null==(h=this.vs)||h.call(this),this.vs=void 0}onRemoteConfig(c){if("autocaptureExceptions"in c){var u=c.autocaptureExceptions;this.fs=!!u,this._instance.persistence&&this._instance.persistence.register({[ty]:this.fs}),this.N=this._s(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this._s()}captureException(c){var u,h,d=null!==(u=null==c||null==(h=c.$exception_list)||null==(h=h[0])?void 0:h.type)&&void 0!==u?u:"Exception";this.ps.consumeRateLimit(d)?rS.info("Skipping exception capture because of client rate limiting.",{exception:d}):this._instance.exceptions.sendExceptionEvent(c)}}},{productTours:class{constructor(c){this.gs=null,this.bs=null,this._instance=c}onRemoteConfig(c){"productTours"in c&&(this._instance.persistence&&this._instance.persistence.register({[tx]:!!c.productTours}),this.loadIfEnabled())}loadIfEnabled(){var c,u;this.gs||(c=this._instance).config.disable_product_tours||null==(u=c.persistence)||!u.get_property(tx)||this.V(()=>this.ys())}V(c){var u,h;null!=(u=Z.__PosthogExtensions__)&&u.generateProductTours?c():null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,"product-tours",u=>{u?rP.error("Could not load product tours script",u):c()})}ys(){var c;!this.gs&&null!=(c=Z.__PosthogExtensions__)&&c.generateProductTours&&(this.gs=Z.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(c,u){if(void 0===u&&(u=!1),!ec(this.bs)||u){var h=this._instance.persistence;if(h){var d=h.props[rF];if(ec(d)&&!u)return this.bs=d,void c(d,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:u=>{var d=u.statusCode;if(200!==d||!u.json){var v="Product Tours API could not be loaded, status: "+d;return rP.error(v),void c([],{isLoaded:!1,error:v})}var m=ec(u.json.product_tours)?u.json.product_tours:[];this.bs=m,h&&h.register({[rF]:m}),c(m,{isLoaded:!0})}})}else c(this.bs,{isLoaded:!0})}getActiveProductTours(c){j(this.gs)?c([],{isLoaded:!1,error:"Product tours not loaded"}):this.gs.getActiveProductTours(c)}showProductTour(c){var u;
1null==(u=this.gs)||u.showTourById(c)}previewTour(c){this.gs?this.gs.previewTour(c):this.V(()=>{var u;this.ys(),null==(u=this.gs)||u.previewTour(c)})}dismissProductTour(){var c;null==(c=this.gs)||c.dismissTour("user_clicked_skip")}nextStep(){var c;null==(c=this.gs)||c.nextStep()}previousStep(){var c;null==(c=this.gs)||c.previousStep()}clearCache(){var c;this.bs=null,null==(c=this._instance.persistence)||c.unregister(rF)}resetTour(c){var u;null==(u=this.gs)||u.resetTour(c)}resetAllTours(){var c;null==(c=this.gs)||c.resetAllTours()}cancelPendingTour(c){var u;null==(u=this.gs)||u.cancelPendingTour(c)}}},{siteApps:class{constructor(c){this._instance=c,this.ws=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}xs(c,u){if(u){var h=this.globalsForEvent(u);this.ws.push(h),this.ws.length>1e3&&(this.ws=this.ws.slice(10))}}get siteAppLoaders(){var c;return null==(c=Z._POSTHOG_REMOTE_CONFIG)||null==(c=c[this._instance.config.token])?void 0:c.siteApps}init(){if(this.isEnabled){var c=this._instance._addCaptureHook(this.xs.bind(this));this.$s=()=>{c(),this.ws=[],this.$s=void 0}}}globalsForEvent(c){if(!c)throw Error("Event payload is required");var u,h,d,v,m,b,S,k={},T=this._instance.get_property("$groups")||[];for(var[P,C]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))k[P]={id:T[P],type:P,properties:C};var{$set_once:$,$set:G}=c;return{event:_({},g(c,rI),{properties:_({},c.properties,G?{$set:_({},null!==(u=null==(h=c.properties)?void 0:h.$set)&&void 0!==u?u:{},G)}:{},$?{$set_once:_({},null!==(d=null==(v=c.properties)?void 0:v.$set_once)&&void 0!==d?d:{},$)}:{}),elements_chain:null!==(m=null==(b=c.properties)?void 0:b.$elements_chain)&&void 0!==m?m:"",distinct_id:null==(S=c.properties)?void 0:S.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:k}}setupSiteApp(c){var u=this.apps[c.id],e=()=>{var h;!u.errored&&this.ws.length&&(rC.info("Processing "+this.ws.length+" events for site app with id "+c.id),this.ws.forEach(c=>null==u.processEvent?void 0:u.processEvent(c)),u.processedBuffer=!0),Object.values(this.apps).every(c=>c.processedBuffer||c.errored)&&(null==(h=this.$s)||h.call(this))},h=!1,s=d=>{u.errored=!d,u.loaded=!0,rC.info("Site app with id "+c.id+" "+(d?"loaded":"errored")),h&&e()};try{var{processEvent:d}=c.init({posthog:this._instance,callback:c=>{s(c)}});d&&(u.processEvent=d),h=!0}catch(u){rC.error("Error while initializing PostHog app with config id "+c.id,u),s(!1)}if(h&&u.loaded)try{e()}catch(h){rC.error("Error while processing buffered events PostHog app with config id "+c.id,h),u.errored=!0}}Es(){var c=this.siteAppLoaders||[];for(var u of c)this.apps[u.id]={id:u.id,loaded:!1,errored:!1,processedBuffer:!1};for(var h of c)this.setupSiteApp(h)}Ss(c){if(0!==Object.keys(this.apps).length){var u=this.globalsForEvent(c);for(var h of Object.values(this.apps))try{null==h.processEvent||h.processEvent(u)}catch(u){rC.error("Error while processing event "+c.event+" for site app "+h.id,u)}}}onRemoteConfig(c){var u,h,d,v=this;if(null!=(u=this.siteAppLoaders)&&u.length)return this.isEnabled?(this.Es(),void this._instance.on("eventCaptured",c=>this.Ss(c))):void rC.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(h=this.$s)||h.call(this),null!=(d=c.siteApps)&&d.length){if(this.isEnabled){var n=function(c){var u;Z["__$$ph_site_app_"+c]=v._instance,null==(u=Z.__PosthogExtensions__)||null==u.loadSiteApp||u.loadSiteApp(v._instance,b,u=>{if(u)return rC.error("Error while initializing PostHog app with config id "+c,u)})};for(var{id:m,url:b}of c.siteApps)n(m)}else rC.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},{tracingHeaders:class{constructor(c){this.ks=void 0,this.Ps=void 0,this.us=()=>{var c,u;O(this.ks)&&(null==(c=Z.__PosthogExtensions__)||null==(c=c.tracingHeadersPatchFns)||c._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.Ps)&&(null==(u=Z.__PosthogExtensions__)||null==(u=u.tracingHeadersPatchFns)||u._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=c}V(c){var u,h;null!=(u=Z.__PosthogExtensions__)&&u.tracingHeadersPatchFns&&c(),null==(h=Z.__PosthogExtensions__)||null==h.loadExternalDependency||h.loadExternalDependency(this._instance,"tracing-headers",u=>
1{if(u)return rx.error("failed to load script",u);c()})}startIfEnabledOrStop(){var c,u;this._instance.config.__add_tracing_headers?this.V(this.us):(null==(c=this.ks)||c.call(this),null==(u=this.Ps)||u.call(this),this.ks=void 0,this.Ps=void 0)}}});Vn.__defaultExtensionClasses=_({},r$);var rA,rM,rN,rL,rD,rj,rU,rq,rH,rz,rV,rB,rW,rG,rY,rK,rX,rZ,rJ,rQ=(rJ=rl[ru]=new Vn,function(){function i(){i.done||(i.done=!0,rh=!1,Ii(rl,function(c){c._dom_loaded()}))}null!=T&&T.addEventListener?"complete"===T.readyState?i():zi(T,"DOMContentLoaded",i,{capture:!1}):d&&tc.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),rJ)}},function(c){var __webpack_exec__=function(u){return c(c.s=u)};c.O(0,[774,179],function(){return __webpack_exec__(6840),__webpack_exec__(9974)}),_N_E=c.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.