1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20687,67326,e=>{"use strict";var t,i,s,r,n="u">typeof window?window:void 0,a="u">typeof globalThis?globalThis:n,o=null==a?void 0:a.navigator,l=null==a?void 0:a.document,u=null==a?void 0:a.location,h=null==a?void 0:a.fetch,c=null!=a&&a.XMLHttpRequest&&"withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:void 0,d=null==a?void 0:a.AbortController,p=null==a?void 0:a.CompressionStream,v=null==o?void 0:o.userAgent;function g(){return!(!n||!1===n.navigator.onLine)}var f="u">typeof globalThis?globalThis:n;f&&"u"<typeof self&&(f.self=f),f&&"u"<typeof File&&(f.File=function(){});var _=null!=n?n:{},m={DEBUG:!1,LIB_VERSION:"0.7.1",LIB_NAME:"browser-common"};function y(e,t,i,s,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,r)}function b(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){y(n,s,r,a,o,"next",e)}function o(e){y(n,s,r,a,o,"throw",e)}a(void 0)})}}function w(){return(w=Object.assign.bind()).apply(null,arguments)}function x(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var k=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function E(e){return"string"==typeof e||e}function S(e){return"string"==typeof e?e:void 0}var P=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],F=((t_={}).AnonymousId="anonymous_id",t_.DistinctId="distinct_id",t_.Props="props",t_.EnablePersonProcessing="enable_person_processing",t_.PersonMode="person_mode",t_.FeatureFlagDetails="feature_flag_details",t_.FeatureFlags="feature_flags",t_.FeatureFlagPayloads="feature_flag_payloads",t_.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t_.BootstrapFeatureFlags="bootstrap_feature_flags",t_.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t_.OverrideFeatureFlags="override_feature_flags",t_.Queue="queue",t_.AiQueue="ai_queue",t_.AiCaptureQueue="ai_capture_queue",t_.LogsQueue="logs_queue",t_.OptedOut="opted_out",t_.SessionId="session_id",t_.SessionStartTimestamp="session_start_timestamp",t_.SessionLastTimestamp="session_timestamp",t_.PersonProperties="person_properties",t_.GroupProperties="group_properties",t_.InstalledAppBuild="installed_app_build",t_.InstalledAppVersion="installed_app_version",t_.SessionReplay="session_replay",t_.PushRegistered="push_registered",t_.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t_.SurveyLastSeenDate="survey_last_seen_date",t_.SurveysSeen="surveys_seen",t_.Surveys="surveys",t_.RemoteConfig="remote_config",t_.FlagsEndpointWasHit="flags_endpoint_was_hit",t_.DeviceId="device_id",t_),$=((tm={}).GZipJS="gzip-js",tm.Base64="base64",tm),C=["$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"],I=["token"],A="[Truncated]",O="[Unserializable]";function T(e){for(var t="",i=0;e.length>i;i++){var s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{var r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}var M=["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","hub
1spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","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"],R=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return M.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function L(e,t){return -1!==e.indexOf(t)}var D=function(e){return e.trim()},j=function(e){return e.replace(/^\$/,"")};function N(e){var t,i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}var q=Object.prototype,B=q.hasOwnProperty,H=q.toString,z=Array.isArray||function(e){return"[object Array]"===H.call(e)},V=e=>"function"==typeof e,G=e=>e===Object(e)&&!z(e),U=e=>{if(G(e)){for(var t in e)if(B.call(e,t))return!1;return!0}return!1},W=e=>void 0===e,K=e=>"[object String]"==H.call(e),J=e=>K(e)&&0===e.trim().length,Y=e=>null===e,Z=e=>W(e)||Y(e),Q=e=>"[object Number]"==H.call(e)&&e==e,X=e=>Q(e)&&e>0,ee=e=>"[object Boolean]"===H.call(e),et=e=>L(C,e),ei=e=>L(I,e);function es(e){return null===e||"object"!=typeof e}function er(e,t){return({}).toString.call(e)==="[object "+t+"]"}function en(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return eo(e,Error)}}function ea(e){return"u">typeof Event&&eo(e,Event)}function eo(e,t){try{return e instanceof t}catch(e){return!1}}var el=[!0,"true",1,"1","yes"],eu=[!1,"false",0,"0","no"];function eh(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Q(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),eh(r||i,t,i,s))}class ec{constructor(e){this.C={},this.I=e.I,this.R=eh(e.bucketSize,0,100,e.A),this.O=eh(e.refillRate,0,this.R,e.A),this.N=eh(e.refillInterval,0,864e5,e.A)}F(e,t){var i=Math.floor((t-e.lastAccess)/this.N);i>0&&(e.tokens=Math.min(e.tokens+i*this.O,this.R),e.lastAccess=e.lastAccess+i*this.N)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.C[s];return r?this.F(r,i):this.C[s]=r={tokens:this.R,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.I)||t.call(this,e)),0===r.tokens)}stop(){this.C={}}}var ed="Mobile",ep="Android",ev="Tablet",eg=ep+" "+ev,ef="iPad",e_="Apple",em=e_+" Watch",ey="Safari",eb="BlackBerry",ew="Samsung",ex=ew+"Browser",ek=ew+" Internet",eE="Chrome",eS=eE+" OS",eP=eE+" iOS",eF="Internet Explorer",e$=eF+" "+ed,eC="Opera",eI=eC+" Mini",eA="Edge",eO="Microsoft "+eA,eT="Firefox",eM=eT+" iOS",eR="Nintendo",eL="PlayStation",eD="Xbox",ej=ep+" "+ed,eN=ed+" "+ey,eq="Windows",eB=eq+" Phone",eH="Nokia",ez="Ouya",eV="Generic",eG=eV+" "+ed.toLowerCase(),eU=eV+" "+ev.toLowerCase(),eW="Konqueror",eK="Oculus Browser",eJ="Vivaldi",eY="Yandex",eZ="Whale",eQ="DuckDuckGo",eX="Pale Moon",e0="Waterfox",e1="Brave",e2="Claude",e3="Codex",e5="ChatGPT",e6="Google Search App",e8="(\\d+(\\.\\d+)?)",e4=RegExp("Version/"+e8),e7=RegExp("("+e2+"|"+e3+"|"+e5+")\\/"+e8),e9=RegExp(eD,"i"),te=RegExp(eL+" \\w+","i"),tt=RegExp(eR+" \\w+","i"),ti=RegExp(eb+"|PlayBook|BB10","i"),ts={"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"},tr=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e1:null)||(null!=s&&s.detectGoogleSearchApp&&L(e,"GSA/")?e6:L(e," OPR/")&&L(e,"Mini")?eI:L(e," OPR/")?eC:ti.test(e)?eb:L(e,"IE"+ed)||L(e,"WPDesktop")?e$:L(e,"OculusBrowser")?eK:L(e,ex)?ek:L(e,eA)||L(e,"Edg/")?eO:L(e,eJ+"/")?eJ:L(e,"YaBrowser/")?eY:L(e,eZ+"/")?eZ:L(e,eQ+"/")||L(e,"Ddg/")?eQ:L(e,e2+"/")?e2:L(e,e3+"/")?e3:L(e,e5+"/")?e5:L(e,"FBIOS")?"Facebook "+ed:L(e,"UCWEB")||L(e,"UCBrowser")?"UC Browser":L(e,"CriOS")?eP:L(e,"CrMo")||L(e,eE)?eE:L(e,ep)&&L(e,ey)?ej:L(e,"FxiOS")?eM:L(e.toLowerCase(),eW.toLowerCase())?eW:L(e,e1+"/")?e1:(r=t)&&L(r,e_)||L(e,ey)&&!L(e,eE)&&!L(e,ep)?L(e,ed)?eN:ey:L(e,"PaleMoon/")?eX:L(e,e0+"/")?e0:L(e,eT)?eT:L(e,"MSIE")||L(e,"Trident/")?eF:L(e,"Gecko")?eT:"")},tn={[e$]:[RegExp("rv:"+e8)],[eO]:[RegExp(eA+"?\\/"+e8)],[eE]:[RegExp("("+eE+"|CrMo)\\/"+e8)],[eP]:[RegExp("CriOS\\/"+e8)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e8)],[ey]:[e4],[eN]:[e4],[eC]:[RegExp("(Opera|OPR)\\/"+e8)],[eT]:[RegExp(eT+"\\/"+e8)],[eM]:[RegExp("FxiOS\\/"+e8)],[eW]:[RegExp("Konqueror[:/]?"+e8,"i")],[eb]:[RegExp(eb+" "+e8),e4],[ej]:[RegExp("android\\s"+e8,"i")],[ek]:[RegExp(ex+"\\/"+e8)],[eK]:[RegExp("OculusBrowser\\/"+e8)],[eJ]:[RegExp(eJ+"\\/"+e8)],[eY]:[RegExp("YaBrowser\\/"+e8)],[eZ]:[RegExp(eZ+"\\/"+e8)],[e1]:[RegExp(e1+"\\/"+e8)],[e2]:[e7],[e3]:[e7],[e5]:[e7],[eQ]:[RegExp("(DuckDuckGo|Ddg)\\/"+e8)],[eX]:[RegExp("PaleMoon\\/"+e8)],[e0]:[RegExp(e0+"\\/"+e8)],[e6]:[RegExp("GSA\\/"+e8)],[eF]:[RegExp("(rv:|MSIE )"+e8)],Mozilla:[RegExp("rv:"+e8)]},ta=function(e,t,i,s){var r=tn[tr(e,t,i,s)];if(W(r))return null;for(var n=0;r.length>n;n++){var a=e.match(r[n]);if(a)return parseFloat(a[a.length-2])}return null},to=[[RegExp(eD+"; "+eD+" (.*?)[);]","i"),e=>[eD,e&&e[1]||""]],[RegExp(eR,"i"),[eR,""]],[RegExp(eL,"i"),[eL,""]],[ti,[eb,""]],[RegExp(eq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eB,""];if(new RegExp(ed).test(t)&&!/IEMobile\b/.test(t))return[eq+" "+ed,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=ts[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eq,s]}return[eq,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=W(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ep+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ep+")","i"),e=>e&&e[2]?[ep,[e[2],e[3],e[4]||"0"].join(".")]:[ep,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eS,""]],[/Linux|debian/i,["Linux",""]]],tl=function(e){for(var t=0;to.length>t;t++){var i=to[t],s=i[1],r=i[0].exec(e),n=r&&(V(s)?s(r,e):s);if(n)return n}return["",""]},tu=function(e){return tt.test(e)?eR:te.test(e)?eL:e9.test(e)?eD:RegExp(ez,"i").test(e)?ez:RegExp("("+eB+"|WPDesktop)","i").test(e)?eB:/iPad/.test(e)?ef:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?em:ti.test(e)?eb:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eH,"i").test(e)?eH:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ed).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ep:eg:RegExp("(pda|"+ed+")","i").test(e)?eG:RegExp(ev,"i").test(e)&&!RegExp(ev+" pc","i").test(e)?eU:""},th=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tc(e,t){return"string"==typeof e&&th.test(e)?e:t()}function td(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function tp(e){return e?e.split("#")[0]:e}function tv(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function tg(e,t,i){return tf.apply(this,arguments)}function tf(){return(tf=b(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tv(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var t_,tm,ty,tb,tw="NativeGzipValidationError",tx=e=>e.length>=2&&31===e[0]&&139===e[1],tk=(e,t)=>e===$.GZipJS||t===$.GZipJS||"gzip"===t,tE=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),tS=e=>
1{throw td(tw,"Native gzip produced invalid output: "+e)},tP=(ty=b(function*(e,t){18>e.size&&tS("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));tx(i)&&8===i[2]||tS("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(tb)return tb;tb=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;tb[e]=t>>>0}return tb})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&tS("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&tS("invalid-size")}),function(e,t){return ty.apply(this,arguments)});function tF(){return(tF=b(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=b(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield tP(u,r),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var t$={}.propertyIsEnumerable;function tC(e,t){try{return tI(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function tI(e,t,i,s){var r=[];for(var n in e)if(t$.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=e[n];if(Y(a)||W(a))continue;r.push({key:T(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:A};if(s.remainingNodes--,ee(t))return{boolValue:t};if("bigint"==typeof t){var n,a;return n=t.toString(),t>=(a=BigInt("9223372036854775808"))||-a>t?(null==i||i.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if("u"<typeof BigInt)return{stringValue:String(t)};var o=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug("Attribute "+o+" is outside the int64 range; encoding it as a string"),{stringValue:o}):{intValue:o}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:T(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(s.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:A};if(t instanceof Date){var l=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof l?T(l):String(l)}}s.ancestors.add(t);try{try{var u=t.toJSON;if("function"==typeof u)return e(u.call(t),i,s,r+1)}catch(e){}return z(t)?{arrayValue:{values:function(t,i,s,r){for(var n=[],a=Math.min(t.length,1e3),o=0;a>o&&s.remainingNodes>0;o++)try{var l=o in t?t[o]:void 0;if(Z(l))continue;n.push(e(l,i,s,r))}catch(e){n.push({stringValue:O})}return t.length>o&&n.push({stringValue:A}),n}(t,i,s,r+1)}}:{kvlistValue:{values:tI(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:T(String(t))}}(a,t,i,s)})}catch(e){r.push({key:T(n),value:{stringValue:O}})}}return r}function tA(e,t,i){return w({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}var tO={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},tT={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},tM=tT.info;function tR(e,t,i,s){return{resourceLogs:[{resource:{attributes:tC(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tL=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.gn=t,this.A=i,this.Pn=s,this.Fn=r,this.Dn=n,this.$n=a,this.Nn=null,this.qn=0,this.jn=0,this.Bn=0,this.Hn=0,this.zn=0,this.Un=!1,this.Wn=t.maxBufferSize,this.Vn=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.Gn=t.flushIntervalMs,this.Zn=t.maxBatchRecordsPerPost,this.Qn=t.rateCapWindowMs,this.Jn=t.maxLogsPerInterval}clearQueue(){this.jn++,this._instance.setPersistedProperty(F.LogsQueue,[])}reset(){this.Kn(),this.Hn=0,this.zn=0,this.Un=!1,this.Bn=0,this.Zn=this.gn.maxBatchRecordsPerPost}onReconnect(){this.Bn=0,this.Yn()}captureLog(e,t){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var s=this.Xn(e);if(null!==s)if(s.body){if(this.ts()){var r={record:function(e,t,i,s){var r,n=tT[e.level||"info"]||tM,a=n.text,o=n.number,l=(void 0===(r=Q(s)?s:void 0)&&(r=Date.now()),String(r)+"000000"),u={};t.distinctId&&(u.posthogDistinctId=t.distinctId),t.sessionId&&(u.sessionId=t.sessionId),t.windowId&&(u["window.id"]=t.windowId),Z(t.sessionStartTimestamp)||(u.sessionStartTimestamp=String(t.sessionStartTimestamp)),Z(t.lastActivityTimestamp)||(u.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(u["url.full"]=t.currentUrl),t.screenName&&(u["screen.name"]=t.screenName),t.appState&&(u["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(u.feature_flags=t.activeFeatureFlags);var h=w({},u),c=e.attributes;if(c){var d=[];try{d=Object.keys(c)}catch(e){d=[]}for(var p of d){var v=void 0;try{v=c[p]}catch(e){v=O}Object.defineProperty(h,p,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:function(e){try{return T(String(e))}catch(e){return O}}(e.body)},attributes:tC(h,i)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),W(e.trace_flags)||(g.flags=e.trace_flags),g}(s,null!=(i=null==t?void 0:t.context)?i:this.Pn(),this.A,null==t?void 0:t.occurredAtMs)};this.Fn(()=>this.es(r))}}else this.A.info("Log was rejected in beforeSend function")}}Xn(e){var t=this.gn.beforeSend;if(!t)return e;var i=z(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for log:",e),null}return s}ts(){if(void 0===this.Jn)return!0;var e=Date.now(),t=e-this.Hn;return this.Qn>t&&t>=0||(this.Hn=e,this.zn=0,this.Un=!1),this.Jn>this.zn?(this.zn++,!0):(this.Un||(this.A.warn("captureLog dropping logs: exceeded "+this.Jn+" logs per "+this.Qn+"ms"),this.Un=!0),!1)}flush(){var e=this;return b(function*(){if(!e._instance.isDisabled)return e.Nn||(e.Nn=e.rs().finally(()=>{e.Nn=null})),e.Nn})()}rs(){var e=this;return b(function*(){e.Kn();var t=null!=(r=e._instance.getPersistedProperty(F.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){var r,n,a,o=e.jn;e.qn=0;var l=Math.min(t.length,e.Zn),u=t.slice(0,l),h=tR(u.map(e=>e.record),e.ns(),null!=(n=e.$n)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.ss(h);if(e.jn!==o)return;if("too-large"===c.kind&&u.length>1)e.Zn=Math.max(1,Math.floor(u.length/2)),e.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+e.Zn);else if("retry-later"===c.kind||("too-large"===c.kind?e.A.warn("Dropping a single log record after 413 with batch size 1 â the record
1is larger than the server cap and cannot be split further."):"ok"===c.kind&&e.gn.maxBatchRecordsPerPost>e.Zn&&(e.Zn=Math.min(e.gn.maxBatchRecordsPerPost,e.Zn+1)),yield e.os(u.length),t=null!=(a=e._instance.getPersistedProperty(F.LogsQueue))?a:[],s+=u.length,"fatal"===c.kind))throw c.error}})()}os(e){var t=this;return b(function*(){var i,s=Math.max(0,e-t.qn),r=null!=(i=t._instance.getPersistedProperty(F.LogsQueue))?i:[];t._instance.setPersistedProperty(F.LogsQueue,r.slice(s)),yield t.Dn()})()}ns(){var e;return e=this.gn,tA(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}es(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(F.LogsQueue))?t:[];this.Vn>i.length||(i.shift(),this.qn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(F.LogsQueue,i),this.Wn>i.length?this.ls():this.Yn()}}ls(e){void 0===e&&(e=this.Gn),this.us||(this.us=tv(()=>{this.us=void 0,this.Yn()},e))}hs(){var e=Math.min(Math.max(0,this.Bn-1),6);return this.Gn*Math.pow(2,e)}ds(){var e=this._instance.getPersistedProperty(F.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return b(function*(){t.Kn();var i=t.flush().catch(()=>{});void 0!==e?yield tg(i,e):yield i})()}flushWithTimeout(e){var t=this;return b(function*(){var i=t.flush();yield tg(i,e,()=>{i.catch(()=>{})})})()}Yn(){this.flush().then(()=>{this.Bn=0},e=>{this.Bn++,this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.ds()&&this.ls(this.hs())})}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}};var tD=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tj(e){return String(e)+"000000"}function tN(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}let tq=class{constructor(e,t,i){this._instance=e,this.gn=t,this.A=i,this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set,this.gs=0}count(e,t,i){void 0===t&&(t=1),this.ys({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.ys({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.ys({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.Nn,s=(e=b(function*(){i&&(yield i.catch(()=>{})),yield t.bs()}),function(){return e.apply(this,arguments)})().finally(()=>{this.Nn===s&&(this.Nn=null)});return this.Nn=s,s}drainWindow(){if(0===this.vs.size)return null;var e=this.vs;return this.vs=new Map,this.cs=!1,this.fs=new Map,this.ps=new Set,this._s(e)}reset(){this.gs++,this.Kn(),this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set}ys(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Xn(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.A.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?w({},t.attributes):void 0,s=tN(t.type,t.name,t.unit,i)}catch(e){return void this.A.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.vs.get(s);if(!r){if(!this.ws())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.vs.set(s,r)}var n=this.fs.get(t.name);void 0===n?this.fs.set(t.name,t.type):n===t.type||this.ps.has(t.name)||(this.ps.add(t.name),this.A.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.ks(r,t.value),this.ls()}else this.A.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}ws(){return this.gn.maxSeriesPerFlush>this.vs.size||(this.cs||(this.cs=!0,this.A.warn("Metric series cap reached ("+this.gn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}ks(e,t){var i;switch(e.type){case"count":e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(tD.length+1).fill(0)});var s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tD)]+=1}}Xn(e){var t=this.gn.beforeSend;if(!t)return e;var i=z(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for metric:",e),null}return s}ls(){this.us||(this.us=tv(()=>{this.us=void 0,this.flush().catch(e=>{this.A.error("Metrics flush failed:",e)})},this.gn.flushIntervalMs))}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}bs(){var e=this;return b(function*(){if(0!==e.vs.size){var t=e.vs;e.vs=new Map,e.cs=!1,e.fs=new Map,e.ps=new Set;var i=e.gs,s=yield e._instance.Ss(e._s(t));if(i===e.gs)switch(s.kind){case"ok":return;case"retry-later":return e.xs(t),void e.ls();case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}}})()}_s(e){var t,i,s,r;return t=this.Cs(e),i=tA(this.gn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tC(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}Cs(e){var t=tj(Date.now()),i=new Map;for(var s of e.values()){var r,n=tN(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=w({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=tC(null!=(r=s.attributes)?r:{},this.A),l=tj(s.windowStartMs);if("count"===s.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=s.total)?u:0};a.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!=(c=s.last)?c:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:tD})}return Array.from(i.values())}xs(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.vs.get(r);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!=(t=a.total)?t:0)+(null!=(i=n.total)?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.ws()&&this.vs.set(r,n)}}};class tB{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return b(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&z(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),w({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return b(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,w({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sL&&i.length===sR||(sR=i.length,sL=i.reduce((i,s)=>{sM||(sM={});var r=sM[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,sM[s]=[l,u];break}}return i},{})),sL}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return w({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tH(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return W(s)||(n.lineno=s),W(r)||(n.colno=r),n}var tz=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tV=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tG=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tU=/\((\S*)(?::(\d+))(?::(\d+))\)/,tW=(e,t)=>{var i=tV.exec(e);if(i)return tH(t,i[1],"?",+i[2],+i[3]);var s=tG.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tU.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tz(s[1]||"?",s[2]);return tH(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tK=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tJ=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tY=(e,t)=>
1{var i=tK.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tJ.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?",a=tz(n,r);return tH(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tZ=/\(error: (.*)\)/;class tQ{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=K(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return er(e,"DOMException")}isDOMError(e){return er(e,"DOMError")}}class tX{match(e){return en(e)}coerce(e,t){var i,s=this.getStack(e);return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:void 0===s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class t0{match(e){return!!er(e,"ErrorEvent")&&(null!=e.error||this.Wi(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return w({},s,{stack:null!=(i=this.Vi(e))?i:s.stack,synthetic:!0})}Wi(e){return K(e.message)&&e.message.length>0}Vi(e){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(K(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n at "+e.filename+":"+s+":"+r}}var t1=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class t2{match(e){return"string"==typeof e}coerce(e,t){var i,s=this.getInfos(e),r=s[0],n=s[1];return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(t1);return s&&(t=s[1],i=s[2]),[t,i]}}var t3=["fatal","error","warning","log","info","debug"];function t5(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class t6{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(ea(e))return e.constructor.name;var t="name"in e?e.name:void 0;return K(t)&&!J(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+t5(e)}isSeverityLevel(e){return K(e)&&!J(e)&&t3.indexOf(e)>=0}getStack(e){try{return K(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:K(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(en(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class t8{match(e){return ea(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+t5(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class t4{match(e){return es(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class t7{match(e){return er(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ea(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return es(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var t9="$message",ie="$timestamp",it=new Set([t9,ie]),ii={enabled:!0,max_bytes:32768};function is(e){var t;return e?{enabled:null!=(t=e.enabled)?t:ii.enabled,max_bytes:function(e,t){if(!Q(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,ii.max_bytes)}:w({},ii)}class ir{constructor(e){this.Ts=[],this.Ms=0,this.gn=is(e)}setConfig(e){this.gn=is(e),this.Es()}add(e){var t=function(e){var t;try{t=N(e)}catch(e){return}try{var i=JSON.parse(t);if(!G(i))return;var s=i[t9],r=i[ie];
1if(!K(s)||0===s.trim().length||!K(r)&&!Q(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this.gn.max_bytes||(this.Ts.push({step:t.step,bytes:i}),this.Ms+=i,this.Es())}}getAttachable(){return this.Ts.map(e=>e.step)}clear(){this.Ts=[],this.Ms=0}size(){return this.Ts.length}Es(){for(;this.Ms>this.gn.max_bytes&&this.Ts.length>0;){var e=this.Ts.shift();e&&(this.Ms-=e.bytes)}}}var ia=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={q(t){if(n&&(m.DEBUG||n.POSTHOG_DEBUG||i)&&!W(n.console)&&n.console){for(var s=("__rrweb_original__"in n.console[t])?n.console[t].__rrweb_original__:n.console[t],r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ia(e+" "+t,i)};return s},io=ia("[PostHog.js]"),il=io.createLogger,iu=il("[ExternalScriptsLoader]"),ih=e=>{var t=null==l?void 0:l.querySelectorAll("script");if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},ic=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return iu.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=ih(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!l)return i("document not found");if(ih(t))return ic(e,t,i);var s=l.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)l.head.appendChild(s);else{var r,n=l.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):l.body.appendChild(s)}};null!=l&&l.body?n():null==l||l.addEventListener("DOMContentLoaded",n)},id={},ip=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=id[r];if("fallback"===s&&n){if(ih(n))return void ic(e,n,i);delete id[r]}ic(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=ip(e,t);id[r]=o;var l=ih(r);null==l||null==(a=l.parentNode)||a.removeChild(l),ic(e,o,i)}else i(void 0,n)}:i)}else ic(e,ip(e,t),i)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");ic(e,a,i)}},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);ic(e,s,i)},m.DEBUG=!1,m.LIB_VERSION="1.424.1",m.LIB_NAME="web";var iv="$people_distinct_id",ig="distinct_id",i_="$device_id",im="$device_model",iy="__alias",ib="__timers",iw="$autocapture_disabled_server_side",ix="$heatmaps_enabled_server_side",ik="$exception_capture_enabled_server_side",iE="$error_tracking_suppression_rules",iS="$error_tracking_capture_extension_exceptions",iP="$web_vitals_enabled_server_side",iF="$dead_clicks_enabled_server_side",i$="$product_tours_enabled_server_side",iC="$logs_capture_enabled_server_side",iI="$web_vitals_allowed_metrics",iA="$session_recording_remote_config",iO="$replay_sample_rate",iT="$replay_override_sampling",iM="$replay_override_linked_flag",iR="$replay_override_url_trigger",iL="$replay_override_event_trigger",iD="$sesid",ij="$session_is_sampled",iN="$enabled_feature_flags",iq="$active_feature_flags",iB="$early_access_features",iH="$feature_flag_details",iz="$feature_flag_payloads",iV="$feature_flag_request_id",iG="$minimal_flag_called_events",iU="$override_feature_flags",iW="$override_feature_flag_payloads",iK="$stored_person_properties",iJ="$stored_group_properties",iY="$groups",iZ="$surveys",iQ="$surveys_loaded_at",iX="$surveys_activated",i0="$surveys_activated_session",i1="$surveys_activated_timestamps",i2="ph_product_tours",i3="$flag_call_reported",i5="$flag_call_reported_session_id",i6="$feature_flag_errors",i8="$feature_flag_evaluated_at",i4="$user_state",i7="$client_session_props",i9="$capture_rate_limit",se="$initial_campaign_params",st="$initial_referrer_info",si="$initial_person_info",ss="$epp",sr="$posthog_cookieless",sn="$cookieless_mode",sa="$sdk_debug_extensions_init_method",so="$sdk_debug_extensions_init_time_ms",sl="$sdk_debug_recording_script_not_loaded",su="PostHog loadExternalDependency extension not found.",sh="on_reject",sc="always",sd="anonymous",sp="identified",sv="identified_only",sg="visibilitychange",sf="beforeunload",s_="$pageview",sm="$pageleave",sy="$identify",sb="$groupidentify";function sw(e,t){z(e)&&e.forEach(t)}function sx(e,t){if(!Z(e))if(z(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)B.call(e,i)&&t(e[i],i)}var sk=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function sE(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sS=function(e){try{return e()}catch(e){return}},sP=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){io.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),io.critical(e)}}},sF=function(e){var t={};return sx(e,function(e,i){(K(e)&&e.length>0||Q(e))&&(t[i]=e)}),t},s$=["herokuapp.com","vercel.app","netlify.app"];function sC(e,t,i,s){var r=null!=s?s:{},n=r.capture,a=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function sI(e){return"ph_toolbar_internal"===e.name}var sA=e=>{if(l){try{for(var t=e+"=",i=l.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Q(e)&&isFinite(e)&&Math.floor(e)===e});class sO{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
1var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new sO(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new sO(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class sT{generate(){var e=this.generateOrAbort();if(!W(e))return e;this.Yr=0;var t=this.generateOrAbort();if(W(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Yr)this.Yr=e,this.Kr();else{if(this.Yr>=e+1e4)return;this.Xr++,this.Xr>0x3ffffffffff&&(this.Yr++,this.Kr())}return sO.fromFieldsV7(this.Yr,Math.trunc(this.Xr/0x40000000),0x3fffffff&this.Xr,this.ei.nextUint32())}Kr(){this.Xr=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Yr=0,this.Xr=0,this.ei=new sN}}var sM,sR,sL,sD,sj=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};n&&!W(n.crypto)&&crypto.getRandomValues&&(sj=e=>crypto.getRandomValues(e));class sN{nextUint32(){return this.Dt.length>this.ti||(sj(this.Dt),this.ti=0),this.Dt[this.ti++]}constructor(){this.Dt=new Uint32Array(8),this.ti=1/0}}var sq=()=>sB().toString(),sB=()=>(sD||(sD=new sT)).generate(),sH="",sz=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sV=null,sG={ri(){if(!Y(sV))return sV;if(sV=!1,l)try{var e="__ph_cookie_support_"+sq();sG.ii(e,"xyz"),sV='"xyz"'===sA(e),sG.ai(e)}catch(e){sV=!1}return sV},oi(e){io.error("cookieStore error: "+e)},ni:sA,si(e){var t;try{t=JSON.parse(sG.ni(e))||{}}catch(e){}return t},ii(e,t,i,s,r){if(!l)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),sH)return sH;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sq();!sH&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",sH=n)}return sH}(e);if(!i){var s,r=(s=e.match(sz))?s[0]:"";r!==i&&io.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(l.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return h.length>3686.4&&io.warn("cookieStore warning: large cookie, len="+h.length),l.cookie=h,!0}catch(e){return!1}},ai(e,t){if(null!=l&&l.cookie)try{sG.ii(e,"",-1,t)}catch(e){return}}},sU=null,sW={ri(){if(!Y(sU))return sU;var e=!0;if(W(n))e=!1;else try{var t="__mplssupport__";sW.ii(t,"xyz"),'"xyz"'!==sW.ni(t)&&(e=!1),sW.ai(t)}catch(t){e=!1}return e||io.error("localStorage unsupported; falling back to cookie store"),sU=e,e},oi(e){io.error("localStorage error: "+e)},ni(e){try{return null==n?void 0:n.localStorage.getItem(e)}catch(e){sW.oi(e)}return null},si(e){try{return JSON.parse(sW.ni(e))||{}}catch(e){}return null},ii(e,t){try{return null==n||n.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sW.oi(e)}return!1},ai(e){try{null==n||n.localStorage.removeItem(e)}catch(e){sW.oi(e)}}},sK=[iK,iq,iN,iH,iz,iV,i8,i6,i3],sJ=[i_,ig,iD,ij,ss,si,i4],sY=["__proto__","constructor","prototype"],sZ=e=>{if(!G(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sY.indexOf(i)&&(t[i]=e[i])}),t},sQ=function(e,t){void 0===t&&(t=[]);var i={};return[...sJ,...t].forEach(t=>{var s=e[t];W(s)||Y(s)||""===s||(i[t]=s)}),i},sX=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},s0=(e,t)=>({p:t,f:sX(JSON.stringify(e))}),s1=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sG.si(e+"_cpm"),s=(null==i?void 0:i.f)===sX(t)&&z(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},s2=(e,t)=>
1t+"|"+(sG.ni(e+"_cpm")||""),s3={},s5={ri:()=>!0,oi(e){io.error("memoryStorage error: "+e)},ni:e=>e in s3?s3[e]:null,si:e=>e in s3?s3[e]:null,ii:(e,t)=>(s3[e]=t,!0),ai(e){delete s3[e]}},s6=null,s8={ri(){if(!Y(s6))return s6;if(s6=!0,W(n))s6=!1;else try{var e="__support__";s8.ii(e,"xyz"),'"xyz"'!==s8.ni(e)&&(s6=!1),s8.ai(e)}catch(e){s6=!1}return s6},oi(e){io.error("sessionStorage error: ",e)},ni(e){try{return null==n?void 0:n.sessionStorage.getItem(e)}catch(e){s8.oi(e)}return null},si(e){try{return JSON.parse(s8.ni(e))||null}catch(e){}return null},ii(e,t){try{return null==n||n.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){s8.oi(e)}return!1},ai(e){try{null==n||n.sessionStorage.removeItem(e)}catch(e){s8.oi(e)}}};class s4{constructor(e){this._instance=e}get gn(){return this._instance.config}get consent(){return this.Ws()?0:this.Vs}isOptedOut(){return this.gn.cookieless_mode===sc||this.isRejected()||-1===this.consent&&this.gn.cookieless_mode===sh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.gn.opt_out_capturing_by_default}optInOut(e){this.Gs.ii(this.Zs,+!!e,this.gn.cookie_expiration,this.gn.cross_subdomain_cookie,this.gn.secure_cookie)}reset(){this.Gs.ai(this.Zs,this.gn.cross_subdomain_cookie)}get Zs(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get Vs(){var e=this.Gs.ni(this.Zs);return L(el,e)?1:L(eu,e)?0:-1}get Gs(){var e=this.gn.opt_out_capturing_persistence_type,t="localStorage"===e?sW:sG,i=t.ri()?t:s5;if(!this.Qs||this.Qs!==i){this.Qs=i;var s="localStorage"===e?sG:sW;s.ni(this.Zs)&&(this.Qs.ni(this.Zs)||this.optInOut(L(el,s.ni(this.Zs))),s.ai(this.Zs,this.gn.cross_subdomain_cookie))}return this.Qs}Ws(){return!!this.gn.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,_.doNotTrack,null==o?void 0:o.globalPrivacyControl].some(e=>L(el,e))}}function s7(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!V(s))return t;try{var r=s(t);return K(r)&&r?r:t}catch(e){return io.error("Error in get_current_url, falling back to window.location.href",e),t}}var s9="__POSTHOG_TOOLBAR__";function re(e){return e instanceof Element&&(e.id===s9||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rt(e){return!!e&&1===e.nodeType}function ri(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rs(e){return!!e&&3===e.nodeType}function rr(e){return!!e&&11===e.nodeType&&rt(e.host)}function rn(e){return e?D(e).split(/\s+/):[]}function ra(e,t){var i,s,r=W(s=null==n||null==(i=n.location)?void 0:i.href)?void 0:s7(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function ro(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return rn(t)}function rl(e){return Z(e)?null:D(e).split(/(\s+)/).filter(e=>rA(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ru(e){var t="";return rk(e)&&!rE(e)&&e.childNodes&&e.childNodes.length&&sx(e.childNodes,function(e){var i;rs(e)&&e.textContent&&(t+=null!=(i=rl(e.textContent))?i:"")}),D(t)}function rh(e){var t;return W(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rc=["a","button","form","input","select","textarea","label"];function rd(e,t){if(W(t))return!0;var i,s=function(e){if(t.some(t=>(function(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rp(e){var t=e.parentNode;return!(!t||!rt(t))&&t}var rv=[".ph-no-autocapture","[data-ph-no-autocapture]"],rg=["next","previous","prev",">","<"],rf=[...rg,"+","-","â","â"],r_=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rm=[".ph-no-rageclick",".ph-no-capture"],ry=["","text","search","email","password","url","tel","number"];function rb(e,t){if(!n||rw(e)||(ee(t)?(s=!!t&&rm,r=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:rm,r=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(i=e)||!rt(i))&&(ri(i,"textarea")||(ri(i,"input")?L(ry,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,s,r,a,o,l,u=rx(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||W(e))return!1;if(!0===e)i=rg;else{if(!z(e))return!1;if(e.length>10)return io.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,s=e.ariaLabel;return i.some(e=>r_(t,e)||r_(s,e))})}(r,u.map(e=>{var t;return{safeText:ru(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rd(u,s)}var rw=e=>!e||ri(e,"html")||!rt(e),rx=(e,t)=>{if(!n||rw(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!ri(r,"body");)if(rr(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var a=rp(r);if(!a)break;if(t||rc.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=n.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),r=a}return{parentIsUsefulElement:i,targetElementList:s}};function rk(e){for(var t=new Set,i=0,s=e;s.parentNode&&!ri(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=ro(s);if(L(r,"ph-sensitive")||L(r,"ph-no-capture"))return!1}if(L(ro(e),"ph-include"))return!0;var n=e.type||"";if(K(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var a=e.name||e.id||"";return!K(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function rE(e){return!!(ri(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ri(e,"select")||ri(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rS=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),rP=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rF=[16,15,14,13],r$=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rC=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rI=/[0-9A-Za-z_]/;function rA(e,t){return void 0===t&&(t=!0),!(Z(e)||K(e)&&(e=D(e),(t?rS.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(rP.lastIndex=0;t=rP.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of rF){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rS.test(o)&&function(e){for(var t=0,i=!1,s=e.length-1;s>=0;s--){var r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(o))return!0}}}return!1}(e))||(t?r$.test(e):function(e){var t;for(rC.lastIndex=0;t=rC.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rI.test(i)&&rI.test(s)))return!0}return!1}(e))))&&!0}function rO(e){var t=ru(e);return rA(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sx(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=ru(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){io.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rT(e){return e.replace(/"|\\"/g,'\\"')}var rM=il("[Dead Clicks]"),rR=()=>!0,rL=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(iF)),s=e.instance.config.capture_dead_clicks;return ee(s)?s:!!G(s)||i};class rD{get lazyLoadedDeadClicksAutocapture(){return this.Js}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[iF]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ks(()=>{this.Ys()}):this.stop()}Ks(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rM.error("failed to load script",t):e()})}Ys(){var e;if(l){if(!this.Js&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=G(this.instance.config.capture_dead_clicks)?w({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Js=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Js.start(l),rM.info("starting...")}}else rM.error("`document` not found. Cannot start.")}stop(){this.Js&&(this.Js.stop(),this.Js=void 0,rM.info("stopping..."))}}var rj=il("[SegmentIntegration]"),rN="posthog-js";function rq(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var a,l,h,c,d,p,v=(null==(a=t.exception)?void 0:a.values)||[],g=v.map(e=>w({},e,{stacktrace:e.stacktrace?w({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>w({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(h=v[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class rB{constructor(e,t,i,s,r,n){this.name=rN,this.setupOnce=function(a){a(rq(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rH{constructor(e){this.Xs=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(io.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.ta=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ea()}ea(){var e;this.ia=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Xs)}destroy(){var e;null==(e=this.ia)||e.call(this),this.ia=void 0}doPageView(e,t){var i,s=this.ra(e,t);return this.ta={pathname:null!=(i=null==n?void 0:n.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.ra(e,null==(t=this.ta)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ta)?void 0:e.pageViewId}}ra(e,t){var i=this.ta;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,a=r.lastScrollY,o=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(W(n)||W(a)||W(o)||W(l)||W(u)||W(h))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?eh(a/n,0,1,io):1,d=n>1?eh(o/n,0,1,io):1,p=l>1?eh(u/l,0,1,io):1,v=l>1?eh(h/l,0,1,io):1;s=sk(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var rz=["flags","surveys"],rV={[iv]:{exposure:"hidden"},[iy]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ib]:{exposure:"hidden"},[iw]:{exposure:"event"},[ix]:{exposure:"hidden"},[iC]:{exposure:"hidden"},[ik]:{exposure:"event"},[iE]:{exposure:"hidden"},[iS]:{exposure:"event"},[iP]:{exposure:"event"}
1,[iF]:{exposure:"event"},[i$]:{exposure:"hidden"},[iI]:{exposure:"event"},[iA]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iD]:{exposure:"hidden"},[ij]:{exposure:"event"},[iO]:{exposure:"event",shouldSkipFromEventProperties:e=>Y(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[iN]:{exposure:"hidden",storageGroup:"flags"},[iq]:{exposure:"hidden",storageGroup:"flags"},[iB]:{exposure:"hidden"},[iH]:{exposure:"hidden",storageGroup:"flags"},[iz]:{exposure:"hidden",storageGroup:"flags"},[iV]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iG]:{exposure:"hidden",storageGroup:"flags"},[iU]:{exposure:"hidden"},[iW]:{exposure:"hidden"},[iK]:{exposure:"hidden"},[iJ]:{exposure:"hidden"},[iZ]:{exposure:"hidden",storageGroup:"surveys"},[iQ]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iX]:{exposure:"event"},[i0]:{exposure:"hidden"},[i1]:{exposure:"hidden"},[i2]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[i3]:{exposure:"hidden"},[i5]:{exposure:"hidden"},[iY]:{exposure:"event"},[i6]:{exposure:"hidden"},[i8]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[i4]:{exposure:"hidden"},[i7]:{exposure:"hidden"},[i9]:{exposure:"hidden"},[se]:{exposure:"hidden"},[st]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ss]:{exposure:"hidden"},[iT]:{exposure:"event"},[iM]:{exposure:"event"},[iR]:{exposure:"event"},[iL]:{exposure:"event"},[sa]:{exposure:"event"},[so]:{exposure:"event"},[sl]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rG=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rU=e=>{var t=rV[e];if(t)return t;for(var i of rG){var s=i[1];if(0===e.indexOf(i[0]))return s}},rW=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return N(e)}},rK=e=>{var t=null==l?void 0:l.createElement("a");return W(t)?null:(t.href=e,t)},rJ=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!z(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){io.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rY=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");z(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},rZ=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rQ=(e,t)=>e>=t&&g(),rX=(e,t,i,s)=>{if(0===e){if(g()){var r=t+1;return r===i&&s(),r}return t}return 0},r0="https?://(.*)",r1=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r2=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...r1],r3="<masked>",r5=["li_fat_id"];function r6(e,t,i){if(!l)return{};var s,r=t?[...r1,...i||[]]:[],n=r8(rY(l.URL,r,r3),e);return sk((s={},sx(r5,function(e){var t=sA(e);s[e]=t||null}),s),n)}function r8(e,t){var i=r2.concat(t||[]),s={};return sx(i,function(t){var i=rJ(e,t);s[t]=i||null}),s}function r4(e){var t=e?0===e.search(r0+"google.([^/?]*)")?"google":0===e.search(r0+"bing.com")?"bing":0===e.search(r0+"yahoo.com")?"yahoo":0===e.search(r0+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!Y(t)){i.$search_engine=t;var s=l?rJ(l.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function r7(){return navigator.language||navigator.userLanguage}var r9="$direct";function ne(){return(null==l?void 0:l.referrer)||r9}function nt(e,t,i){void 0===i&&(i=!1);var s=e?[...r1,...t||[]]:[],r=i?tp(null==u?void 0:u.href):null==u?void 0:u.href,n=null==r?void 0:r.substring(0,1e3);return{r:ne().substring(0,1e3),u:n?rY(n,s,r3):void 0}}function ni(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tp(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==r9?r9:null==(i=rK(s))?void 0:i.host};
vendor: 4,078 bytes, line 1
1if(n){a.$current_url=n;var o=rK(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,sk(a,r8(n))}return s&&sk(a,r4(s)),a}function ns(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var nr={flags:i8,surveys:iQ},nn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],na="main",no=[iN,iq,iH,iz,iV,i8,iG,iK],nl=e=>-1!==no.indexOf(e),nu=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},nh=e=>{if(!e)return{};var t=JSON.parse(e);return G(t)?t:{}},nc=(e,t)=>{sx(e,(i,s)=>{var r=rU(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};class nd{constructor(e,t,i){if(void 0===i&&(i=!0),this.na={},this.sa=!1,this.aa=!1,this.oa=!1,this.la=!1,this.ua=new Map,this.ha=!1,this.da=!1,this.va=!1,this.ca=new Set,this.gn=e,this.fa=i,this.props={},this.pa=void 0,this.ga=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Gs=this.ma(e),this.aa=this.ya(e),this.load(),this.ba(),e.debug&&io.info("Persistence loaded",e.persistence,w({},this.props)),this.update_config(e,e,t),this.save(),n){var s=()=>this.flush();sC(n,"beforeunload",s,{capture:!1}),sC(n,"pagehide",s,{capture:!1}),this._a=e=>{if(this.sa&&(!e.storageArea||e.storageArea===(null==n?void 0:n.localStorage))&&e.key)if(e.key!==this.ga){if(this.aa){var t=rz.find(t=>e.key===this.wa(t));t&&this.ka(e.key,t)}}else this.ka(e.key,na)},sC(n,"storage",this._a)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.ua.get(t);if(nl(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.Sa(t,r)}else this.Sa(t,!0)})}onCrossTabFeatureFlagChange(e){return this.ca.add(e),()=>this.ca.delete(e)}destroy(){this._a&&n&&(n.removeEventListener("storage",this._a),this._a=void 0),this.ca.clear()}ka(e,t,i){if(void 0===i&&(i=!0),this.xa)return!1;try{if(r=sW.ni(e),Y(r)){var s,r,n=this.Ca(t);return n.storageValue=null,t!==na&&(n.persisted=!1),!1}s=nh(r)}catch(e){return!1}var a=t===na?s:sW.si(this.ga);if(a&&this.Ta(a))return!1;var o=this.Ma(s,t,i);return t===na&&this.aa&&!nu(this.Ea().main,s)||this.Ia(s,t,!0,r),o}Ta(e){var t=this.props[ig],i=e[ig];return!W(t)&&!W(i)&&t!==i}Ia(e,t,i,s){var r=this.Ca(t);r.storageValue=s,t!==na&&(r.persisted=i);try{r.fingerprint=this.Ra(e,t)}catch(e){r.fingerprint=void 0}}Ma(e,t,i){var s=!1;return no.forEach(i=>{var r,n=null==(r=rU(i))?void 0:r.storageGroup;if(!(t===na&&this.aa&&n||t!==na&&n!==t)){var a=i in e,o=this.Pa(i,a?e[i]:void 0),l=this.ua.has(i)?i in this.props:a;l===i in this.props&&nu(o,this.props[i])||(l?this.Aa(i,o,!1):this.Fa(i,!1),s=!0)}}),s&&i&&this.ca.forEach(e=>e()),s}Oa(){if(!this.sa)return!1;try{this.va=!1;var e,t=sW.ni(this.ga),i=this.Ca(na),s=!1,r=!1;if(t!==i.storageValue)if(Y(t))i.storageValue=null;else{if(e=nh(t),this.va=!this.da&&this.Ta(e),this.va)return!1;r=this.Ma(e,na,!1),!this.aa||nu(this.Ea().main,e)?this.Ia(e,na,!0,t):i.storageValue=t,s=!0}return this.aa&&rz.forEach(t=>{var i=sW.ni(this.wa(t)),n=this.Ca(t),a=e||{},o=s&&no.some(e=>{var i;return(null==(i=rU(e))?void 0:i.storageGroup)===t&&e in a});if(i!==n.storageValue||o){if(Y(i))return n.storageValue=null,n.persisted=!1,void(o&&(r=this.Ma(a,t,!1)||r));var l=nh(i);r=this.Ma(l,t,!1)||r,this.Ia(l,t,!0,i)}}),r}catch(e){return!1}}Sa(e,t){this.ua.set(e,t);var i=rU(e);null!=i&&i.volatile||(this.Ca((this.aa?null==i?void 0:i.storageGroup:void 0)||na).fingerprint=void 0,this.La(e))}Da(){no.forEach(e=>this.ua.set(e,!0))}ba(){if(this.sa)try{var e=sW.ni(this.ga),t=nh(e);this.Ca(na).storageValue=e,no.forEach(e=>{var i,s=this.aa?null==(i=rU(e))?void 0:i.storageGroup:void 0,r=s?sW.ni(this.wa(s)):null;if(s){var n=this.Ca(s);n.storageValue=r,n.persisted=!Y(r)}var a=s&&!Y(r)?nh(r):t;e in this.props?this.$a(e,a[e],this.props[e]):e in a&&this.Sa(e,!0)})}catch(e){}}Pa(e,t){var i=this.ua.get(e);if(!i)return t;if(!0===i)return this.props[e];if(e===iq){var s=new Set(z(t)?t:[]),r=new Set(z(this.props[e])?this.props[e]:[]);
1return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}var n=G(t)?w({},t):{},a=G(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in a?n[e]=a[e]:delete n[e]}),n}$a(e,t,i){if(nl(e)){var s=this.ua.get(e);if(!0!==s){var r=t;if(this.sa)try{var n,a=this.aa?null==(n=rU(e))?void 0:n.storageGroup:void 0,o=a?this.wa(a):this.ga;r=nh(sW.ni(o))[e]}catch(e){}var l=new Set(s||[]);if(e===iq){if(!W(t)&&!z(t)||!W(r)&&!z(r)||!z(i))return void this.Sa(e,!0);var u=new Set(t||[]),h=new Set(r||[]),c=new Set(i);new Set([...u,...c]).forEach(e=>{u.has(e)!==c.has(e)&&l.add(e)}),l.forEach(e=>{h.has(e)===c.has(e)&&l.delete(e)})}else{if(!G(i))return void(nu(r,i)?this.ua.delete(e):this.Sa(e,!0));if(!W(t)&&!G(t)||W(t)&&U(i)&&W(r))return void this.Sa(e,!0);var d=G(t)?t:{},p=G(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&nu(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&nu(p[e],i[e])&&l.delete(e)})}l.size?this.Sa(e,l):this.ua.delete(e)}}}Na(){var e,t=null==(e=this.gn)?void 0:e.persistence_save_debounce_ms;return Q(t)&&t>0?t:0}qa(e){if(this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase())if(e)try{var t=sQ(e,this.gn.cookie_persisted_properties||[]),i=s0(t,this.gn.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sG.ni(this.ga)||void 0;r&&s2(this.ga,r)===s&&(this.ja=s,this.Ba=r)}catch(e){}else try{var n=sG.ni(this.ga)||void 0;this.ja=n?s2(this.ga,n):void 0,this.Ba=n}catch(e){}}syncCookieProperties(){return this.Ha(this.gn)}Ha(e,t){if(void 0===t&&(t=!1),this.xa&&!t||this.la||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sG.ni(this.ga)||void 0}catch(e){}if(!i||i===this.Ba)return!1;var i,s,r=s2(this.ga,i);try{s=sZ(JSON.parse(i))}catch(e){return!1}if((sG.ni(this.ga)||void 0)!==i)return!1;this.ja=r,this.Ba=i;var n=s1(this.ga,i),a=[...sJ,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(W(t)||Y(t)||""===t||e===i4&&t!==sd&&t!==sp)&&(o[e]=!0,delete s[e])}),U(s))return!1;var l=ig in s||s[i4]===sd||s[i4]===sp,u=this.props,h=u[ig],c=u[i4],d=sk({},u);[...sJ,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!o[e]&&(l||e!==ig&&e!==i4)){var t=d[e];(n.isValid||-1===sJ.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=sk(d,s),no.forEach(e=>{var t=e in this.props;e in u===t&&nu(u[e],this.props[e])||(t?this.$a(e,u[e],this.props[e]):this.Sa(e,!0))}),!l||i4 in s||i4 in this.props||this.Aa(i4,sd);var p=this.props[ig],v=this.props[i4];return l&&(p!==h||v!==c)&&(this.da=!0,this.oa=!0,s8.ii(this.ga+"_cookie_identity_change_pending",!0),this.Fa(iK),this.Fa(iq),this.Fa(iN),this.Fa(iH),this.Fa(iz),this.Fa(iV),this.Fa(i8),this.Fa(i6),this.Fa(i3),v!==sd||c!==sp&&s[i4]!==sd&&(W(h)||p===h)||(nc(this.props,s),this.Fa(iJ)),v===sp?this.props.$user_id=p:delete this.props.$user_id,this.Fa(iy)),!0}
1consumeCookieIdentityChange(){var e=this.ga+"_cookie_identity_change_pending",t=this.oa||!!s8.ni(e);return this.oa=!1,t&&s8.ai(e),t}za(e){return void 0===e&&(e=!1),!(this.la||this.xa&&!e||!this.gn.cookieWinsOnConflict||"localstorage+cookie"!==this.gn.persistence.toLowerCase()||(this.la=!0,0))}Ua(){this.la&&(W(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),delete this.na[na],this.Va(!0))}Ga(e){if(void 0===e&&(e=!0),this.la)try{e?this.Ua():W(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0)}finally{this.la=!1}}isDisabled(){return!!this.xa}ma(e){-1===nn.indexOf(e.persistence.toLowerCase())&&(io.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,a=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sJ,...t],w({},sW,{si(e){try{var t,r={};try{r=(t=sG.ni(e)||void 0)?sZ(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sW.ni(e)||"{}");if(i){var o=s1(e,t),l=[...sJ,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];Y(t)||""===t||e===i4&&t!==sd&&t!==sp||(u[e]=t)});var h=ig in u||u[i4]===sd||u[i4]===sp;if(Object.keys(u).length>0){var c,d=a[ig],p=null!=(c=a[i4])?c:sd;s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||e!==ig&&e!==i4)){var t=a[e];(o.isValid||-1===sJ.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||i4 in r||i4 in a||(a[i4]=sd),h&&((ig in u?u[ig]:a[ig])!==d||(i4 in u?u[i4]:a[i4])!==p)&&
1(sK.forEach(e=>delete a[e]),u[i4]===sp&&ig in u?a.$user_id=u[ig]:delete a.$user_id,u[i4]!==sp&&(delete a[iY],delete a[iJ]),delete a.__alias)}n=sk(a,u)}else n=sk(r,a);return sW.ii(e,n),n}catch(e){}return null},ii(e,s,r,n,a,o){var l=sW.ii(e,s,void 0,void 0,o);try{var u=sQ(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=s0(u,t);if(sG.ii(h,c,r,n,a,o),sG.ni(h)!==JSON.stringify(c)){sG.ai(h,n);var d=sQ(s);return sG.ii(e,d,r,n,a,o),l}}sG.ii(e,u,r,n,a,o)}}catch(e){sW.oi(e)}return l},ai(e,t){try{null==n||n.localStorage.removeItem(e),sG.ai(e,t),sG.ai(e+"_cpm",t)}catch(e){sW.oi(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sW.ri()?(r=sW,o=!0):"localstorage+cookie"===l&&a.ri()?(r=a,o=!0):"sessionstorage"===l&&s8.ri()?r=s8:"memory"===l?r=s5:"cookie"===l&&sG.ri()?r=sG:a.ri()?(r=a,o=!0):r=sG.ri()?sG:s5,this.sa=o,r}wa(e){return this.ga+"__"+e}ya(e){return this.sa&&!!e.split_storage}properties(){var e={};return sx(this.props,(t,i)=>{var s=rU(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.xa||e){var t=this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase(),i=t?sW.si(this.ga):null,s={};if(t)try{sx(s=sZ(sG.si(this.ga)),(e,t)=>{(W(e)||Y(e)||""===e)&&delete s[t]})}catch(e){}var r=this.Gs.si(this.ga);if(r&&(this.props=sk({},r)),this.aa&&this.Za(),t&&r){var n,a,o=null==i?void 0:i[ig],l=null!=(n=null==i?void 0:i[i4])?n:sd,u=r[ig],h=null!=(a=r[i4])?a:sd;if(u!==o||h!==l){this.oa=!0,s8.ii(this.ga+"_cookie_identity_change_pending",!0);var c=sk({},this.props);sK.forEach(e=>delete c[e]),h!==sd||l!==sp&&s[i4]!==sd&&(W(o)||u===o)||(nc(c,s),delete c[iJ]),this.props=c;var d=new Set;sK.forEach(e=>{var t,i=null==(t=rU(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sx(this.props,(i,s)=>{var r;(null==(r=rU(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),U(t)?(sW.ai(this.wa(e)),this.na[e]={}):sW.ii(this.wa(e),t)&&(this.na[e]={persisted:!0,fingerprint:this.Ra(t,e)})})}}s8.ni(this.ga+"_cookie_identity_change_pending")&&(this.oa=!0)}}Za(){for(var e of rz){var t=sW.si(this.wa(e));if(t&&!U(t)){var i=this.Ca(e);i.persisted=!0,this.Qa(e)||(i.fingerprint=this.Ra(t,e)),this.Ja(e,t)||sk(this.props,t)}}}Qa(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rU(t))?void 0:i.storageGroup)===e})}Ja(e,t){var i=nr[e];if(!i)return!1;var s=t[i],r=this.props[i];return Q(s)&&Q(r)&&r>s}refreshKey(e){var t;if(!this.xa){var i=this.aa?null==(t=rU(e))?void 0:t.storageGroup:void 0,s=i?sW.si(this.wa(i)):this.Gs.si(this.ga);if(s&&e in s)this.Aa(e,s[e]);else{if(i){var r=this.Gs.si(this.ga);if(r&&e in r)return void this.Aa(e,r[e])}this.Fa(e)}}}save(){if(!this.xa){var e=this.Na();e>0?W(this.Wa)&&(this.Wa=setTimeout(()=>{this.Wa=void 0,this.Va()},e)):this.Va()}}flush(){W(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0,this.Va())}Va(e){if(void 0===e&&(e=!1),!(this.xa||this.la&&!e)){e||this.syncCookieProperties();var t=!e&&!this.ha;t||(this.va=!1);var i=!!t&&this.Oa();if(this.va)this.gn.debug&&io.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.aa)return this.Ka(),void(i&&this.ca.forEach(e=>e()));var s=this.Ya(this.Gs,this.ga,this.props,na);"written"===s&&this.qa(this.props),"failed"!==s&&(this.ua.clear(),this.da=!1),i&&this.ca.forEach(e=>e())}}}Ka(){var e=this,t=this.Ea(),i=t.main,s=t.groups,r=this.Ya(this.Gs,this.ga,i,na);"written"===r&&this.qa(i),"failed"!==r&&(this.da=!1,no.forEach(e=>{var t;null!=(t=rU(e))&&t.storageGroup||this.ua.delete(e)}));var n=function(t){var i,r=s[t];if(U(r)&&(null==(i=e.na[t])||!i.persisted))return no.forEach(i=>{var s;(null==(s=rU(i))?void 0:s.storageGroup)===t&&e.ua.delete(i)}),1;var n=e.Ya(sW,e.wa(t),r,t);"failed"!==n&&no.forEach(i=>{var s=rU(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.ua.delete(i)})};for(var a of rz)n(a)}Ea(){var e={},t={flags:{},surveys:{}};return sx(this.props,(i,s)=>{var r,n=null==(r=rU(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Ra(e,t){if(t===na)return JSON.stringify(e)+"|"+this.Xa+"|"+this.eo+"|"+this.io;var i={};return sx(e,(e,t)=>{var s;i[t]=null!=(s=rU(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Ya(e,t,i,s){var r,n=this.Ca(s);if(s!==na&&!n.dirty&&!W(n.fingerprint))return"skipped";try{if((r=this.Ra(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.ii(t,i,this.Xa,this.eo,this.io,this.gn.debug)?(n.dirty=!1,s!==na&&(n.persisted=!0),W(r)||(n.fingerprint=r),this.sa&&(n.storageValue=sW.ni(t)),"written"):(this.gn.debug&&io.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(this.Da(),W(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),this.Gs.ai(this.ga,!1),this.Gs.ai(this.ga,!0),!i&&this.fa)for(var s of rz)sW.ai(this.wa(s));i?delete this.na[na]:this.na={},this.ja=void 0,this.Ba=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(G(e)){this.syncCookieProperties(),W(t)&&(t="None"),this.Xa=W(i)?this.ro:i;var s=!1;if(sx(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Aa(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(G(e)){this.syncCookieProperties(),this.Xa=W(t)?this.ro:t;var i=!1;if(sx(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||G(t)||z(t))&&(this.Aa(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.Fa(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==l?void 0:l.URL;if(e!==this.pa){var t=r6(this.gn.custom_campaign_params,this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties);U(sF(t))||this.register(t),this.pa=e}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?r4(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ne(),$referring_domain:null!=l&&l.referrer&&(null==(e=rK(l.referrer))?void 0:e.host)||r9},void 0)}set_initial_person_info(){this.props[se]||this.props[st]||this.register_once({[si]:nt(this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties,this.gn.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};sx([st,se],e=>{var t=this.props[e];t&&sx(t,function(e,t){s["$initial_"+j(t)]=e})});var r=this.props[si];return r&&sk(s,(void 0===(e=this.gn.disable_capture_url_hashes)&&(e=!1),t=ni(r,e),i={},sx(t,function(e,t){i["$initial_"+j(t)]=e}),i)),s}safe_merge(e){return sx(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,o=e.disable_persistence||!!i,l=!!this.xa&&!o;o||this.Ha(t,l),this.gn=e,!o&&(s||r||a)&&(this.ja=void 0,this.Ba=void 0,this.Ha(w({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||a?this.ma(e):this.Gs,h=this.ya(e),c=n||h!==this.aa,d=!o&&(c||e.cross_subdomain_cookie!==this.eo||e.secure_cookie!==this.io)&&this.za(l);this.ha=c;try{if(this.ro=this.Xa=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this.Gs=u,this.aa=h,this.props=p,this.save()}else a&&(this.Gs=u,o||(delete this.na[na],this.Va()))}finally{this.ha=!1,d&&this.Ga()}}set_disabled(e){this.xa=e,this.xa?this.remove():this.save()}set_cross_subdomain(e){e!==this.eo&&(this.eo=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.io&&(this.io=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[ib]||{};i[e]=t,this.Aa(ib,i),this.save()}remove_event_timer(e){var t=this.props[ib]||{},i=t[e];return W(i)||(delete t[e],this.Aa(ib,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Aa(e,t),this.save()}Aa(e,t,i){void 0===i&&(i=!0);var s,r=this.props[e];this.props[e]=t,i&&(e!==ig&&e!==i4||r===t||(this.da=!0),this.$a(e,r,t),null!=(s=rU(e))&&s.volatile||this.La(e))}Fa(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(nl(e)&&this.Sa(e,!0),this.La(e))}La(e){var t,i=null==(t=rU(e))?void 0:t.storageGroup;i&&(this.Ca(i).dirty=!0)}Ca(e){return this.na[e]||(this.na[e]={})}}function np(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&V(i.then)&&i.then(void 0,()=>{})}}}}var nv="gzip-js",ng="base64",nf="events",n_="cancelEvents",nm="survey shown",ny="survey dismissed",nb="survey sent",nw="popover",nx=il("[RateLimiter]");class nk{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nx.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nx.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(i9))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;if(l||e||(o.tokens=Math.max(0,o.tokens-1)),l&&!e){var u=(Q(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.no(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(i9,o),{isRateLimited:l,remainingTokens:o.tokens}}so(e){var t=this.instance.config.property_denylist;return!z(t)||!t.includes(e)}ao(){var e;if(this.so("$current_url")&&this.so("$pathname")&&null!=u&&u.pathname)return""+(null!=(e=u.origin)?e:"")+u.pathname}no(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.ao(),a=this.so("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,o=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,a?"session "+a:void 0].filter(
vendor: 5,599 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var nE=il("[RemoteConfig]");class nS{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}oo(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}lo(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return nE.info("Using preloaded remote config",this.remoteConfig),void this.uo(this.remoteConfig);if(this._instance.ho())return void nE.warn("Remote config is disabled. Falling back to local config.");this.oo(e=>{e?this.uo(e):(nE.info("No config found after loading remote JS config. Falling back to JSON."),this.lo(e=>{this.uo(e.json,e)}))})}catch(e){nE.error("Error loading remote config",e),this.uo()}}uo(e,t){!e&&t&&(0===t.statusCode?t.error||nE.warn("Failed to fetch remote config from PostHog."):nE.error("Failed to fetch remote config from PostHog."));try{this._instance.uo(e?{ok:!0,config:e}:{ok:!1})}catch(e){nE.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nE.error("Error loading feature flags",e)}}}var nP=Uint8Array,nF=Uint16Array,n$=Uint32Array,nC=new nP([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]),nI=new nP([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]),nA=new nP([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nO=function(e,t){for(var i=new nF(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new n$(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},nT=nO(nC,2),nM=nT[1];nT[0][28]=258,nM[258]=28;for(var nR=nO(nI,0)[1],nL=new nF(32768),nD=0;32768>nD;++nD){var nj=(43690&nD)>>>1|(21845&nD)<<1;nL[nD]=((65280&(nj=(61680&(nj=(52428&nj)>>>2|(13107&nj)<<2))>>>4|(3855&nj)<<4))>>>8|(255&nj)<<8)>>>1}var nN=function(e,t,i){for(var s=e.length,r=0,n=new nF(t);s>r;++r)++n[e[r]-1];var a,o=new nF(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nF(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=o[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[nL[c]>>>l]=u}else for(a=new nF(s),r=0;s>r;++r)a[r]=nL[o[e[r]-1]++]>>>15-e[r];return a},nq=new nP(288);for(nD=0;144>nD;++nD)nq[nD]=8;for(nD=144;256>nD;++nD)nq[nD]=9;for(nD=256;280>nD;++nD)nq[nD]=7;for(nD=280;288>nD;++nD)nq[nD]=8;var nB=new nP(32);for(nD=0;32>nD;++nD)nB[nD]=5;var nH=nN(nq,9,0),nz=nN(nB,5,0),nV=function(e){return(e/8|0)+(7&e&&1)},nG=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nF?nF:e instanceof n$?n$:nP)(i-t);return s.set(e.subarray(t,i)),s},nU=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nW=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nK=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new nP(0),0];if(1==r){var a=new nP(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=r-1;)o=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new nF(d+1),v=nJ(i[h-1],p,0);if(v>t){s=0;var g=0,f=v-t,_=1<<f;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new nP(p),v]},nJ=function(e,t,i){return -1==e.s?Math.max(nJ(e.l,t,i+1),nJ(e.r,t,i+1)):t[e.s]=i},nY=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nF(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},nZ=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nQ=function(e,t,i){var s=i.length,r=nV(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},nX=function(e,t,i,s,r,n,a,o,l,u,h){nU(t,h++,i),++r[256];for(var c=nK(r,15),d=c[0],p=c[1],v=nK(n,15),g=v[0],f=v[1],_=nY(d),m=_[0],y=_[1],b=nY(g),w=b[0],x=b[1],k=new nF(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=nK(k,7),P=S[0],F=S[1],$=19;$>4&&!P[nA[$-1]];--$);var C,I,A,O,T=u+5<<3,M=nZ(r,nq)+nZ(n,nB)+a,R=nZ(r,d)+nZ(n,g)+a+14+3*$+nZ(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(M>=T&&R>=T)return nQ(t,h,e.subarray(l,l+u));if(nU(t,h,1+(M>R)),h+=2,M>R){C=nN(d,p,0),I=d,A=nN(g,f,0),O=g;var L=nN(P,F,0);for(nU(t,h,y-257),nU(t,h+5,x-1),nU(t,h+10,$-4),h+=14,E=0;$>E;++E)nU(t,h+3*E,P[nA[E]]);h+=3*$;for(var D=[m,w],j=0;2>j;++j){var N=D[j];for(E=0;N.length>E;++E)nU(t,h,L[q=31&N[E]]),h+=P[q],q>
115&&(nU(t,h,N[E]>>>5&127),h+=N[E]>>>12)}}else C=nH,I=nq,A=nz,O=nB;for(E=0;o>E;++E)if(s[E]>255){nW(t,h,C[257+(q=s[E]>>>18&31)]),h+=I[q+257],q>7&&(nU(t,h,s[E]>>>23&31),h+=nC[q]);var q,B=31&s[E];nW(t,h,A[B]),h+=O[B],B>3&&(nW(t,h,s[E]>>>5&8191),h+=nI[B])}else nW(t,h,C[s[E]]),h+=I[s[E]];return nW(t,h,C[256]),h+I[256]},n0=new n$([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n1=function(){for(var e=new n$(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),n2=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},n3=!!c||!!h,n5="text/plain",n6=!1,n8=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],a=r[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(s?"#"+s:"")},n4=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),u=l[0],h=l[1],c=w({},t),d=null!=(o=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=c[r])?t:s[1];return delete c[r],r+"="+n}))?o:[],p=(void 0===s&&(s="&"),a=[],sx(c,function(e,t){W(e)||W(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},n7=e=>{if(e.do)return e.do;var t=e.data,i=e.compression;if(t){if(i===nv){var s,r,n,a,o,l,u,h,c=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new nP(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var a=new nP(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?r(o):(2048>o?r(192|o>>>6):(o>55295&&57344>o?(r(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),r(128|o>>>12&63)):r(224|o>>>12),r(128|o>>>6&63)),r(128|63&o))}return nG(i,0,s)}(rW(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=n1[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),h=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new nP(s+r+5*(1+Math.floor(r/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?o=nQ(a,o,e.subarray(l,u)):(a[l]=!0,o=nQ(a,o,e.subarray(l,r)))}else{for(var h=n0[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new nF(32768),g=new nF(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new n$(25e3),b=new nF(288),w=new nF(32),x=0,k=0,E=(l=0,0),S=0,P=0;r>l;++l){var F=m(l),$=32767&l,C=g[F];if(v[$]=C,g[F]=$,l>=S){var I=r-l;if((x>7e3||E>24576)&&I>423){o=nX(e,a,0,y,b,w,k,E,P,l-P,o),E=x=k=0,P=l;for(var A=0;286>A;++A)b[A]=0;for(A=0;30>A;++A)w[A]=0}var O=2,T=0,M=d,R=$-C&32767;if(I>2&&F==m(l-R))for(var L=Math.min(c,I)-1,D=Math.min(32767,l),j=Math.min(258,I);D>=R&&--M&&$!=C;){if(e[l+O]==e[l+O-R]){for(var N=0;j>N&&e[l+N]==e[l+N-R];++N);if(N>O){if(O=N,T=R,N>L)break;var q=Math.min(R,N-2),B=0;for(A=0;q>A;++A){var H=l-R+A+32768&32767,z=H-v[H]+32768&32767;z>B&&(B=z,C=H)}}}R+=($=C)-(C=v[$])+32768&32767}if(T){y[E++]=0x10000000|nM[O]<<18|nR[T];var V=31&nM[O],G=31&nR[T];k+=nC[V]+nI[G],++b[257+V],++w[G],S=l+O,++x}else y[E++]=e[l],++b[e[l]]}}o=nX(e,a,!0,y,b,w,k,E,P,l-P,o)}return nG(n,0,s+nV(o)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&n2(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(u,r),n2(u,h-8,a.d()),n2(u,h-4,o),u);return{contentType:n5,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===ng){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=rW(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:rW(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=rW(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},n9=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:n4(e.url,{compression:ng}),encodedBody:n7(w({},e,{compression:ng,do:void 0}))}:{url:n8(e.url,"compression"),encodedBody:n7(w({},e,{compression:void 0,do:void 0}))};try{t=n7(e)}catch(t){if(tk(e.compression,rJ(e.url,"compression")))return io.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&tk(e.compression,rJ(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?tx(new Uint8Array(i)):ArrayBuffer.isView(i)&&tx(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(n6=!0,s())},ae=e=>{try{return n9(e)}catch(t){return io.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},at=(t=b(function*(e){var t=rW(e.data),i=yield function(e,t,i){return tF.apply(this,arguments)}(t,m.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return w({},e,{do:{contentType:n5,body:s,estimatedSize:s.byteLength}})}),function(e){return t.apply(this,arguments)}),ai=/Failed to fetch|NetworkError|Load failed/i,as=e=>"TypeError"===(null==e?void 0:e.name)&&ai.test((null==e?void 0:e.message)||""),ar=e=>{var t=ae(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,l=n.estimatedSize,u=new Headers;sx(e.headers,function(e,t){u.append(t,e)}),a&&u.append("Content-Type",a);var c=null,p=!1;if(d){var v=new d;c={signal:v.signal,timeout:setTimeout(()=>{var t;p=!0,v.abort(td("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}
1,e.timeout)}}var g=t=>{p&&"AbortError"===(null==t?void 0:t.name)||as(t)?io.warn(t):io.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{h(s,w({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.vo&&52428.8>(l||0),body:o,signal:null==(i=c)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){io.error(e)}null==e.callback||e.callback(s)})).catch(g).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),g(e)}}},an=e=>{try{var t,i=n9(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,l=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(o.sendBeacon(s,u))return;var h=z(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(z(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>z(e.data)?t:w({},e.data,{batch:t});return an(w({},e,{data:d(h.slice(0,c))})),void an(w({},e,{data:d(h.slice(c))}))}io.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),ar(w({},e,{vo:!0}))}catch(e){io.warn("Beacon send failed",e)}},aa=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return n4(i===nv?n8(e,"compression"):e,w({},r?{[r]:Date.now().toString()}:{},i===nv?{}:{compression:i}))},ao=[];h&&ao.push({transport:"fetch",method:ar}),c&&ao.push({transport:"XHR",method(e){var t=ae(e);if(t){var i=new c,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;sx(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=o&&o.sendBeacon&&ao.push({transport:"sendBeacon",method:an});class al{constructor(e,t){this.co=!0,this.fo=[],this.po=eh((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,io.createLogger("flush interval"),3e3),this.mo=e}enqueue(e){this.fo.push(e),this.yo||this.bo()}unload(){this._o();var e=Object.values(this.fo.length>0?this.wo():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ko(w({},e,{transport:"sendBeacon"}))})}enable(){this.co=!1,this.bo()}bo(){var e=this;this.co||(this.yo=setTimeout(()=>{if(this._o(),this.fo.length>0){var t=this.wo();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&z(s.data)&&sx(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.ko(s)}()}},this.po))}ko(e){try{this.mo(e)}catch(e){io.error(e)}}_o(){clearTimeout(this.yo),this.yo=void 0}wo(){var e={};return sx(this.fo,t=>{var i,s=(t?t.batchKey:null)||t.url;W(e[s])&&(e[s]=w({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.fo=[],e}}var au=["retriesPerformedSoFar"];class ah{constructor(e){this.So=!1,this.xo=3e3,this.fo=[],this._instance=e,this.fo=[],this.Co=!0,!W(n)&&"onLine"in n.navigator&&(this.Co=n.navigator.onLine,this.To=()=>{this.Co=!0,this.Mo()},this.Eo=()=>{this.Co=!1},sC(n,"online",this.To),sC(n,"offline",this.Eo))}get length(){return this.fo.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=x(e,au);X(t)&&(i.url=n4(i.url,{retry_count:t})),this._instance._send_request(w({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.es(w({retriesPerformedSoFar:t},i));0===e.statusCode&&io.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}es(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.fo.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),io.warn(a),this.So||(this.So=!0,this.Io())}Io(){(this.Ro&&clearTimeout(this.Ro),0===this.fo.length)?(this.So=!1,this.Ro=void 0):this.Ro=setTimeout(()=>{this.Co&&this.fo.length>0&&this.Mo(),this.Io()},this.xo)}Mo(){var e=Date.now(),t=[],i=this.fo.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.fo=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Ro&&(clearTimeout(this.Ro),this.Ro=void 0),this.So=!1,W(n)||(this.To&&(n.removeEventListener("online",this.To),this.To=void 0),this.Eo&&(n.removeEventListener("offline",this.Eo),this.Eo=void 0)),this.fo)){var t=e.requestOptions;try{this._instance._send_request(w({},t,{transport:"sendBeacon"}))}catch(e){io.error(e)}}this.fo=[]}}class ac{constructor(e){this.Po=()=>{this.Ao||(this.Ao={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Ao.lastScrollY=Math.ceil(n),this.Ao.maxScrollY=Math.max(n,null!=(e=this.Ao.maxScrollY)?e:0),this.Ao.maxScrollHeight=Math.max(a,null!=(t=this.Ao.maxScrollHeight)?t:0),this.Ao.lastContentY=o,this.Ao.maxContentY=Math.max(o,null!=(i=this.Ao.maxContentY)?i:0),this.Ao.maxContentHeight=Math.max(l,null!=(s=this.Ao.maxContentHeight)?s:0)},this._instance=e}get Fo(){return this._instance.config.scroll_root_selector}getContext(){return this.Ao}resetContext(){var e=this.Ao;return setTimeout(this.Po,0),e}startMeasuringScrollPosition(){sC(n,"scroll",this.Po,{capture:!0}),sC(n,"scrollend",this.Po,{capture:!0}),sC(n,"resize",this.Po)}scrollElement(){if(!this.Fo)return null==n?void 0:n.document.documentElement;for(var e of z(this.Fo)?this.Fo:[this.Fo]){var t=null==n?void 0:n.document.querySelector(e);
1if(t)return t}}Oo(e){if(this.Fo){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return n?"y"===e?n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop||0:n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft||0:0}scrollY(){return this.Oo("y")}scrollX(){return this.Oo("x")}}var ad=e=>nt(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class ap{constructor(e,t,i,s){this.Tt=e=>{var t=this.Lo();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Do(this._instance)};this.$o.register({[i7]:i})}},this._instance=e,this.No=t,this.$o=i,this.Do=s||ad,this.No.onSessionId(this.Tt)}Lo(){return this.$o.props[i7]}getSetOnceProps(){var e,t=null==(e=this.Lo())?void 0:e.props;return t?"r"in t?ni(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return sx(sF(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+j(i)]=t}),e}}class av{on(e,t){return this.qo[e]||(this.qo[e]=[]),this.qo[e].push(t),()=>{this.qo[e]=this.qo[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.qo[e]||[])i(t);for(var s of this.qo["*"]||[])s(e,t)}constructor(){this.qo={}}}var ag=il("[SessionId]");class af{on(e,t){return this.jo.on(e,t)}constructor(e,t,i){if(this.Bo=null,this.Ho=null,this.zo=[],this.Uo=void 0,this.Wo=!1,this.jo=new av,this.Vo=(e,t)=>!(!X(e)||!X(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===sc)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.gn=e.config,this.$o=e.persistence,this.It=void 0,this.Pe=void 0,this._sessionStartTimestamp=null,this.Go=void 0,this._sessionActivityTimestamp=null,this.Zo=t||sq,this.Qo=i||sq;var s,r=this.gn.persistence_name||this.gn.token;if(this._sessionTimeoutMs=1e3*eh(this.gn.session_idle_timeout_seconds||1800,60,36e3,ag.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Jo(),this.Ko="ph_"+r+"_window_id",this.Yo="ph_"+r+"_primary_window_exists",this.Xo()){var n=s8.si(this.Ko),a=s8.si(this.Yo);n&&!a?this.It=n:s8.ai(this.Ko),s8.ii(this.Yo,!0)}null!=(s=this.gn.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.gn.bootstrap.sessionID),this.tl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return W(this.zo)&&(this.zo=[]),this.zo.push(e),this.Pe&&e(this.Pe,this.It),()=>{this.zo=this.zo.filter(t=>t!==e)}}Xo(){return"memory"!==this.gn.persistence&&!this.$o.xa&&s8.ri()}el(e){e!==this.It&&(this.It=e,this.Xo()&&s8.ii(this.Ko,e))}il(){return this.It?this.It:this.Xo()?s8.si(this.Ko):null}rl(e){var t=this.Bo;return!Y(t)&&!Y(e)&&5e3>Math.abs(e-t)}nl(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Pe&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Pe=e,r&&!s||r&&this.rl(t)||(this.Bo=t,this.$o.register({[iD]:[t,e,i]}))}sl(){var e,t=null==(e=this.gn)?void 0:e.persistence_save_debounce_ms;return X(t)&&t>0}al(){this.sl()?this.$o.refreshKey(iD):(this.$o.flush(),this.$o.load())}ol(){var e;if(!Y(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Bo){this.al();var t=this.ll();t[1]===this.Pe&&t[2]===this._sessionStartTimestamp&&(this.Bo=this._sessionActivityTimestamp,this.$o.register({[iD]:[this._sessionActivityTimestamp,null!=(e=this.Pe)?e:null,this._sessionStartTimestamp]}),this.$o.flush())}}ul(){var e=this.ll()[0];return Math.max(X(e)?e:0,X(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}hl(e){return this.al(),this.Vo(e,this.ul())}ll(){var e=this.$o.props[iD];return z(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Bo=null,this.Go=void 0,clearTimeout(this.dl),this.dl=void 0,this.nl(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void ag.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void ag.error("Invalid sessionID in bootstrap",e)}}(e);return!W(i)&&(t?this.Go={sessionId:e,sessionStartTimestamp:i}:this.nl(e,(new Date).getTime(),i),!0)}destroy(){this.Wo=!0,this.ol(),clearTimeout(this.dl),this.dl=void 0,this.Uo&&n&&(n.removeEventListener(sf,this.Uo,{capture:!1}),this.Uo=void 0),this.zo=[]}tl(){this.Uo=()=>{this.ol(),this.Xo()&&s8.ai(this.Yo)},sC(n,sf,this.Uo,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.gn.cookieless_mode===sc)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this.Pe;i?this.Ho=n:(Y(this.Ho)||this.Ho>n||n-this.Ho>=1e3)&&(null==(s=(r=this.$o).syncCookieProperties)||s.call(r),this.Ho=n);var o=this.ll(),l=o[1],u=o[2],h=!W(a)&&l!==a,c=this.ul(),d=this.il(),p=this.Go,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),g=p?v:X(u)&&Math.abs(n-u)>864e5,f=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.Vo(n,c);if(b){(b=this.hl(n))||ag.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.ll();l=w[1],u=w[2]}if(m||b||g){_=!1;var x=p&&!v;l=x?p.sessionId:this.Zo(),d=this.Qo(),ag.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),u=x?p.sessionStartTimestamp:n,this.Go=void 0,f=!0}else d||(d=this.Qo(),f=!0),(_=_||l!==y)&&(ag.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var k=X(c)&&e&&!g?c:n,E=X(u)?u:(new Date).getTime();this.el(d),this.nl(l,k,E),e||this.Jo();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:_};return f&&this.zo.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:f?S:void 0,lastActivityTimestamp:c}}Jo(){this.Wo||(clearTimeout(this.dl),this.dl=setTimeout(()=>{if(!this.Wo)if(this.hl((new Date).getTime())){var e=this.Pe;this.resetSessionId(),this.jo.emit("forcedIdleReset",{idleSessionId:e})}else this.Jo()},1.1*this.sessionTimeoutMs))}}var a_=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&R(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>R(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function am(){return(am=b(function*(){var e=null==o?void 0:o.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return K(i)&&i.length>0?i:void 0}catch(e){return void io.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function ay(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ab=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},aw=e=>e.toLowerCase(),ax={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>ab(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ab(t,e))),icontains:(e,t)=>t.map(aw).some(t=>e.map(aw).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(aw).every(t=>e.map(aw).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function ak(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(null==s)return!1;var r=ax[i.operator];return!!r&&r(i.values,[String(s)])})}function aE(e,t,i){return rW({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var aS="custom",aP="i.posthog.com",aF=/^\/static\//,a$=["/s/","/e/","/i/"];class aC{constructor(e){this.vl={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+aP,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.vl[this.apiHost]||(this.vl[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":aS),this.vl[this.apiHost]}cl(e){if(aF.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}fl(e){var t=rK(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}pl(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
1if(r&&(s=r(new URL((null==(a=rK(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&a$.some(e=>0===t.indexOf(e))){var n=this.fl(s);if(n){var a,o,l=this.apiHost,u=this.gl;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(u={apiHost:l,rewriteRequestPath:r,urls:new Set},this.gl=u),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.gl,i=this.fl(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.pl(e,t,this.uiHost+t);if("flags"===e)return this.pl(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.cl(t);if(i)return this.pl(e,t,""+i+t)}if(this.region===aS)return this.pl(e,t,this.apiHost+t);var s=aP+t;switch(e){case"assets":return this.pl(e,t,"https://"+this.region+"-assets."+s);case"api":return this.pl(e,t,"https://"+this.region+"."+s)}}}var aI=il("[Surveys]"),aA="seenSurvey_",aO=e=>{try{var t=""+aA+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){aI.error("Failed to persist survey seen state",e)}},aT=["popover","widget","api"],aM={ignoreConditions:!1,ignoreDelay:!1,displayType:nw},aR=il("[PostHog ExternalIntegrations]"),aL={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class aD{constructor(e){this._instance=e}Ks(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return aR.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],a=i[1];!a||null!=(e=_.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Ks(aL[n],()=>{var e;null==(e=_.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=_.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class aj{constructor(e,t){this.A=e,this.$s=t,this.ml=new Map,this.Fs=!1}add(e){var t=this;return b(function*(){if(t.Fs)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.ml.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.ml.set(e.name,e);try{var i=e.setup(t.$s);i&&(yield i)}catch(i){var s=t.ml.get(e.name)===e;s&&t.ml.delete(e.name),t.A.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.yl(e)}})()}getExtension(e){return this.ml.get(e)}dispose(){if(!this.Fs){this.Fs=!0;var e=Array.from(this.ml.values()).reverse();for(var t of(this.ml.clear(),e))this.yl(t)}}yl(e){try{var t=null==e.dispose?void 0:e.dispose();t&&V(t.then)&&t.then(void 0,t=>{this.A.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.A.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class aN{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);W(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var aq="extensionsRemoteConfig";class aB{constructor(e){this.Fs=!1,this.instance=e,this.A=io,this.bl=e._l,this.kv=new aN(e),this.onEvent=e=>np(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.A.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Fs)return np(()=>{});var t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.wl.on(aq,t);return this.bl&&t(this.bl),np(i)},this.kl=new aj(io.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(i_))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(i_);return"string"==typeof e?e:void 0}get library(){return{name:m.LIB_NAME,version:m.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==r?void 0:r.sessionId)?t:"",windowId:null!=(i=null==r?void 0:r.windowId)?i:"",sessionStartTimestamp:null!=(s=null==r?void 0:r.sessionStartTimestamp)?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.kl.add(e)}getExtension(e){return this.kl.getExtension(e)}capture(e,t,i){var s=this;return b(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return np(this.instance.Sl(e))}handleRemoteConfig(e){this.Fs||(this.bl=e,this.instance.wl.emit(aq,e))}sendRequest(e,t){var i=this;return b(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",e),n={method:t.method,url:t.query?n4(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?$.Base64:void 0,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}
1dispose(){this.Fs||(this.Fs=!0,this.kl.dispose())}}var aH={},az=0,aV=()=>{},aG='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aU="Surveys module not available",aW="sanitize_properties is deprecated. Use before_send instead",aK="Invalid value for property_denylist config: ",aJ=["token","distinct_id",sn],aY="posthog",aZ=!n3&&-1===(null==v?void 0:v.indexOf("MSIE"))&&-1===(null==v?void 0:v.indexOf("Mozilla")),aQ=e=>{var t,i;return w({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!K(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of s$)if(i===s)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aV,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:u&&K(null==u?void 0:u.search)&&-1!==u.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null==(t=n.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){io.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:sv,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aV},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rf,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},aX=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],a0=e=>{var t={};for(var i of aX){var s=i[0],r=i[1];W(e[s])||(t[r]=e[s])}var n=sk({},t,e),a=e.__preview_external_dependency_versioned_paths;return W(a)||(W(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),K(a)&&W(e.asset_host)&&(n.asset_host=a)),z(e.property_blacklist)&&(W(e.property_denylist)?n.property_denylist=e.property_blacklist:z(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:io.error(aK+e.property_denylist)),n};class a1{constructor(){this.__forceAllowLocalhost=!1}get xl(){return this.__forceAllowLocalhost}set xl(e){io.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class a2{Cl(e){if(e){var t=this.ml.indexOf(e);-1!==t&&this.ml.splice(t,1)}}Tl(e,t){return this.Cl(e),this.ml.push(t),null==t.initialize||t.initialize(),t}Ml(){return this.config.cookieless_mode===sc||this.config.cookieless_mode===sh&&this.consent.isRejected()}El(){if(!this.Il&&!this.config.segment&&!this.Ml()){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.Rl||(s?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', or keep this persistence and pass a stable ID through bootstrap.distinctID."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, or keep persistence disabled and pass a stable ID through bootstrap.distinctID."),this.Il=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Pl(){if(!this.Ml()&&this.get_distinct_id()===sr){var e=this.persistence;if(e){this.Al()||e.load(!0);var t=this.get_distinct_id();if(!t||t===sr){var i=this.config.get_device_id(sq());this.register({distinct_id:i,$device_id:i}),e.set_property(i4,sd)}this.Fl()}}}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new a1,this.Ol=!1,this.version=m.LIB_VERSION,this.Ll=new Set,this.Dl="",this.wl=new av,this.ml=[],this.$l=[],this.Rl=!1,this.Il=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=aQ(),this.SentryIntegration=rB,this.sentryIntegration=e=>{var t;return t=rq(this,e),{name:rN,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Nl=!1,this.ql=null,this.jl=null,this.Bl=null,this.scrollManager=new ac(this),this.pageViewManager=new rH(this),this.rateLimiter=new nk(this),this.requestRouter=new aC(this),this.consent=new s4(this),this.externalIntegrations=new aD(this);var e,t=null!=(e=a2.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=K(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=K(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>io.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==aY){var s,r=null!=(s=aH[i])?s:new a2;return r._init(e,t,i),aH[i]=r,aH[aY][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,r,a,o,l=K(e)?e.trim():"";if(!l)return io.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 l!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=aQ(t.defaults),t.debug=this.Hl(t.debug),this.zl=t,this.Ul=[],t.person_profiles?this.jl=t.person_profiles:t.process_person&&(this.jl=t.process_person);var u=aQ(t.defaults),h=a0(t),c=sk({},u,h,{name:i,token:l});G(u.rageclick)&&G(h.rageclick)&&(c.rageclick=sk({},u.rageclick,h.rageclick)),G(u.session_recording)&&G(h.session_recording)&&(c.session_recording=sk({},u.session_recording,h.session_recording)),this.set_config(c),this.config.on_xhr_error&&io.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:nv;var d=this.Al();if(this.persistence=new nd(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nd(w({},this.config,{persistence:"sessionStorage"}),d,!1),this.Dl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&s8.ri()){var p=s8.si(this.Dl);
1z(p)&&p.forEach(e=>{K(e)&&this.Ll.add(e)})}else s8.ai(this.Dl);var v=w({},this.persistence.props),g=w({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Wl=new al(e=>this.Vl(e),this.config.request_queue_config),this.Gl=new ah(this),this.__request_queue=[];var f=this.Ml();f||(this.sessionManager=new af(this),this.sessionPropsManager=new ap(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Zl()})),this.Ql(),this.config.__preview_deferred_init_extensions?(io.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Jl(f)},0)):(io.info("Initializing extensions synchronously"),this.Jl(f)),m.DEBUG=m.DEBUG||this.config.debug,m.DEBUG&&io.info("Starting in debug mode",{this:this,config:t,thisC:w({},this.config),p:v,s:g}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=w({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var _=null==(r=t.bootstrap)?void 0:r.distinctID;if(this.Rl=!!_&&!J(_),void 0!==(null==(a=t.bootstrap)?void 0:a.distinctID)){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),x=this.persistence.get_property(i4);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&x===sd)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&x===sp)io.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var k=this.config.get_device_id(sq()),E=t.bootstrap.isIdentifiedID?k:y;this.persistence.set_property(i4,t.bootstrap.isIdentifiedID?sp:sd),this.register({distinct_id:y,$device_id:E})}}if(f)this.register_once({distinct_id:sr,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(sq());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(i4,sd)}return sC(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||sq();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(i4,sp)),t()},r=i.user();"then"in r&&V(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("u">typeof Promise&&Promise.resolve||rj.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rj.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rj.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,s_),identify:e=>s(e,sy),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Kl()):this.Kl(),V(this.config._onCapture)&&this.config._onCapture!==aV&&(io.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&io.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return am.apply(this,arguments)})().then(e=>{e&&this.register({[im]:e})}).catch(aV),this}Yl(e){return K(e.name)&&V(e.setup)}Xl(e,t){this.Yl(e)?t.push(()=>{this.tu().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{io.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.ml.push(e)}Ql(){var e,t,i,s,r,n,a=null!=(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)?e:null==(i=a2.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(s=this.eu)||s.call(this),this.eu=void 0,this.featureFlags=new a(this)),V(this.featureFlags.onReloading)&&V(this.featureFlags.setup)?this.eu||(this.eu=this.featureFlags.onReloading(()=>{this.wl.emit("featureFlagsReloading",!0)}),this.tu().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Jl(e){var t,i,s,r,n,a,o,l=performance.now(),u=w({},a2.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.ml.push(this.exceptions=null!=(t=this.exceptions)?t:new u.exceptions(this)),u.historyAutocapture&&this.ml.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.ml.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.ml.push(this.siteApps=new u.
1siteApps(this)),u.sessionRecording&&!e&&this.ml.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Xl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.Xl(this.surveys=null!=(i=this.surveys)?i:new u.surveys(this),h),u.logs&&this.Xl(this.logs=null!=(s=this.logs)?s:new u.logs(this),h),u.metrics&&this.ml.push(this.metrics=null!=(r=this.metrics)?r:new u.metrics(this)),u.conversations&&this.ml.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.ml.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.ml.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.ml.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.ml.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.ml.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rL)),u.toolbar&&this.ml.push(this.toolbar=null!=(a=this.toolbar)?a:new u.toolbar(this)),u.experiments&&this.ml.push(this.experiments=null!=(o=this.experiments)?o:new u.experiments(this)),this.ml.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.iu){var e=this.iu;this.iu=void 0,this.ml.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.ru(h,l)}ru(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ru(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){io.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[sa]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[so]:s}),this.config.__preview_deferred_init_extensions&&io.info("PostHog extensions initialized ("+s+"ms)")}uo(e){var t;if(!l||!l.body)return io.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.uo(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.iu=e),this._l=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=L(s.supportedCompression,nv)?nv:L(s.supportedCompression,ng)?ng:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.jl?this.jl:sv}),null==(t=this.nu)||t.handleRemoteConfig(e),this.ml.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Kl(){try{this.config.loaded(this)}catch(e){io.critical("`loaded` function failed",e)}if(this.su(),this.config.internal_or_test_user_hostname&&null!=u&&u.hostname){var e=u.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ml())&&this.au()},1),this.ou=new nS(this),this.ou.load()}su(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Wl)||e.enable())}_dom_loaded(){this.is_capturing()&&sw(this.__request_queue,e=>this.Vl(e)),this.__request_queue=[],this.su()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.lu()&&this.capture(sm),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Wl)||s.unload(),null==(r=this.Gl)||r.unload()):this.lu()&&this.capture(sm,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?aZ?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=w({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!=(t=this.compression)?t:e.compressionFallback:e.compression,(W(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r,n,a=w({},e);a.timeout=a.timeout||6e4;var o,l,u,h,c,d=null!=(s=a.transport)?s:"fetch";"sendBeacon"===d&&W(a.compression)&&a.data&&(a.compression=ng),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(c=(h=(z(o=a.data)?o:[o]).map(e=>w({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=c.properties)?void 0:u.token)?l:null==c?void 0:c.token,batch:h,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=z(t)?t.map(e=>w({},e,{sent_at:i})):w({},t,{sent_at:i}))),a.url=aa(a.url,a.method,a.compression,a.timestampMode);var v=ao.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),g=null!=(r=null==(n=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===d)return e[t]}(v))?void 0:n.method)?r:v[0].method;if(!g)throw Error("No available transport method");var f=e=>{try{g(e)}catch(e){as(e)?io.warn(e):io.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&a.data&&a.compression===nv&&p&&"u">typeof Promise&&!n6?at(a).then(e=>{f(e)}).catch(t=>{tE(t)?(n6=!0,f(w({},a,{compression:void 0,url:aa(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return tE(e)||t===tw})(t)&&(n6=!0),f(a))}):g(a)})(w({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Vl(e){this.Gl?this.Gl.retriableRequest(e):this._send_request(e)}_execute_array(e){az++;try{var t,i=[],s=[],r=[];sw(e,e=>{if(e)if(z(t=e[0]))r.push(e);else if(V(e))try{e.call(this)}catch(t){io.error("Error executing queued PostHog call",e,t)}else z(e)&&"alias"===t?i.push(e):z(e)&&-1!==t.indexOf("capture")&&V(this[t])?r.push(e):s.push(e)});var n=function(e,t){sw(e,function(e){try{if(z(e[0])){var i=t;sx(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){io.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{az--}}push(e){if(az>0&&z(e)&&K(e[0])){var t=a2.prototype[e[0]];V(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Wl){if(this.is_capturing())if(!W(e)&&K(e)){this.Pl();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!K(null==t?void 0:t.$current_url)&&(io.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.uu||io.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 h,c,d,p,v=new Date,g=(null==i?void 0:i.timestamp)||v,f=tc(null==i?void 0:i.uuid,sq),_={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===s_&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iG);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var y=null==i?void 0:i.$unset;y&&(_.$unset=y);var b,x,k,E=m?void 0:this.hu(null==i?void 0:i.$set_once,e!==sb,e===sy);if(E&&(_.$set_once=E),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=_,a=e=>K(e)?e.slice(0,r):e,o=new Set,_=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var s;if(o.add(t),z(t))s=[],sw(t,t=>{s.push(e(t))});else{var r={};sx(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),_.timestamp=g,W(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=v),m&&(_.properties=(h=_.properties,void 0===(c=aJ)&&(c=[]),d={},p=e=>{void 0!==h[e]&&(d[e]=h[e])}
1,P.forEach(p),c.forEach(p),d)),e===ny||e===nb){var S=null==t?void 0:t.$survey_id,F=null==t?void 0:t.$survey_iteration;aO({id:S,current_iteration:F}),_.$set=w({},_.$set,{[(b={id:S,current_iteration:F},k="$survey_"+(x=e===nb?"responded":"dismissed")+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(k="$survey_"+x+"/"+b.id+"/"+b.current_iteration),k)]:!0})}else e===nm&&(_.$set=w({},_.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var $=null==t?void 0:t.$product_tour_type;$&&(_.$set=w({},_.$set,{["$product_tour_last_seen_date/"+$]:(new Date).toISOString()}))}var C=w({},_.properties.$set,_.$set);if(U(C)||this.setPersonPropertiesForFlags(C),!Z(this.config.before_send)){var I=this.Xn(_);if(!I)return;(_=I).uuid=tc(_.uuid,sq)}this.wl.emit("eventCaptured",_);var A=null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:A,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(A)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Vl(O):this.Wl.enqueue(O),_}io.critical("This capture call is ignored due to client rate limiting.")}}else io.error("No event name provided to posthog.capture")}else io.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.nu)?void 0:t.getExtension(e)}tu(){var e;return null!=(e=this.nu)?e:this.nu=new aB(this)}Sl(e){this.$l.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.$l.indexOf(e);-1!==i&&this.$l.splice(i,1)}}}du(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.Bl=null,this.persistence.get_property(i4)===sd&&(null==(s=this.sessionPersistence)||s.clear(),this.Ll.clear(),this.vu()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.du();var a,o=r?void 0:this.persistence.remove_event_timer(e),h=w({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ml()&&(h[sn]=!0),"$snapshot"===e){var c=w({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!K(h.distinct_id)&&!Q(h.distinct_id)||J(h.distinct_id))&&io.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,p=function(e,t,i,s){if(void 0===s&&(s=!1),!v)return{};var r,a,o,l,h,c=e?[...r1,...t||[]]:[],d=tl(v),p=d[0],g=d[1],f=null!=(h="u">typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},_={};W(i)||(_.detectGoogleSearchApp=i);var y={},b=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==n||null==(o=n.screen)?void 0:o.width,k=null==n||null==(l=n.screen)?void 0:l.height,E=null==n?void 0:n.devicePixelRatio;W(b)||(y.userAgentDataPlatform=b),W(w)||(y.maxTouchPoints=w),W(x)||(y.screenWidth=x),W(k)||(y.screenHeight=k),W(E)||(y.devicePixelRatio=E);var S,P,F,$,C,I,A=sk(sF({$os:p,$os_version:g,$browser:tr(v,navigator.vendor,f,_),$device:tu(v),$device_type:(I=tu(v))===ef||I===eg||"Kobo"===I||"Kindle Fire"===I||I===eU?ev:I===eR||I===eD||I===eL||I===ez?"Console":I===em?"Wearable":I?ed:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=(P=null==y?void 0:y.maxTouchPoints)?P:0)>0?600>Math.min(null!=(F=null==y?void 0:y.screenWidth)?F:0,null!=($=null==y?void 0:y.screenHeight)?$:0)/(null!=(C=null==y?void 0:y.devicePixelRatio)?C:1)?ed:ev:"Desktop",$timezone:ns(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rY(s?tp(null==u?void 0:u.href):null==u?void 0:u.href,c,r3),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:v.length>1e3?v.substring(0,997)+"...":v,$browser_version:ta(v,navigator.vendor,f,_),$browser_language:r7(),$browser_language_prefix:"string"==typeof(S=r7())?S.split("-")[0]:void 0,$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return m.SDK_DIST_CHANNEL&&(A.$sdk_dist_channel=m.SDK_DIST_CHANNEL),A}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var g=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),f=g.windowId;h.$session_id=g.sessionId,h.$window_id=f}this.sessionPropsManager&&sk(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sk(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(a=this.Gl)?void 0:a.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===aS&&(h.$lib_custom_api_host=this.config.api_host),d=e!==s_||r?e!==sm||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),h=sk(h,d),e===s_&&l&&(h.title=l.title),!W(o)){var _=i.getTime()-o;h.$duration=parseFloat((_/1e3).toFixed(3))}v&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),b=this.sessionPersistence.properties();sx(["$referrer","$referring_domain"],e=>{e in y&&delete b[e]});var x={};if(this.$l.length>0)for(var k of this.$l.slice())try{sk(x,k())}catch(e){io.error("Failed to produce browser extension event properties",e)}(h=sk({},p,y,b,w({},x,h))).$is_identified=this._isIdentified(),z(this.config.property_denylist)?sx(this.config.property_denylist,function(e){delete h[e]}):io.error(aK+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(io.error(aW),h=E(h,e));var S=this.cu();return h.$process_person_profile=S,S&&!r&&this.fu("_calculate_event_properties"),h}hu(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.cu()||this.Ol&&!i)return e;var s,r=sk({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(io.error(aW),r=n(r,"$set_once")),t&&(this.Ol=!0),U(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.du(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.Ll.add(e)),this.vu()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Ll.delete(e),this.vu()}pu(e,t){this.register({[e]:t})}Zl(){this.Ll.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Ll.clear(),this.vu()}vu(){var e;if(this.Dl)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.xa||!s8.ri())s8.ai(this.Dl);else{var t=[];this.Ll.forEach(e=>t.push(e)),t.length>0?s8.ii(this.Dl,t):s8.ai(this.Dl)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.wl.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:aU}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:aU})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aU})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=aM),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:aU}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:aU})}gu(e){return!e||J(e)?(io.critical("Unique user id has not been set in posthog.identify"),!1):e===sr?(io.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(io.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return io.uninitializedWarning("posthog.identify");if(Q(e)&&(e=e.toString(),io.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.gu(e)&&this.fu("posthog.identify")){this.Pl();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.du(!1),a=this.persistence.za(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(i_)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(iy)&&(this.unregister(iy),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(i4)||sd)===sd,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(i4,sp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture(sy,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.Bl=aE(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(i4,sp);var p=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:p,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture("$set",{$set:p,$set_once:v}),this.Bl=aE(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(i3)):d&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ga(o)}}}setPersonProperties(e,t){if((e||t)&&this.fu("posthog.setPersonProperties")){var i=aE(this.get_distinct_id(),e,t);this.Bl!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Bl=i):io.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(z(e)?e:[e]).filter(e=>K(e)&&e.length>0);0!==i.length&&this.fu("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Bl=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.du();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w({},r,{[e]:t})}),n||i){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(sb,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else io.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.fu("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=ee(e)?e:null==e?void 0:e.resetDeviceID,i=ee(e)||null==e?void 0:e.bootstrap;this.mu(t,!1,i)}mu(e,t,i){if(void 0===t&&(t=!1),io.info("reset"),!this.__loaded)return io.uninitializedWarning("posthog.reset");var s,r,n,a,o,l,u,h,c,d,p,v,g,f,_,m,y,b=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.zl)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ho());var x=this.get_property(i_),k=this.get_property(im),E=this.get_property(iA),S=this.is_capturing();this.consent.reset(),t||!S||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var P=null==(n=this.persistence)||null==n.za?void 0:n.za(),F=!1;try{if(null==(a=this.persistence)||a.clear(),null==(o=this.sessionPersistence)||o.clear(),this.Ll.clear(),this.vu(),W(E)||null==(g=this.persistence)||g.register({[iA]:E}),null==(l=this.surveys)||l.reset(),null==(u=this.featureFlags)||u.reset(),null==(h=this.conversations)||h.reset(),null==(c=this.logs)||c.reset(),null==(d=this.metrics)||d.reset(),null==(p=this.persistence)||p.set_property(i4,sd),null==(v=this.sessionManager)||v.resetSessionId(),this.Bl=null,this.config.cookieless_mode===sc)this.register_once({distinct_id:sr,$device_id:null},"");else{var $=this.config.get_device_id(sq());this.register_once({distinct_id:$,$device_id:e?$:x},""),e||W(k)||this.register({[im]:k})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.Ml()||(null==(m=this.persistence)||m.set_property(i4,i.isIdentifiedID?sp:sd),this.register({distinct_id:i.distinctID})),null==(f=this.featureFlags)||f.initialize(),!(W(b)||null!=(_=this.sessionManager)&&_.setBootstrapSessionId(b,!0)))){var C=w({},i);delete C.sessionID,this.config.bootstrap=C}delete this.config.identity_distinct_id,delete this.config.identity_hash,F=!0}finally{P&&(null==(y=this.persistence)||null==y.Ga||y.Ga(F))}this.reloadFeatureFlags()}shutdown(e){var t=this;return b(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){t.tu().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.Wl)||r.unload(),null==(n=t.Gl)||n.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){io.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(o=t.sessionPersistence)||o.destroy()}else io.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.yu()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.bu()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(iv)?(io.critical("Attempting to create alias for existing People user - aborting."),-2):this.fu("posthog.alias")?(W(t)&&(t=this.get_distinct_id()),e!==t?(this.pu(iy,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(io.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=w({},this.config);if(G(e)){sk(this.config,a0(e));var i=this.Al();null==(s=this.persistence)||s.update_config(this.config,t,i),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nd(w({},this.config,{persistence:"sessionStorage"}),i,!1);var s,r,n,a,o,l,u,h,c,d,p,v,g,f=this.Hl(this.config.debug);ee(f)&&(this.config.debug=f),ee(this.config.debug)&&(this.config.debug?(m.DEBUG=!0,sW.ri()&&sW.ii("ph_debug",!0),io.info("set_config",{config:e,oldConfig:t,newConfig:w({},this.config)})):(m.DEBUG=!1,sW.ri()&&sW.ai("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ho()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(a=this.exceptions)||a.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this.Fl(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){m.LIB_NAME=e,m.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(w({},s,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:a2._u}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:aY;return t!==aY&&(t=aY+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(i4))===sp||(null==(t=this.sessionPersistence)?void 0:t.get_property(i4))===sp}cu(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===sv&&!this._isIdentified()&&U(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[iy]
1)&&(null==(t=this.persistence)||null==(t=t.props)||!t[ss]))}lu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.cu()||this.fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}fu(e){return"never"===this.config.person_profiles?(io.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.El(),this.pu(ss,!0),!0)}Al(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==sh)}Fl(){var e,t,i,s,r,n=this.Al();return this.is_capturing()||null==(i=this.logs)||i.wu(),(null==(e=this.persistence)?void 0:e.xa)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.xa)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.Ll.clear(),this.vu()),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==sc){if(this.Ml()){null==(r=this.sessionRecording)||r.dispose({discardBufferedEvents:!0}),this.mu(!0,!0),null==(n=this.sessionManager)||n.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new af(this),this.pageViewManager=new rH(this),this.persistence&&(this.sessionPropsManager=new ap(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,h,c=null!=(o=null==(l=this.config.__extensionClasses)?void 0:l.sessionRecording)?o:null==(u=a2.__defaultExtensionClasses)?void 0:u.sessionRecording;c&&(this.sessionRecording=this.Tl(this.sessionRecording,new c(this)),this._l&&(null==(h=this.sessionRecording)||null==h.onRemoteConfig||h.onRemoteConfig(this._l)))}this.consent.optInOut(!0),this.Fl(),this.su(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==sh&&(null==(i=this.surveys)||i.loadIfEnabled()),(W(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.au()}else io.warn(aG)}opt_out_capturing(){if(this.config.cookieless_mode!==sc){var e,t,i=this.config.cookieless_mode===sh?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===sh&&this.consent.isOptedIn()&&this.mu(!0,!0),this.consent.optInOut(!1),this.Fl(),this.config.cookieless_mode===sh&&(this.register({distinct_id:sr,$device_id:null}),this.Cl(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.au(),this.su())}else io.warn(aG)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===sc||(this.config.cookieless_mode===sh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fl()}_is_bot(){return o?a_(o,this.config.custom_blocked_useragents):void 0}au(){l&&("visible"===l.visibilityState?this.Nl||(this.Nl=!0,this.capture(s_,{title:l.title},{send_instantly:!0}),this.ql&&(l.removeEventListener(sg,this.ql),this.ql=null)):this.ql||(this.ql=this.au.bind(this),sC(l,sg,this.ql)))}debug(e){!1===e?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.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}))}ho(){var e,t,i,s,r=this.zl||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(io.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!Z(r[e]),s=t in r&&!Z(r[t]),i?r[e]:!!s&&(io&&io.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Xn(e){if(Z(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(ei),s=z(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;
1for(var n of s)try{if(r=n(r),Z(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return et(e.event)?io.warn(a+". This can cause unexpected behavior."):io.info(a),null}r.properties&&!U(r.properties)||io.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return io.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var o of i)if(r.properties&&Z(r.properties[o]))return io.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.ta)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Hl(e){var t=ee(e)&&!e,i=sW.ri()&&"true"===sW.ni("ph_debug");return!t&&(!!i||e)}}a2.__defaultExtensionClasses={},a2._u={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=sP(e.prototype[t[i]])}(a2,["identify"]);class a3{constructor(e){this.disabled=!1===e;var t=G(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var a5="$copy_autocapture",a6=il("[AutoCapture]");function a8(e,t){return t.length>e?t.slice(0,e)+"...":t}class a4{constructor(e){this.name="autocapture",this.Is=!1,this.Rs=null,this.Ps=!1,this.As=!1,this.gn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Fs=!1,this.Os=e,this.Os.refresh(this.gn),this.rageclicks=new a3(this.gn.rageclick),this.Ls=null}setup(e){this.Ds(),this.$s=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Fs?t.dispose():(this.Ns=t,this.startIfEnabled())}dispose(){var e;this.Fs||(this.Fs=!0,this.$s=void 0,null==(e=this.Ns)||e.dispose(),this.Ns=void 0,this.qs())}js(){return this.Os.refresh(this.gn),this.gn}Ds(){var e,t;return this.js(),this.gn.url_allowlist=null==(e=this.gn.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.gn.url_ignorelist=null==(t=this.gn.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.gn}Bs(){if(this.isBrowserSupported()){if(n&&l){var e=this.Hs=e=>{e=e||(null==n?void 0:n.event);try{this.zs(e)}catch(e){a6.error("Failed to capture event",e)}};if(sC(l,"submit",e,{capture:!0}),sC(l,"change",e,{capture:!0}),sC(l,"click",e,{capture:!0}),this.js().capture_copied_text){var t=this.Us=e=>{e=e||(null==n?void 0:n.event);try{this.zs(e,a5)}catch(e){a6.error("Failed to capture clipboard event",e)}};sC(l,"copy",t,{capture:!0}),sC(l,"cut",t,{capture:!0}),sC(l,"paste",t,{capture:!0})}}}else a6.info("Disabling Automatic Event Collection because this browser is not supported")}qs(){this.Hs&&(null==l||l.removeEventListener("submit",this.Hs,!0),null==l||l.removeEventListener("change",this.Hs,!0),null==l||l.removeEventListener("click",this.Hs,!0),this.Hs=void 0),this.Us&&(null==l||l.removeEventListener("copy",this.Us,!0),null==l||l.removeEventListener("cut",this.Us,!0),null==l||l.removeEventListener("paste",this.Us,!0),this.Us=void 0),this.Is=!1}startIfEnabled(){!this.Fs&&this.$s&&this.isEnabled&&!this.Is&&(this.Bs(),this.Is=!0)}onRemoteConfig(e){if(!this.Fs)if(this.Ps=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.As=t.elementsChainAsString);var i,s=t.autocapture_opt_out;ee(s)&&(null==(i=this.$s)||i.kv.set(iw,s),this.Rs=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,i=[];return null==(t=this.Ls)||t.forEach(t=>{var s=null==l?void 0:l.querySelectorAll(t);
1null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){if(this.Fs)return!1;var e,t,i=null==(e=this.$s)?void 0:e.kv.get(iw),s=this.Rs,r=this.js(),n=r.remoteRequestsDisabled&&!this.Ps;if(Y(s)&&!ee(i)&&!n)return!1;var a=null!=(t=this.Rs)?t:!!i;return!!r.enabled&&!a}zs(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i=rh(e);rs(i)&&(i=i.parentNode||null);var s,r=this.Ds();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&r.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rb(i,r.rageclick)&&this.zs(e,"$rageclick");var a=t===a5,o=a?w({},r,{dom_event_allowlist:void 0}):r;if(i&&function(e,t,i,s,r,a){if(!n||rw(e)||null!=i&&i.url_allowlist&&!ra(i.url_allowlist,a)||null!=i&&i.url_ignorelist&&ra(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var o,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=rx(e,s),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(W(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(c,i)||!rd(c,null==i?void 0:i.css_selector_allowlist)||rd(c,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:rv))return!1;try{var d=n.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return h?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(rc.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var l,u=function(e,t){var i,s,r=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!rt(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!ri(p,"body")&&1e3>c.length;)if(rr(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!rt(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var g,f=[],_={},m=!1,y=!1;if(sx(c,e=>{var t=rk(e);if(ri(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&rA(i))&&(h?tp(i):i)}L(ro(e),"ph-no-capture")&&(y=!0),f.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};rc.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?a8(1024,rO(e)):a8(1024,ru(e)));var o=ro(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),sx(e.attributes,function(i){var n;if((!rE(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&rA(i.value)&&(!K(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=rn(o).join(" ")),a["attr__"+i.name]=a8(1024,"href"===i.name&&r?tp(o):o)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rt(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,h));var s=function(e){if(!rk(e))return{};var t={};return sx(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&rA(s)&&(t[i]=s)}}),t}(e);sx(s,(e,t)=>{({}).hasOwnProperty.call(_,t)||(_[t]=e)})}),y)return{props:{},explicitNoCapture:y};if(o||(f[0].$el_text=ri(e,"a")||ri(e,"button")?rO(e):ru(e)),m){f[0].attr__href=m;var b,x,k=null==(b=rK(m))?void 0:b.host,E=null==n||null==(x=n.location)?void 0:x.host;k&&E&&k!==E&&(g=m)}return{props:sk({$event_type:r.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:z(f)?f.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return z(t)?t:rn(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sE(e).filter(e=>
10===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=w({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return sE(n).sort((e,t)=>{var i,s;return(s=t[0])>(i=e[0])?-1:+(i>s)}).forEach(e=>{var t=e[1];return a[rT(e[0].toString())]=rT(t.toString())}),(s+=":")+sE(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";"):""},null!=(i=f[0])&&i.$el_text?{$el_text:null==(s=f[0])?void 0:s.$el_text}:{},g&&"click"===r.type?{$external_click_url:g}:{},_)}}(i,{e:e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this.As,disableCaptureUrlHashes:r.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(h.$element_selectors=c),t===a5){var d=e.type||"clipboard";if("paste"!==d){var p,v,g=null==n||null==(p=n.getSelection())?void 0:p.toString(),f=rl(g);if(!f)return!1;h.$selected_content=f,h.$clipboard_text_length=null!=(v=null==g?void 0:g.length)?v:0}h.$copy_type=d}return null==(l=this.$s)||l.capture(t,h).catch(e=>a6.error("Failed to capture event",e)),!0}}}isBrowserSupported(){return V(null==l?void 0:l.querySelectorAll)}}class a7{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=G(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.ho(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}}var a9=il("[ExceptionAutocapture]"),oe=()=>{},ot=e=>{var t;if(V(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function oi(e,t,i){try{if(!(t in e))return oe;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});return V(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]!==r)for(var i=e[t],n=ot(i);n;){if(n.next===r)return void(n.next=s.next);n=ot(i=n.next)}else e[t]=s.next}}catch(e){return oe}}var os=il("[TracingHeaders]"),or=il("[Web Vitals]"),on=["CLS","FCP","INP","LCP"],oa=["INP","LCP"],oo=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],ol="disabled",ou="lazy_loading",oh="awaiting_config",oc="missing_config";il("[SessionRecording]"),il("[SessionRecording]");var od="[SessionRecording]",op=il(od),ov=il("[Heatmaps]");function og(e){return G(e)&&"clientX"in e&&"clientY"in e&&Q(e.clientX)&&Q(e.clientY)}var of=il("[Product Tours]"),o_=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(i$))},om=["$set_once","$set"],oy=il("[SiteApps]"),ob="Error while initializing PostHog app with config id ",ow=(e,t)=>null!=e&&e.then?e.then(t):t(e),ox="SDK is not enabled or survey functionality is not yet loaded",ok="Disabled. Not loading surveys.";class oE{constructor(e,t){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ku=!1,this.Su=[],this.xu=null,this.Cu=null,this.Fs=!1,this.Tu=new Set,this.onRemoteConfig=e=>{if(!this.Fs&&!this.gn.disableSurveys){if(!e.ok)return aI.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Z(t))return aI.warn("Flags not loaded yet. Not loading surveys.");this.Mu=ee(t)?t:t.length>0,aI.info("flags response received, isSurveysEnabled: "+this.Mu),this.loadIfEnabled()}},this.Os=e,this.Eu=t}setup(e){if(!this.Fs)return this.Iu=e,ow(e.kv.initialize(),()=>{if(this.Iu===e&&!this.Fs){this.Iu=void 0,this.$s=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.Fs?t.dispose():(this.Ns=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.Fs||(this.Fs=!0,this.Iu=void 0,this.$s=void 0,null==(e=this.Ns)||e.dispose(),this.Ns=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Su=[],this.xu=null,this.Tu.forEach(e
1=>clearTimeout(e)),this.Tu.clear())}get gn(){return this.Os.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var s=localStorage.key(i);(null!=s&&s.startsWith(aA)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this.Fs&&this.$s){var e=this.gn;if(!this._surveyManager)if(this.ku)aI.info("Already initializing surveys, skipping...");else if(e.disableSurveys)aI.info(ok);else if(e.cookielessMode&&this.Os.isOptedOut())aI.info("Not loading surveys in cookieless mode without consent.");else{var t=this.Os.getExtensions();if(t){if(!W(this.Mu)||e.advancedEnableSurveys){var i=this.Mu||e.advancedEnableSurveys;this.ku=!0;try{var s=t.generateSurveys;if(s)return this.Ru(s,i),void(this.ku=!1);var r=t.loadExternalDependency;if(!r)return this.Pu(su),void(this.ku=!1);r(e=>{try{if(this.Fs)return;var t=this.Os.getExtensions();e||null==t||!t.generateSurveys?this.Pu("Could not load surveys script",e):this.Ru(t.generateSurveys,i)}finally{this.ku=!1}})}catch(e){throw this.ku=!1,this.Pu("Error initializing surveys",e),e}}}else aI.error("PostHog Extensions not found.")}}}Ru(e,t){this.Fs||(this._surveyManager=e(t),this._surveyEventReceiver=this.Os.createEventReceiver(),aI.info("Surveys loaded successfully"),this.Au({isLoaded:!0}))}Pu(e,t){aI.error(e,t),this.Au({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Su.push(e),this._surveyManager&&this.Au({isLoaded:!0}),()=>{this.Su=this.Su.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!=(i=this.$s)?i:this.Eu;if(s&&!this.Fs){if(this.gn.disableSurveys)return aI.info(ok),e([]);var r=s.kv.get(iZ);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Fu()&&this.getSurveys(()=>{},!0));if(this.xu)this.xu.then(t=>{this.Fs||e(t.surveys,t.context)}).catch(e=>aI.error("Error in survey callback",e));else{var n=this.Ou("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.gn.requestTimeoutMs}).then(e=>{try{return this.Lu(s,e)}catch(e){return aI.error("Error processing surveys response",e),this.Lu(s,{statusCode:0,error:e})}},e=>this.Lu(s,{statusCode:0,error:e}));this.xu=n;var a=()=>{this.xu===n&&(this.xu=null)};n.then(t=>{a(),this.Fs||e(t.surveys,t.context)},a).catch(e=>aI.error("Error in survey callback",e))}}}Ou(e,t){var i=this.$s;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(ox)}))}Lu(e,t){if(this.Fs)return{surveys:[],context:{isLoaded:!1,error:ox}};var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return 0!==i?aI.error(s):t.error||aI.warn(s),this.Cu=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Cu=null;var r,n=t.json.surveys||[],a=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(ay(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});return a.length>0&&(null==(r=this._surveyEventReceiver)||r.register(a)),e.kv.set({[iZ]:n,[iQ]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}Fu(){return this.Du()&&!this.xu&&!this.$u()}Du(){var e,t,i=null==(e=null!=(t=this.$s)?t:this.Eu)?void 0:e.kv.get(iQ);return Q(i)&&Date.now()-i>3e5}$u(){return Q(this.Cu)&&3e5>Date.now()-this.Cu}markSurveyAsSeen(e,t){var i;aO({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}Au(e){for(var t of this.Su)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){aI.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Z(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);aI.warn("init was not called")}Nu(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}qu(e){if(Z(this._surveyManager))return{eligible:!1,reason:ox};var t="string"==typeof e?this.Nu(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}
1ju(e){if(Z(this._surveyManager))return{eligible:!1,reason:ox};var t="string"==typeof e?this.Nu(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Z(this._surveyManager))return aI.warn("init was not called"),{visible:!1,disabledReason:ox};var t=this.ju(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Z(this._surveyManager)?(aI.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ox})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.ju(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(Z(this._surveyManager))aI.warn("init was not called");else{var r="string"==typeof e?this.Nu(e):e;if(null!=r&&r.id)if(aT.includes(r.type)){var n=null==l?void 0:l.querySelector(t);if(n)if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){aI.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.Tu.delete(a),this.Fs||(aI.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),aI.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.Tu.add(a)}else this._surveyManager.renderSurvey(r,n,i);else aI.warn("Survey element not found")}else aI.warn("Surveys of type "+r.type+" cannot be rendered in the app");else aI.warn("Survey not found")}}displaySurvey(e,t){var i;if(Z(this._surveyManager))aI.warn("init was not called");else{var s=this.Nu(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=w({},s,{appearance:w({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nw&&t.initialResponses&&aI.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.qu(s);if(!n.eligible)return void aI.warn("Survey is not eligible to be displayed: ",n.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else aI.warn("Survey not found")}}cancelPendingSurvey(e){Z(this._surveyManager)?aI.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}function oS(e,t,i){if(Z(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class oP{constructor(e){this.Bu=new Set,this.Hu=new Set,this.zu=new av,this.Uu=(e,t)=>this.Wu(e,t)&&this.Vu(e,t)&&this.Gu(e,t)&&this.Zu(e,t),this.Wu=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e}init(){var e,t;W(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Qu=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.Qu)||e.call(this),this.Qu=void 0,this.zu=new av}register(e){var t,i;if(!W(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Bu.add(e),null==(t=e.steps)||t.forEach(e=>{this.Hu.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.Bu.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(e.selector)})}),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.Bu.clear(),this.Hu.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.Hu.has(e)||this.Hu.has(t.event))&&this.Bu.forEach(e=>{this.Ju(t,e)&&this.zu.emit("actionCaptured",e.name)})}Ku(e){this.onAction("actionCaptured",t=>e(t))}Ju(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Uu(e,i))return!0;return!1}onAction(e,t){return this.zu.on(e,t)}Vu(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!oS(s,t.url,t.url_matching||"contains"))return!1}return!0}Gu(e,t){return!!this.Yu(e,t)&&!!this.Xu(e,t)&&!!this.th(e,t)}Yu(e,t){if(null==t||!t.href)return!0;var i=this.eh(e);if(i.length>0)return i.some(e=>oS(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&oS((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Xu(e,t){if(null==t||!t.text)return!0;var i=this.eh(e);if(i.length>0)return i.some(e=>oS(e.text,t.text,t.text_matching||"exact")||oS(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!Z(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>oS(e,n,a)))}th(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}eh(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Zu(e,t){return null==t||!t.properties||0===t.properties.length||ak(t.properties.reduce((e,t)=>
vendor: 4,853 bytes, line 1
1{var i=z(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class oF{constructor(e){var t;this.ih=[],this._instance=e,this.rh=new Map,this.nh=new Map,this.sh=new Map,this.ah=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.oh(e))}lh(e){return!1}uh(){return null}hh(e){}dh(){}fh(e,t){return!!e&&ak(e.propertyFilters,null==t?void 0:t.properties)}ph(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}gh(e,t,i){var s=(i===nf?this.rh:this.nh).get(e),r=[];return this.mh(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.fh(n,t)})}register(e){this.yh(e,!1)}replace(e){this.yh(e,!0)}yh(e,t){var i;W(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.bh(e,t),this._h(e,t))}_h(e,t){var i,s=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.sh.clear(),0!==s.length){this.wh||(this.wh=new oP(this._instance),this.wh.init(),this.wh.Ku(e=>this.onAction(e)));var r=[];s.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(r.push(t),t.name){var i,s=null!=(i=this.sh.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.sh.set(t.name,s)}})}),t?this.wh.replace(r):this.wh.register(r)}else t&&(null==(i=this.wh)||i.replace([]))}kh(e,t){t.forEach((t,i)=>{var s,r=null!=(s=e.get(i))?s:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}bh(e,t){var i,s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),n=this.ph(e,nf),a=this.ph(e,n_);t?(this.rh=n,this.nh=a):(this.kh(this.rh,n),this.kh(this.nh,a)),(0!==s.length||0!==r.length)&&(null!=this.Qu||(this.Qu=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.Sh(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.xh(e,n);if("consume"===a)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Ch([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Th(n),void this.Mh([n])}if(this.nh.has(e)){var o=this.gh(e,t,n_);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Ch(o.map(e=>e.id)),o.forEach(e=>this.Eh(e.id)))}if(this.rh.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.rh.get(e)});var l=this.gh(e,t,nf);this.Ih(l.map(e=>e.id))}}onAction(e){this.sh.has(e)&&this.Ih(this.sh.get(e)||[])}Ih(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),s=[];for(var r of e)i&&this.lh(r)?this.Th(r)&&this.Rh(r):s.push(r);s.length>0&&(this.ih=[...new Set([...this.ih,...s])]),this.Sh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Th(e){this.ih=this.ih.filter(t=>t!==e);var t=this.Ph();return!t.includes(e)&&(this.Ah([...t,e]),this.Fh(),!0)}Ch(e){var t=new Set(e);this.ih=this.ih.filter(e=>!t.has(e));var i=this.Oh(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Ah(s),0===s.length&&this.Lh()),this.Mh(e)}Dh(){var e,t=this.uh();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Rh(e){if(this.uh()){var t=this.Dh();this.hh(w({},t,{[e]:Date.now()}))}}Mh(e){if(this.uh()){var t=this.Dh(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],a=r[1];e.includes(n)?s=!0:i[n]=a}s&&(U(i)?this.dh():this.hh(i))}}$h(){this.uh()&&this.dh()}getActivationTimestamp(e){if(this.Ph().includes(e)){var t=this.Dh()[e];return Q(t)?t:void 0}}Oh(){var e,t=this.Nh();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Ph(){var e,t,i=this.Oh();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.qh()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}Fh(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.jh(t)}Lh(){this.Bh()}oh(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.qh()];if(i&&i!==e){var s=this.Oh(),r=this.Dh();s.length>0&&(this.Ah([]),s.filter(e=>
1Q(r[e])).forEach(e=>this.Eh(e))),this.Lh(),this.$h()}}getActivatedIds(){return[...new Set([...this.Ph(),...this.ih])].filter(e=>!this.Hh(e))}dispose(){var e,t,i;null==(e=this.ah)||e.call(this),this.ah=void 0,null==(t=this.Qu)||t.call(this),this.Qu=void 0,null==(i=this.wh)||i.dispose(),this.wh=void 0}reset(){this.ih=[],this.Oh().length>0&&this.Ah([]),this.Lh(),this.$h()}getEventToItemsMap(){return this.rh}zh(){return this.wh}}class o$ extends oF{constructor(e){super(e)}Nh(){return iX}qh(){return i0}uh(){return i1}hh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i1]:e})}dh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i1)}lh(e){this.mh(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return Q(s)&&s>0}Uh(){return nm}mh(e){var t;null==(t=this._instance)||t.getSurveys(e)}Eh(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Sh(){return aI}Ah(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iX]:e})}jh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i0]:e})}Bh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i0)}Hh(){return!1}xh(e,t){var i,s,r;return this.mh(e=>{r=e.find(e=>e.id===t)}),!r||ay(i=r)&&!(null==(s=i.conditions)||null==(s=s.events)||!s.repeatedActivation)||"always"===i.schedule?e===nm?"consume":"ignore":e===nm?"persist":e===ny||e===nb?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class oC{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);var t={};for(var i of e){var s=this._instance.get_property(i);W(s)||(t[i]=s)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}}class oI{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=null==_?void 0:_.__PosthogExtensions__;if(e){var t=e.generateSurveys,i=e.loadExternalDependency;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}}createEventReceiver(){return new o$(this._instance)}}var oA=null!=n&&n.location?rZ(n.location.hash,"__posthog")||rZ(location.hash,"state"):null,oO="_postHogToolbarParams",oT=il("[Toolbar]"),oM=il("[FeatureFlags]");class oR{constructor(e,t){void 0===t&&(t=!1),this.Wh=!1,this.update(e,t)}update(e,t){var i,s,r,n,a;this.Vh={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(s=e.bootstrap)?void 0:s.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(r=e.remote_config_refresh_interval_ms)?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(n=null!=(a=e.evaluation_contexts)?a:e.evaluation_environments)?n:[],flagKeys:z(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.Wh||(oM.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wh=!0),W(e.flag_keys)||z(e.flag_keys)||oM.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Vh}}var oL=il("[FeatureFlags]"),oD=il("[FeatureFlags]",{debugEnabled:!0}),oj="\" failed. Feature flags didn't load in time.",oN="connection_error",oq=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oB=e=>{var t={};for(var i of sE(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},oH=il("[Error tracking]"),oz="webkit-masked-url:",oV=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",oz],oG=["__firefox__","__gCrWeb"],oU="Refusing to render web experiment since the viewer is a likely bot",oW={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>ab(t,e),not_regex:(e,t)=>!ab(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e};class oK{get gn(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{oK.Gh("retrieved web experiments from the server"),t.Zh=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Zh&&(oK.Gh("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Zh)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);K(s)&&e.variants[s]&&t.Qh(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];oK.Jh(n,t._instance)&&t.Qh(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())oK.Gh(oU);else if(!this.gn.disable_web_experiments){if(Z(this.Zh))return this.Zh=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oK.Gh("applying feature flags",e),e.forEach(e=>{var t;if(this.Zh&&null!=(t=this.Zh)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Zh)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Qh(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=oK.getWindowLocation();if(null!=e&&e.search){var t=rJ(null==e?void 0:e.search,"__experiment_id"),i=rJ(null==e?void 0:e.search,"__experiment_variant");t&&i&&(oK.Gh("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Kh(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.gn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.gn.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.gn.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Kh(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(oK.Gh("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Qh(s[0].name,t,s[0].variants[t].transforms))}static Jh(e,t){return!Z(e.conditions)&&oK.Yh(e,t)&&oK.Xh(e)}static Yh(e,t){if(Z(e.conditions)||Z(null==(s=e.conditions)?void 0:s.url))return!0;var i=oK.getWindowLocation();if(i){var s,r,n,a,o=s7(t,i.href);return null==(r=e.conditions)||!r.url||oW[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==n?void 0:n.location}static Xh(e){if(Z(e.conditions)||Z(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r6();if(t.utm_source){var i,s,r,n,a,o,l,u,h,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&p&&v&&d}return!1}static Gh(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];io.info("[WebExperiments] "+e,i)}Qh(e,t,i){this._is_bot()?oK.Gh(oU):"control"!==t?i.forEach(i=>{if(i.selector){oK.Gh("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):oK.Gh("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?a_(o,this.gn.custom_blocked_useragents):void 0}}var oJ=il("[Conversations]"),oY="Conversations not available yet.";function oZ(e,t){var i,s,r,n,a,l,u,h=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,c=null!=(s=null==e?void 0:e.maxBufferSize)?s:100,d=null!=t&&t.consoleCapture?void 0:null!=(r=null==e?void 0:e.maxLogsPerInterval)?r:1e3,p=W(d)?Math.max(c,2048):Math.max(c,d),v=w({},function(){var e,t,i,s="",r="";try{var n=null==o?void 0:o.userAgent;if(n){var a=tl(n);s=a[0],r=a[1]}}catch(e){}return e=s,t=r,i=function(e){if(e)return({}).hasOwnProperty.call(tO,e)?tO[e]:e}(e),w({},i?{"os.name":i}:{},t?{"os.version":t}:{})}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(a=null==v?void 0:v["service.name"])?a:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(l=null==v?void 0:v["service.version"])?l:null==e?void 0:e.serviceVersion,environment:null!=(u=null==v?void 0:v["deployment.environment"])?u:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:h,maxBufferSize:c,maxQueueSize:p,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var oQ=["debug","log","warn","error","info"],oX="console",o0="__posthogHandledLogsRequestError",o1=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[o0]=!0,i},o2=e=>!!e&&"object"==typeof e&&!0===e[o0],o3={featureFlags:class{constructor(e){this.name="featureFlags",this.td=!1,this.featureFlagEventHandlers=[],this.A=oL,this.ed={},this.rd={},this.nd=[],this.sd=!1,this.ad=!1,this.od=0,this.ld=!1,this.ud=!1,this.hd=!1,this.dd=!1,this.vd=0,this.zt=()=>{var e=this.fd();this.vd=0,e&&this.reloadFeatureFlags()},this.pd=()=>{var e,t=this.gd;W(t)||this.gn.remoteRequestsDisabled||!l||"hidden"===l.visibilityState||Date.now()-(null!=(e=this.md)?e:0)<t||(this.reloadFeatureFlags(),this.yd())},this.Wt=()=>{"visible"===(null==l?void 0:l.visibilityState)&&this.pd()},"get"in e?this.Os=e:(this._instance=e,this.bd=new oR(e.config,e.ho()),this.Os=this.bd)}updateConfig(e,t){var i;null==(i=this.bd)||i.update(e,t),this.$s&&this._d()}setup(e){return this.Iu=e,this.A=e.logger.createLogger("[FeatureFlags]"),ow(e.kv.initialize(),()=>{this.Iu===e&&(this.Iu=void 0,this.$s=e,this.wd(e))})}wd(e){var t;if(this.$s===e)return n&&sC(n,"online",this.zt),this._d(),this.kd=e.registerDynamicEventProperties(()=>this.Sd()?this.ed:this.rd),this.xd=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Cd(),this.Td()}),this.Cd(),this.initialize()}_d(){var e=this.gn.refreshIntervalMs,t=!this.gn.remoteRequestsDisabled&&l&&!W(e)&&e>0?e:void 0;t!==this.gd&&(this.Md(),W(t)||(this.gd=t,this.yd(),null!=l&&l.addEventListener&&sC(l,sg,this.Wt)))}yd(){W(this.gd)||(W(this.Ed)||clearInterval(this.Ed),this.md=Date.now(),this.Ed=setInterval(this.pd,this.gd))}Md(){W(this.Ed)||(clearInterval(this.Ed),this.Ed=void 0,null==l||null==l.removeEventListener||l.removeEventListener(sg,this.Wt)),this.gd=void 0,this.md=void 0}destroy(){this.Id()}dispose(){this.Id()}Id(){var e,t;this.Md(),this.od++,this.ud=!1,this.Iu=void 0,this.$s&&(this.Rd(),null==(e=this.kd)||e.dispose(),this.kd=void 0,null==(t=this.xd)||t.call(this),this.xd=void 0,this.nd=[],null==n||n.removeEventListener("online",this.zt),this.$s=void 0)}get gn(){return this.Os.get()}Pd(e){var t;return null==(t=this.$s)?void 0:t.kv.get(e)}ii(e){this.Ad(()=>{var t;return null==(t=this.$s)?void 0:t.kv.set(e)})}Fd(e,t,i){var s;if(null!=(s=this._instance)&&s.persistence&&e[iN]){var r=this.Pd(iN)||{},n=e[iN]||{},a=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(e=>{var t=e[1];return!(null!=t&&t.failed)}).map(e=>e[0]):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,u=l?o:i&&!z(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(r),...Object.keys(n)])),h=this.Pd(iz)||{},c=e[iz]||{},d=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(c)])),p=!l&&!i,v=!!p||u,g={[iq]:v,[iN]:v,[iz]:!!p||d};for(var f of(e[iH]&&(g[iH]=v),[iV,i8,iG]))W(e[f])||(g[f]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}ai(e){this.Ad(()=>{var t;return null==(t=this.$s)?void 0:t.kv.remove(e)})}Ad(e){try{e()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Cd(){var e={};for(var t of[iq,iz,iV,iU]){var i=this.Pd(t);W(i)||(e[t]=i)}this.ed=e;var s=w({},e),r=this.Pd(iN);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.rd=s}Sd(){var e=this.gn.cacheTtlMs;
1if(!e||0>=e)return!1;var t=this.Pd(i8);return"number"!=typeof t||Date.now()-t>e}Od(){return!!this.Sd()&&(this.dd||this.ad||(this.dd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ld(){var e=this.gn.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Dd(){var e=this.gn.flagKeys;if(!W(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.gn,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.$d({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.Pd(iN))?s:{},a=null!=i&&i.merge&&null!=(r=this.Pd(iz))?r:{},o=w({},n,e),l=w({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:E(d),variant:S(d),reason:void 0,metadata:W(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.$d({flags:u})}get hasLoadedFlags(){return this.sd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Pd(iH),t=this.Pd(iU),i=this.Pd(iW);if(!i&&!t)return e||{};var s=sk({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=W(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,h=W(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=w({},o,{enabled:u,variant:u?null!=h?h:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),h!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),c&&(d.metadata=w({},null==o?void 0:o.metadata,{payload:c,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.td||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.td=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:E(s),variant:S(s),payload:k(t[i])}})}getFlagVariants(){var e=this.Pd(iN),t=this.Pd(iU);if(!t)return e||{};for(var i=sk({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.td||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.td=!0),i}getFlagPayloads(){var e=this.Pd(iz),t=this.Pd(iW);if(!t)return e||{};for(var i=sk({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.td||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.td=!0),i}reloadFeatureFlags(){this.ld||this.gn.featureFlagsDisabled||this.fd()||this.Nd||(this.nd.slice().forEach(e=>{try{e()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.Nd=setTimeout(()=>{this.qd()},5))}Rd(){clearTimeout(this.Nd),this.Nd=void 0}onReloading(e){return this.nd.push(e),()=>{this.nd=this.nd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.sd||this.ad||this.Nd||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ld=e}resetFlagCallReported(){this.ai(i3)}qd(e){this.Rd();var t=this.$s;if(t&&!this.gn.remoteRequestsDisabled&&!this.fd())if(this.ad)this.ud=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:w({},t.initialPersonProperties,this.Pd(iK)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Pd(iJ),timezone:ns()};W(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.gn.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.Ld();s.length&&(i.evaluation_contexts=s);var r=this.Dd();W(r)||(i.flag_keys=r);var n=this.gn.onlyEvaluateSurveyFeatureFlags,a=this.od;this.ad=!0;var o=()=>{this.ud&&(this.ud=!1,this.qd())},l=e=>{this.ad=!1,a===this.od&&(this.ii({[i6]:[oN]}),this.A.error("Feature flag request failed",e)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:this.gn.compression,sentAt:"body",timeoutMs:this.gn.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this.ad=!1,a===this.od){if(this.jd(e.statusCode),l||this.ud||(this.$anon_distinct_id=void 0),!i.disable_flags||this.ud){this.hd=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oN:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.ii({[i6]:u}),h?this.A.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."):i.disable_flags||this.$d(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}fd(){return rQ(this.vd,3)}jd(e){this.vd=rX(e,this.vd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else this.A.warn('getFeatureFlag for key "'+e+oj)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.Pd(iV)||void 0,u=this.Pd(i8)||void 0,h=this.Pd(i3)||{};if(this.gn.deduplicateCallsPerSession){var c,d=null==(c=this.$s)?void 0:c.session.sessionId,p=this.Pd(i5);d&&d!==p&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.ii({[i3]:h,[i5]:i});else if(e in h&&h[e].includes(o))i&&this.ii({[i3]:h,[i5]:i});else{z(h[e])?h[e].push(o):h[e]=[o],this.ii(w({[i3]:h},i?{[i5]:i}:{}));var v=this.getFeatureFlagDetails(e),g=[...null!=(_=this.Pd(i6))?_:[]];W(n)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!=(m=null==(y=this.gn.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])?m:null,$feature_flag_bootstrapped_payload:null!=(b=null==(x=this.gn.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])?b:null,$used_bootstrap_value:!this.hd};W(null==v||null==(E=v.metadata)?void 0:E.has_experiment)||(f.$feature_flag_has_experiment=v.metadata.has_experiment),W(null==v||null==(S=v.metadata)?void 0:S.version)||(f.$feature_flag_version=v.metadata.version);var _,m,y,b,x,E,S,P,F,$,C,I,A,O=null!=(P=null==v||null==(F=v.reason)?void 0:F.description)?P:null==v||null==($=v.reason)?void 0:$.code;O&&(f.$feature_flag_reason=O),null!=v&&null!=(C=v.metadata)&&C.id&&(f.$feature_flag_id=v.metadata.id),W(null==v?void 0:v.original_variant)&&W(null==v?void 0:v.original_enabled)||(f.$feature_flag_original_response=W(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(I=v.metadata)&&I.original_payload&&(f.$feature_flag_original_payload=null==v||null==(A=v.metadata)?void 0:A.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this.Bd(f)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k(a)}}}else this.A.warn('getFeatureFlagResult for key "'+e+oj)}Bd(e){try{var t;null==(t=this.$s)||t.capture("$feature_flag_called",e).catch(e=>{this.A.error("Failed to capture feature flag call",e)}
1)}catch(e){this.A.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Hd(e,t)}Hd(e,t){var i=this;return b(function*(){var s=i.$s;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.Ld();n.length&&(r.evaluation_contexts=n);var a,o=i.Dd();W(o)||(r.flag_keys=o);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:i.gn.compression,sentAt:"body",timeoutMs:i.gn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[e])||void 0}catch(e){return void i.A.error("Remote config feature flag request failed",e)}try{t(a)}catch(e){i.A.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.hd)return t.defaultValue;if(!(this.sd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+oj),t.defaultValue;var i=this.getFeatureFlag(e,t);return W(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.$d(e,t,i)}$d(e,t,i){if(this.$s){this.sd=!0;var s=function(e,t,i,s,r,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n=oL);var a,o,l=(a=n,(o=e.flags)?w({},e,{featureFlags:Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return!W(null==(t=o[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&a.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,p=e.evaluatedAt;if(z(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var g=0;h.length>g;g++)v[h[g]]=!0;return{[iq]:h,[iN]:v,[iG]:!1}}var f=h,_=c,m=u;if(null!=r&&r.partialResponse){var y=Object.keys(f),b=_||{};f=w({},t,f),_=w({},i,b),y.forEach(e=>{var t;e in b||null==(t=_)||delete t[e]}),m=w({},s,m)}else if(e.errorsWhileComputingFlags)if(u){var x=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));f=w({},t,Object.fromEntries(Object.entries(f).filter(e=>x.has(e[0]))));var k=Object.fromEntries(Object.entries(_||{}).filter(e=>x.has(e[0])));_=w({},i,k),x.forEach(e=>{var t;e in k||null==(t=_)||delete t[e]}),m=w({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>x.has(e[0]))))}else f=w({},t,f),_=w({},i,_),m=w({},s,m);return w({[iq]:Object.keys(oB(f)),[iN]:f||{},[iz]:_||{},[iH]:m||{},[iG]:!0===e.minimalFlagCalledEvents},d?{[iV]:d}:{},p?{[i8]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);s&&(this.Fd(s,e,!(null==i||!i.partialResponse)),this.ii(s)),t||(this.dd=!1),this.Td(t)}}override(e,t){void 0===t&&(t=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.zd(e)}zd(e){if(this.$s){if(!1===e)return this.ai([iU,iW]),this.Td(),void oD.info("All overrides cleared");if(z(e))return this.ii({[iU]:oq(e)}),this.Td(),void oD.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.td=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iU]=z(s)?oq(s):s),r&&(i[iW]=r),Object.keys(i).length&&this.ii(i),!1===s&&!1===r?this.ai([iU,iW]):!1===s?this.ai(iU):!1===r&&this.ai(iW),this.Td(),!1===s?oD.info("Flag overrides cleared"):s&&oD.info("Flag overrides set",{flags:s}),void(!1===r?oD.info("Payload overrides cleared"):r&&oD.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.ii({[iU]:e}),this.Td(),void oD.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.sd){var t=this.Ud(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.A.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r,n=(this.Pd(iB)||[]).find(t=>t.flagKey===e),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);var l=w({},this.getFlagVariants(),{[e]:t});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[iq]:[e],[iN]:[e],[iK]:Object.keys(a)}),this.ii({[iq]:Object.keys(oB(l)),[iN]:l,[iK]:w({},this.Pd(iK)||{},a)}),this.Td();try{null==(s=this.$s)||s.capture("$feature_enrollment_update",o).catch(e=>{this.A.error("Failed to capture early access feature enrollment",e)})}catch(e){this.A.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.Pd(iB);!s||t?this.Wd(e,i):e(s)}Wd(e,t){var i=this;return b(function*(){var s=i.$s;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var a=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.ii({[iB]:r=a.json.earlyAccessFeatures})}catch(e){return void i.A.error("Early access feature request failed",e)}try{e(r)}catch(e){i.A.error("Early access feature callback failed",e)}}})()}Ud(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}Td(e){this.Cd();var t=this.Ud(),i=t.flags,s=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.A.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Vd(e,t)}Vd(e,t){void 0===t&&(t=!0);var i=this.Pd(iK)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this.ii({[iK]:w({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=w({},this.Pd(iK)||{});e.forEach(e=>{delete i[e]}),this.ii({[iK]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.ai(iK),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.Pd(iJ)||{},s=w({},i);for(var r of Object.keys(e))s[r]=w({},i[r],e[r]);this.ii({[iJ]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Pd(iJ)||{};this.ii({[iJ]:w({},t,{[e]:{}})})}else this.ai(iJ)}reset(){this.od++,this.ud=!1,this.ed={},this.rd={},this.sd=!1,this.ld=!1,this.hd=!1,this.$anon_distinct_id=void 0,this.Rd(),this.td=!1,this.vd=0}}},o5=w({productTours:class{get $o(){return this._instance.persistence}constructor(e){this.ac=null,this.oc=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.$o&&this.$o.register({[i$]:!!s.productTours}),!o_(this._instance))return!this.ac&&Z(null==(t=this.$o)?void 0:t.props[i2])||of.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.ac)||i.stop(),this.ac=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ac&&o_(this._instance)&&this.Ks(()=>this.lc())}Ks(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?of.error("Could not load product tours script",t):e()})}lc(){var e;!this.ac&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.ac=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!z(this.oc)||t){var i=this.$o;if(i){var s=i.props[i2];if(z(s)&&!t)return this.oc=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(o_(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||of.warn(r):of.error(r),void e([],{isLoaded:!1,error:r})}var n=z(t.json.product_tours)?t.json.product_tours:[];this.oc=n,i&&i.register({[i2]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.oc,{isLoaded:!0})}getActiveProductTours(e){Z(this.ac)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.ac.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.ac)||t.showTourById(e)}previewTour(e){this.ac?this.ac.previewTour(e):this.Ks(()=>{var t;this.lc(),null==(t=this.ac)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.ac)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.ac)||e.nextStep()}previousStep(){var e;null==(e=this.ac)||e.previousStep()}clearCache(){var e;this.oc=null,null==(e=this.$o)||e.unregister(i2)}resetTour(e){var t;null==(t=this.ac)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.ac)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.ac)||t.cancelPendingTour(e)}}},o3),o6=w({surveys:class extends oE{constructor(e){var t;super(new oI(e),{get projectToken(){return t.config.token},kv:new oC(t=e)}),this._instance=e}Ou(e,t){var i=t.query?n4(e,t.query):e;return new Promise(e=>{var s;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},o3),o8=w({experiments:oK},o3),o4=w({},o3,{sessionRecording:class{get gn(){return this._instance.config}get $o(){return this._instance.persistence}get started(){var e;
1return!(null==(e=this.Gd)||!e.isStarted)}get status(){var e,t;return this.Zd===oh||this.Zd===oc?this.Zd:null!=(e=null==(t=this.Gd)?void 0:t.status)?e:this.Zd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Zd=ol,this.Qd=void 0,this.Jd=!1,this.qt=(()=>{if(null==l||!l.visibilityState||"visible"===l.visibilityState)return!0;var e,t=null==n||null==(e=n.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Wt=()=>{var e;"visible"===(null==l?void 0:l.visibilityState)&&(this.qt=!0,null==(e=this.Gd)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw op.error("started without valid sessionManager"),Error(od+" started without valid sessionManager. This is a bug.");if(this.gn.cookieless_mode===sc)throw Error(od+' cannot be used with cookieless_mode="always"');null!=l&&l.addEventListener&&sC(l,"visibilitychange",this.Wt)}initialize(){this.startIfEnabledOrStop()}dispose(e){var t=(void 0===e?{}:e).discardBufferedEvents;this.Jd=!0,null==l||null==l.removeEventListener||l.removeEventListener("visibilitychange",this.Wt),void 0!==t&&t?this.Kd(!0):this.stopRecording()}get Yd(){var e,t=!(null==(e=this._instance.get_property(iA))||!e.enabled),i=!this.gn.disable_session_recording,s=this.gn.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.Jd||this.Yd&&null!=(t=this.Gd)&&t.isStarted)){var i=!W(Object.assign)&&!W(Array.from);this.Yd&&i?(this.Xd(e),op.info("starting")):(this.Zd=ol,this.stopRecording())}}Xd(e){var t,i;if(this.Yd)if(this.Zd!==oh&&this.Zd!==oc&&(this.Zd=ou),null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording)this.tv(e);else{var s,r=this._instance.sessionManager;null==(s=_.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.ev,t=>{if(!this.Jd&&this.Yd&&this._instance.sessionManager===r)return t?(this._instance.register_for_session({[sl]:!0}),op.error("could not load recorder",t)):void this.tv(e);this.Zd=ol})}}stopRecording(){var e,t;null==(e=this.Qd)||e.call(this),this.Qd=void 0,null==(t=this.Gd)||t.stop()}Kd(e){var t,i;void 0===e&&(e=!1),null==(t=this.Qd)||t.call(this),this.Qd=void 0,null==(i=this.Gd)||i.discard({discardProducerEvents:e})}iv(){var e,t;null==(e=this.$o)||e.unregister(ij),null==(t=this.$o)||t.unregister(iO)}rv(e,t){if(Z(e))return null;var i=Q(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(op.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}nv(e){if(this.$o){var t,i,s=this.$o,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.rv(null==(t=this.gn.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.rv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;Z(a)&&this.iv();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[iA]:w({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:w({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:W(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.Qd)||t.call(this),this.Qd=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.nv(t),void this.Kd()):(this.nv(t),void this.startIfEnabledOrStop()):(this.Zd===oh&&(this.Zd=oc,op.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Gd)&&i.log?this.Gd.log(e,t):op.warn("log called before recorder was ready")}get ev(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(iA);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}sv(){var e,t=this._instance.get_property(iA);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return op.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!Z(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}tv(e){var t,i,s,r;if(!this.Jd&&this.Yd&&this._instance.sessionManager){if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)return op.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[sl]:!0});if(this.Gd||(this.Gd=null==(r=_.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.qt),this.Gd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.sv()){if(this.Zd===oc||this.Zd===oh)return;return this.Zd=oh,op.info("persisted remote config is stale, requesting fresh config before starting"),void new nS(this._instance).load()}this.Zd=ou,null==(i=(s=this.Gd).setDocumentWasEverVisible)||i.call(s,this.qt),this.Gd.start(e)}else this.Zd=ol}onRRwebEmit(e){var t;null==(t=this.Gd)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Gd||null==(t=this.$o)||t.register({[iM]:!0}),null==(e=this.Gd)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Gd||null==(t=this.$o)||t.register({[iT]:!0}),null==(e=this.Gd)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Gd||null==(i=this.$o)||i.register({["url"===e?iR:iL]:!0}),null==(t=this.Gd)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Gd)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Gd)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class extends a4{constructor(e){super(new a7(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.av=this.ov()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.lv();return!!(e.path||e.search||this.uv(e))}startIfEnabled(){this.isEnabled&&(io.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.av=this.ov(),this.startIfEnabled()}stop(){this.hv&&this.hv(),this.hv=void 0,this.dv&&this.dv(),this.dv=void 0,io.info("History API monitoring stopped")}monitorHistoryChanges(){n&&n.history&&(this.vv("pushState"),this.vv("replaceState"),this.fv(),this.uv()&&this.pv())}vv(e){var t;if(n&&(null==(t=n.history[e])||!t.__posthog_wrapped__)){var i=this;oi(n.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.gv(e)})}}ov(){var e=null==n?void 0:n.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}lv(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:G(e)?e:{}}uv(e){return void 0===e&&(e=this.lv()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}mv(e){var t=this.lv(),i=this.av;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.uv(t)&&e.hash!==i.hash))}gv(e){try{var t=this.ov();if(!t)return;this.mv(t)&&this._instance.capture(s_,{navigation_type:e}),this.av=t}catch(t){io.error("Error capturing "+e+" pageview",t)}}fv(){if(!this.hv){var e=()=>{this.gv("popstate")};sC(n,"popstate",e),this.hv=()=>{n&&n.removeEventListener("popstate",e)}}}pv(){if(!this.dv){var e=()=>{this.gv("hashchange")};sC(n,"hashchange",e),this.dv=()=>{n&&n.removeEventListener("hashchange",e)}}}},heatmaps:class{get gn(){return this.instance.config}constructor(e){var t;this.yv=!1,this.Is=!1,this.bv=null,this.instance=e,this.yv=!(null==(t=this.instance.persistence)||!t.props[ix]),this.rageclicks=new a3(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return G(this.gn.capture_heatmaps)&&this.gn.capture_heatmaps.flush_interval_milliseconds&&(e=this.gn.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Z(this.gn.capture_heatmaps)?Z(this.gn.enable_heatmaps)?this.yv:this.gn.enable_heatmaps:!1!==this.gn.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Is||(ov.info("starting..."),this._v(),this.Wt());else{var e;clearInterval(null!=(e=this.bv)?e:void 0),this.wv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ix]:i}),this.yv=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.Dt;return this.Dt=void 0,e}Sv(e){og(e.originalEvent)&&this.Ki(e.originalEvent,"deadclick")}Wt(){this.bv&&clearInterval(this.bv),this.bv="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Mo.bind(this),this.flushIntervalMilliseconds):null}
vendor: 5,192 bytes, line 1
1_v(){n&&l&&(this.xv=this.Mo.bind(this),sC(n,sf,this.xv),this.Cv=e=>this.Ki(e||(null==n?void 0:n.event)),sC(l,"click",this.Cv,{capture:!0}),this.Tv=e=>this.Mv(e||(null==n?void 0:n.event)),sC(l,"mousemove",this.Tv,{capture:!0}),this.Ev=new rD(this.instance,rR,this.Sv.bind(this)),this.Ev.startIfEnabledOrStop(),this.Iv=this.Wt.bind(this),sC(l,sg,this.Iv),this.Is=!0)}wv(){var e;n&&l&&(this.xv&&n.removeEventListener(sf,this.xv),this.Cv&&l.removeEventListener("click",this.Cv,{capture:!0}),this.Tv&&l.removeEventListener("mousemove",this.Tv,{capture:!0}),this.Iv&&l.removeEventListener(sg,this.Iv),clearTimeout(this.Rv),null==(e=this.Ev)||e.stop(),this.Is=!1)}Pv(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&rt(s)&&!ri(s,"body")&&s!==i;){var r,a,o,l=void 0;try{l=null==(r=null!=(a=null==(o=s.ownerDocument)?void 0:o.defaultView)?a:n)?void 0:r.getComputedStyle(s).position}catch(e){break}if(L(t,l))return!0;s=rp(s)}return!1}(rh(e),["fixed","sticky"],r);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}Ki(e,t){var i;if(void 0===t&&(t="click"),!re(e.target)&&og(e)){var s=this.Pv(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rb(rh(e),this.instance.config.rageclick)&&this.ys(w({},s,{type:"rageclick"})),this.ys(s)}}Mv(e){!re(e.target)&&og(e)&&(clearTimeout(this.Rv),this.Rv=setTimeout(()=>{this.ys(this.Pv(e,"mousemove"))},500))}ys(e){if(n){var t=this.gn.disable_capture_url_hashes?tp(n.location.href):n.location.href,i=this.gn.custom_personal_data_properties,s=rY(t,this.gn.mask_personal_data_properties?[...r1,...i||[]]:[],r3);this.Dt=this.Dt||{},this.Dt[s]||(this.Dt[s]=[]),this.Dt[s].push(e)}}Mo(){this.Dt&&!U(this.Dt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rD,webVitalsAutocapture:class{constructor(e){var t;this.yv=!1,this.Is=!1,this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Av=()=>{clearTimeout(this.Fv),this.Fv=void 0,0!==this.Dt.metrics.length&&(this._instance.capture("$web_vitals",w({$current_url:this.Dt.url},this.Dt.metrics.reduce((e,t)=>w({},e,{["$web_vitals_"+t.name+"_event"]:w({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ov=e=>{var t;if(this.Dt=this.Dt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Z(null==e?void 0:e.name)||Z(null==e?void 0:e.value))or.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.Lv(i);if(!W(s)){var r=Q(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.Dv||this.Dv>e.value){this.Dt.navigationKey!==r&&(this.Av(),this.Fv=setTimeout(this.Av,this.flushToCaptureTimeoutMs)),W(this.Dt.navigationKey)&&(this.Dt.navigationKey=r,this.Dt.url=s),this.Dt.firstMetricTimestamp=W(this.Dt.firstMetricTimestamp)?Date.now():this.Dt.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=w({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete a.entries,G(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var o={};for(var l of oo){var u="url"===l&&"string"==typeof e.attribution[l]?this.Lv(e.attribution[l]):e.attribution[l];W(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;W(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.Dt.metrics.push(a),this.Dt.metrics.length===this.allowedMetrics.length&&this.Av()}else or.error("Ignoring metric with value >= "+this.Dv,e)}}},this.$v=()=>{if(!this.Is){var e,t,i,s,r=!1,n=_.__PosthogExtensions__,a=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Nv])||("web-vitals"===this.Nv&&W(a)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!W(o)){var l=o.withoutAttribution,u=this.attributionMetrics;r=!W(l),e=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,t=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,s=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(e&&t&&i&&s){var h={reportSoftNavs:this.useSoftNavs},c=r&&this.attributionMetrics.indexOf("INP")>-1?w({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&s(this.Ov.bind(this),c),this.Is=!0}else or.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.yv=!(null==(t=this._instance.persistence)||!t.props[iP]),this.startIfEnabled()}get qv(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=G(this.qv)?null==(e=this.qv)?void 0:e.web_vitals_allowed_metrics:void 0;return Z(i)?(null==(t=this._instance.persistence)?void 0:t.props[iI])||on:i}get flushToCaptureTimeoutMs(){return(G(this.qv)?this.qv.web_vitals_delayed_flush_ms:void 0)||5e3}
1get attributionMetrics(){var e=G(this.qv)?this.qv.web_vitals_attribution:void 0;return ee(e)?e?on:[]:z(e)?e:oa}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e=G(this.qv)?this.qv.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Dv(){var e=G(this.qv)&&Q(this.qv.__web_vitals_max_value)?this.qv.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return or.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=G(this.qv)?this.qv.web_vitals:ee(this.qv)?this.qv:void 0;return ee(t)?t:this.yv}startIfEnabled(){this.isEnabled&&!this.Is&&(or.info("enabled, starting..."),this.Ks(this.$v))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=G(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=G(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[iP]:i}),this._instance.persistence.register({[iI]:s})),this.yv=i,this.startIfEnabled()}}}get Nv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ks(e){var t=_.__PosthogExtensions__,i=this.Nv,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&W(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?or.error("failed to load script",t):e()})}Lv(e){var t=e||(null==n?void 0:n.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tp(t):t,s=this._instance.config.custom_personal_data_properties;return rY(i,this._instance.config.mask_personal_data_properties?[...r1,...s||[]]:[],r3)}or.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.$v=()=>{var e;if(n&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jv&&this.gn.capture_unhandled_errors&&(this.jv=t(this.captureException.bind(this))),!this.Bv&&this.gn.capture_unhandled_rejections&&(this.Bv=i(this.captureException.bind(this))),!this.Hv&&this.gn.capture_console_errors&&(this.Hv=s(this.captureException.bind(this)))}catch(e){a9.error("failed to start",e),this.zv()}}},this._instance=e,this.Uv=!(null==(t=this._instance.persistence)||!t.props[ik]),this.pe=new ec(w({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(s=null!=(r=e.exceptionRateLimiterBucketSize)?r:e.__exceptionRateLimiterBucketSize)?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,A:a9})),this.gn=this.Wv(),this.startIfEnabledOrStop()}Wv(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return G(e)?t=w({},t,e):(W(e)?this.Uv:e)&&(t=w({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.gn.capture_console_errors||this.gn.capture_unhandled_errors||this.gn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(a9.info("enabled"),this.zv(),this.Ks(this.$v)):this.zv()}Ks(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return a9.error("failed to load script",t);e()})}zv(){var e,t,i;null==(e=this.jv)||e.call(this),this.jv=void 0,null==(t=this.Bv)||t.call(this),this.Bv=void 0,null==(i=this.Hv)||i.call(this),this.Hv=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Uv=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[ik]:this.Uv}),this.gn=this.Wv(),this.startIfEnabledOrStop())}}onConfigChange(){this.gn=this.Wv()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.pe.consumeRateLimit(r)?a9.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.Vv=[],this.Gv=new tB([new tQ,new t7,new t0,new tX,new t8,new t6,new t2,new t4],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tZ.test(o)?o.replace(tZ,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}if(!r.length)return[];var c=Array.from(r);return c.reverse(),c.slice(0,50).map(e=>w({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tW,tY)),this._instance=e,this.Vv=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(iE))?t:[],this.Zv=is(this.Qv()),this.Jv=new ir(this.Zv)}onConfigChange(){this.Zv=is(this.Qv()),this.Jv.setConfig(this.Zv)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!=(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)?t:[],a=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.Vv=n,this._instance.persistence&&this._instance.persistence.register({[iE]:this.Vv,[iS]:a})}}}get Kv(){var e,t=!!this._instance.get_property(iS),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Gv.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Zv.enabled)try{if(!K(e)||0===e.trim().length)return void oH.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(it.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.Yv(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&oH.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Jv.add(w({[t9]:e,[ie]:(new Date).toISOString()}
1,s))}catch(e){oH.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.Xv(i)){if(this.tc(i))return this.ec("Exception dropped: matched a suppression rule"),void oH.info("Skipping exception capture because a suppression rule matched");if(!this.Kv&&this.ic(i))return this.ec("Exception dropped: thrown by a browser extension"),void oH.info("Skipping exception capture because it was thrown by an extension");if(!this.Kv&&this.rc(i))return this.ec("Exception dropped: thrown by an injected browser script"),void oH.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.nc(i))return this.ec("Exception dropped: thrown by the PostHog SDK"),void oH.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.Zv.enabled&&Z(e.$exception_steps)?this.sc(e):e,r="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;r&&(s.$release_id=r);try{var n=this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",uu:!0});return n&&this.Jv.clear(),n}catch(e){return oH.error("Failed to capture exception event. Dropping this exception.",e),void this.Jv.clear()}}catch(e){return void oH.error("Failed to process exception event. Ignoring this exception.",e)}}sc(e){try{var t=this.Jv.getAttachable();return 0===t.length?e:w({},e,{$exception_steps:t})}catch(t){return oH.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ec(e){this.Zv.enabled&&this.Jv.add({[t9]:e,[ie]:(new Date).toISOString()})}Yv(e){return G(e)?w({},e):{}}Qv(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}tc(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return K(i)&&i.length>0&&e.$exception_types.push(i),K(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Vv.some(e=>{var i=e.values.map(e=>{var i=ax[e.operator],s=t[e.key];if(!i||!s)return!1;var r=z(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return oH.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}ic(e){var t=e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}),i=t.filter(e=>{var t=e.filename;return!!t&&oV.some(e=>
1t.startsWith(e))});return 0!==i.length&&(!i.every(e=>{var t=e.filename;return!!t&&t.startsWith(oz)})||e.some(e=>{var t=e.value;return K(t)&&t.includes("isolatedAPI.contexts.topHostname")})&&!t.some(e=>{var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(oz))}))}rc(e){return e.some(e=>{var t=e.value;return K(t)&&oG.some(e=>t.includes(e))})}nc(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}Xv(e){return!Z(e)&&z(e)}}},o5,{siteApps:class{constructor(e){this.uc=0,this._instance=e,this.hc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}dc(e,t){if(t){var i=this.globalsForEvent(t);this.hc.push(i),this.hc.length>1e3&&(this.hc=this.hc.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.dc.bind(this));this.vc=()=>{e(),this.hc=[],this.vc=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,p=e.$set;return{event:w({},x(e,om),{properties:w({},e.properties,p?{$set:w({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:w({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}cc(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(oy.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(oy.error("prepare_external_dependency_script returned null"),null):e}fc(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,o,u=null==l?void 0:l.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.uc++,this.gc)return this.mc();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.cc(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!Y(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(o=u.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.gc=()=>
vendor: 13,487 bytes, line 1
1{c.forEach(e=>e()),this.gc=void 0},this.mc()}mc(){var e=!1;return()=>{var t;e||(e=!0,this.uc--,0===this.uc&&(null==(t=this.gc)||t.call(this)))}}yc(e,t){void 0===t&&(t=!0);var i=this.fc();try{var s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.hc.length&&(oy.info("Processing "+this.hc.length+" events for site app with id "+e.id),this.hc.forEach(e=>this.yc(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.vc)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,oy.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.yc(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){oy.error(ob+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){oy.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}bc(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}_c(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.yc(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){oy.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.bc(),void this._instance.on("eventCaptured",e=>this._c(e))):void oy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.vc)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length)if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;_["__$$ph_site_app_"+t]=r._instance,null==(e=_.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return oy.error(ob+t,e)})}();else oy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},o6,{tracingHeaders:class{constructor(e){this.wc=void 0,this.kc=void 0,this.Sc=void 0,this.$v=()=>{var e,t,i=this.xc();i?(W(this.wc)&&(this.wc=null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),W(this.kc)&&(this.kc=null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.zv()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Ks(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return os.error("failed to load script",t);e()})}Cc(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}xc(){var e=this.Cc();return z(e)?(z(this.Sc)?this.Sc.splice(0,this.Sc.length,...e):this.Sc=[...e],e.length>0?this.Sc:void 0):(z(this.Sc)&&this.Sc.splice(0),this.Sc=e||void 0,this.Sc)}zv(){var e,t;null==(e=this.wc)||e.call(this),null==(t=this.kc)||t.call(this),this.wc=void 0,this.kc=void 0}startIfEnabledOrStop(){this.xc()?this.Ks(this.$v):this.zv()}}},{toolbar:class{constructor(e){this.instance=e}Tc(e){_.ph_toolbar_state=e}Mc(){var e;return null!=(e=_.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),sI(this.instance.config)||!n||!l)return!1;e=null!=e?e:n.location,i=null!=i?i:n.history;try{if(!t){try{n.localStorage.setItem("test","test"),n.localStorage.removeItem("test")}catch(e){return!1}t=null==n?void 0:n.localStorage}var s,r=oA||rZ(e.hash,"__posthog")||rZ(e.hash,"state"),a=r?sS(()=>JSON.parse(atob(decodeURIComponent(r))))||sS(()=>JSON.parse(decodeURIComponent(r))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(oO)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Ec(e){var t=_.ph_load_toolbar||_.ph_load_editor;!Z(t)&&V(t)?t(e,this.instance):oT.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==l||!l.getElementById(s9));if(!n||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=w({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(n.localStorage.setItem(oO,JSON.stringify(w({},r,{source:void 0}))),2===this.Mc())?this.Ec(r):0===this.Mc()&&(this.Tc(1),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(oT.error("[Toolbar] Failed to load",e),this.Tc(0)):(this.Tc(2),this.Ec(r))}),sC(n,"turbolinks:load",()=>{this.Tc(0),this.loadToolbar(r)})),!0}Ic(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},o8,{conversations:class{constructor(e){this.Rc=void 0,this._conversationsManager=null,this.Pc=!1,this.je=null,this.Ac=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Fc=e.ok,e.ok)){var t=e.config.conversations;Z(t)||(ee(t)?this.Rc=t:(this.Rc=t.enabled,this.je=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Rc=void 0,this.je=null,this.Fc=void 0,this.Ac=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Pc||this._instance.config.disable_conversations||sI(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!W(this.Rc)&&this.Rc)if(this.je&&this.je.token){this.Pc=!0;try{var t=e.initConversations;if(t)return this.Oc(t),void(this.Pc=!1);var i=e.loadExternalDependency;if(!i)return void this.Lc(su);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Lc("Could not load conversations script",t):this.Oc(e.initConversations),this.Pc=!1})}catch(e){this.Lc("Error initializing conversations",e),this.Pc=!1}}else oJ.error("Conversations enabled but missing token in remote config.")}}Oc(e){if(this.je)try{this._conversationsManager=e(this.je,this._instance),this.Ac=!1,oJ.info("Conversations loaded successfully")}catch(e){this.Lc("Error completing conversations initialization",e)}else oJ.error("Cannot complete initialization: remote config is null")}Lc(e,t){oJ.error(e,t),this._conversationsManager=null,this.Pc=!1,this.Ac=!0}show(){this._conversationsManager?this._conversationsManager.show():oJ.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Rc&&!Y(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":sI(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Fc?"remote_config_failed":W(this.Rc)?this.Fc?"disabled_in_project":"remote_config_pending":this.Rc?Z(this.je)||!this.je.token?"missing_token":null!=_&&_.__PosthogExtensions__?this.Pc?"initializing":this.Ac?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return b(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oJ.warn(oY),null)})()}getMessages(e,t){var i=this;return b(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oJ.warn(oY),null)})()}markAsRead(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oJ.warn(oY),null)})()}getTickets(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oJ.warn(oY),null)})()}requestRestoreLink(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oJ.warn(oY),null)})()}restoreFromToken(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oJ.warn(oY),null)})()}restoreFromUrlToken(){var e=this;return b(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oJ.warn(oY),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}yu(){var e;null==(e=this._conversationsManager)||e.setIdentity()}bu(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.name="logs",this.Dc=!1,this.$c=!1,this.Nc=!1,this.A=il("[logs]"),this.qc=w({},this.A,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(o2)||i.A.error(...t)}}),this.fo=[],this.jc=[],this.vd=0,this.Fs=!1,this.Bc=[],this.Hc=[],this.zc=!1,this.Uc=!1,this.Wc=()=>{var e,t;this.Fs||(this.vd=0,null==(e=this.Vc)||e.onReconnect(),null==(t=this.Gc)||t.onReconnect())},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Dc=!0),n&&sC(n,"online",this.Wc)}Zc(e,t,i,s){var r,n=oZ(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new tL(this.Qc(e,t),n,this.qc,()=>this.Jc(),e=>e(),void 0,s),n]}Kc(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Vc||this.Yc!==t){null==(i=this.Vc)||i.reset(),this.Yc=t;var i,s=this.Zc(()=>this.fo,e=>{this.fo=e});this.Vc=s[0],this.Xc=s[1]}return this.Vc}tf(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Gc||this.ef!==t){null==(i=this.Gc)||i.reset(),this.ef=t;var i,s=this.Zc(()=>this.jc,e=>{this.jc=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oX);this.Gc=s[0],this.if=s[1]}return this.Gc}setup(e){var t;if(!this.Fs){this.$s=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this.Dc=!0),(this.Dc||this.rf()&&this.nf())&&this.sf();var i=!1,s=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Fs?s.dispose():(this.Ns=s,i||this.loadIfEnabled())}}dispose(){var e,t,i,s;this.Fs||(this.Fs=!0,this.af(),null==(e=this.Ns)||e.dispose(),this.Ns=void 0,this.$s=void 0,this.Nc=!1,null==n||n.removeEventListener("online",this.Wc),null==(t=this.lf)||t.call(this),this.lf=void 0,null==(i=this.Vc)||i.reset(),null==(s=this.Gc)||s.reset())}onRemoteConfig(e){var t,i;if(!this.Fs){var s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Z(s)?this.uf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[iC]:!!s}),s?(this.Dc=!0,this.$c||this.sf(),this.loadIfEnabled()):this.uf())}}reset(){var e,t,i,s;this.af(),null==(e=this.Vc)||e.clearQueue(),this.fo=[],null==(t=this.Vc)||t.reset(),null==(i=this.Gc)||i.clearQueue(),this.jc=[],null==(s=this.Gc)||s.reset(),this.vd=0}captureLog(e){this.Fs||this.Kc().captureLog(e)}captureConsoleLog(e){this.Fs||this.tf().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.Fs||this.tf().captureLog(e,{context:t,occurredAtMs:i})}nf(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[iC])}rf(){var e,t;return null==(e=this._instance)||null==e.ho||!e.ho()||!(null==(t=_._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)}wu(){var e;this.af(),null==(e=this.Gc)||e.clearQueue(),this.jc=[]}uf(){this.Dc||this.af()}sf(){var e,t=this;if(!this.zc&&null!=_&&_.console){var i=oZ(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,s=function(e){var s;try{s=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(_.console[e])}catch(e){return 0}if(!s)return 0;t.Hc.push(oi(_.console,e,r=>{var n=function(){for(var s=arguments.length,n=Array(s),a=0;s>a;a++)n[a]=arguments[a];try{t.hf(e,n,i)}catch(e){}return r.apply(_.console,n)};return n.__rrweb_original__=s,n}))};for(var r of oQ)s(r);this.zc=!0,this.df=setTimeout(()=>{this.af()},3e4)}}hf(e,t,i){var s;if(this.zc&&!this.Uc&&0!==t.length)if(null!=(s=this._instance)&&s.is_capturing()){if(i>this.Bc.length){this.Uc=!0;try{this.Bc.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Jc()})}finally{this.Uc=!1}}}else this.af()}af(){if(this.Bc=[],this.zc){for(var e of(this.zc=!1,this.df&&(clearTimeout(this.df),this.df=void 0),this.Hc))e();this.Hc=[]}}vf(){var e=this.Bc;return this.af(),e}get logger(){return this.cf||(this.cf={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.cf}flushLogs(e){e?this.ff(e):(this.Vc&&this.Vc.flush().catch(e=>this.pf(e)),this.Gc&&this.Gc.flush().catch(e=>this.pf(e)))}pf(e){o2(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.Fs&&this.Dc&&!this.$c&&!this.Nc){var e=null==_?void 0:_.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.af();var t=e.loadExternalDependency;if(!t)return this.A.error(su),void this.af();this.Nc=!0;try{t(this._instance,"logs",t=>{if(this.Nc=!1,!this.Fs&&this.Dc){var i=e.logs;if(t||null==i||!i.initializeLogs)this.A.error("Could not load logs script",t),this.af();else{var s,r,n=this.vf();this.lf=i.initializeLogs(null!=(s=this.$s)?s:this._instance),this.$c=!0,n.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!=(r=this.$s)?r:this._instance,n))}}})}catch(e){throw this.Nc=!1,e}}}Qc(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===F.LogsQueue?e():void 0,setPersistedProperty(e,i){e===F.LogsQueue&&t(null!=i?i:[])},ss:e=>this.ss(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}ss(e){return new Promise(t=>{if(rQ(this.vd,3))t({kind:"fatal",error:o1(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:o1(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.gf(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.mf(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:o1(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}mf(e){(0!==e||this._instance.__loaded)&&(this.vd=rX(e,this.vd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}ff(e){this.fo.length>0&&this.yf(e,this.fo,this.Xc,m.LIB_NAME,e=>{this.fo=e}),this.jc.length>0&&this.yf(e,this.jc,this.if,oX,e=>{this.jc=e})}yf(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=tR(n,tA(i,m.LIB_NAME,m.LIB_VERSION),s,m.LIB_VERSION);this._instance._send_request({method:"POST",url:this.gf(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}gf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Jc(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=i.windowId,r=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=s,Z(r)||(t.sessionStartTimestamp=r),Z(n)||(t.lastActivityTimestamp=n)}if(null!=_&&null!=(e=_.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tp(_.location.href):_.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this.A=il("[metrics]"),this._instance=e}initialize(){}Kc(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.Vc&&this.Yc===l||(null==(o=this.Vc)||o.reset(),this.Yc=l,this.Vc=new tq(this.Qc(),{serviceName:null!=(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])?e:null==l?void 0:l.serviceName,serviceVersion:null!=(t=null==n?void 0:n["service.version"])?t:null==l?void 0:l.serviceVersion,environment:null!=(i=null==n?void 0:n["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(s=null==l?void 0:l.flushIntervalMs)?s:1e4,maxSeriesPerFlush:null!=(r=null==l?void 0:l.maxSeriesPerFlush)?r:1e3},this.A)),this.Vc}count(e,t,i){void 0===t&&(t=1),this.Kc().count(e,t,i)}
1gauge(e,t,i){this.Kc().gauge(e,t,i)}histogram(e,t,i){this.Kc().histogram(e,t,i)}flush(e){if(!this.Vc)return Promise.resolve();if(e){var t=this.Vc.drainWindow();return t&&this.Ss(t,e),Promise.resolve()}return this.Vc.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Vc)||e.reset()}Qc(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ss:e=>t.Ss(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}Ss(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(w({method:"POST",url:this.bf(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}bf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});a2.__defaultExtensionClasses=w({},o4);var o7=(m.SDK_DIST_CHANNEL="npm",s=aH[aY]=new a2,function(){function e(){e.done||(e.done=!0,aZ=!1,sx(aH,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():sC(l,"DOMContentLoaded",e,{capture:!1}):n&&io.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,o7],67326);var o9=e.i(96359),le=(0,o9.createContext)({get client(){return r},bootstrap:void 0}),lt=function(e){return"function"==typeof e},li=function(e,t){return(li=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var ls=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||"[object Error]"===t||"[object Exception]"===t||"[object DOMException]"===t||"[object DOMError]"===t},lr=function(e,t){for(var i=new WeakSet,s=e;!i.has(s);){if(i.add(s),!ls(s.cause)){void 0!==s.cause&&(t.cause=s.cause),s.cause=t;return}s=s.cause}},ln=function(e,t){if(!t)return e;var i=Error(ls(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return(i.name="React ErrorBoundary ".concat(ls(e)?e.name:"Error"),i.stack=t,ls(e))?(lr(e,i),e):i},la={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=la,i}li(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;lt(s)?i=s(e,t):"object"==typeof s&&(i=s);var r=this.context.client,n=t.componentStack,a=r.captureException(ln(e,n),i);this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:a})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return lt(t)?t():t;var r=lt(i)?o9.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return o9.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),o9.default.createElement(o9.default.Fragment,null))},i.contextType=le}(o9.default.Component),r=o7,e.s(["PostHogProvider",0,function(e){var t,i,s=e.children,n=e.client,a=e.apiKey,o=e.options,l=(0,o9.useRef)(null),u=(0,o9.useMemo)(function(){if(n)return a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n;var e=r;return a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[n,a,JSON.stringify(o)]);return(0,o9.useEffect)(function(){if(!n&&a){var e=r,t=l.current;t?(a!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!function e(t,i,s){if(void 0===s&&(s=new WeakMap),t===i)return!0;
1if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(s.has(t)&&s.get(t)===i)return!0;s.set(t,i);var r=Object.keys(t),n=Object.keys(i);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++){var o=r[a];if(!n.includes(o)||!e(t[o],i[o],s))return!1}return!0}(o,t.options)&&e.set_config(o)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(a,o)),l.current={apiKey:a,options:null!=o?o:{}}}},[n,a,JSON.stringify(o)]),o9.default.createElement(le.Provider,{value:{client:u,bootstrap:null!=(t=null==o?void 0:o.bootstrap)?t:null==(i=null==n?void 0:n.config)?void 0:i.bootstrap}},s)},"usePostHog",0,function(){return(0,o9.useContext)(le).client}],20687)}]);
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.